# Configuration for gitea-mirror setup
# Initial version: v3.6.0
# Author: Arunavo Ray
# Description: Gitea Mirror is a modern web app for automatically mirroring repositories from GitHub to your self-hosted Gitea instance. It can mirror personal repositories, starred repositories, and organization repositories.

# Name of the big-bear-gitea-mirror application
name: big-bear-gitea-mirror
# Service definitions for the big-bear-gitea-mirror application
services:
  # Service name: big-bear-gitea-mirror
  # The `big-bear-gitea-mirror` service definition
  big-bear-gitea-mirror:
    # Name of the container
    container_name: big-bear-gitea-mirror
    # Image to be used for the container
    image: ghcr.io/raylabshq/gitea-mirror:v3.15.10
    # Container restart policy
    restart: unless-stopped
    # Ports mapping between host and container
    ports:
      # Mapping port 4321 of the host to port 4321 of the container
      - "4321:4321"
    # Volumes to be mounted to the container
    volumes:
      # Mounting the local data directory to the container
      - /DATA/AppData/$AppID/data:/app/data
    # Environment variables for the container
    environment:
      - NODE_ENV=production
      - DATABASE_URL=file:data/gitea-mirror.db
      - HOST=0.0.0.0
      - PORT=4321
      - BETTER_AUTH_URL=http://0.0.0.0:4321
      - BETTER_AUTH_SECRET=your-secret-key-change-this-in-production
      # Optional GitHub/Gitea Mirror Config (can also be set through the UI)
      # - GITHUB_USERNAME=your-github-username
      # - GITHUB_TOKEN=your-github-token
      # - GITEA_URL=your-gitea-url
      # - GITEA_TOKEN=your-gitea-token
      # - GITEA_USERNAME=your-gitea-username
    # Health check configuration
    healthcheck:
      test: ["CMD", "wget", "--no-verbose", "--tries=3", "--spider", "http://localhost:4321/api/health"]
      interval: 30s
      timeout: 10s
      retries: 5
      start_period: 30s
    x-casaos:
      envs:
        - container: NODE_ENV
          description:
            en_us: 'Container Variable: NODE_ENV'
        - container: DATABASE_URL
          description:
            en_us: 'Container Variable: DATABASE_URL'
        - container: HOST
          description:
            en_us: 'Container Variable: HOST'
        - container: PORT
          description:
            en_us: 'Container Variable: PORT'
        - container: BETTER_AUTH_URL
          description:
            en_us: 'Container Variable: BETTER_AUTH_URL'
        - container: BETTER_AUTH_SECRET
          description:
            en_us: 'Container Variable: BETTER_AUTH_SECRET'
      volumes:
        - container: /app/data
          description:
            en_us: 'Container Path: /app/data'
      ports:
        - container: "4321"
          description:
            en_us: 'Container Port: 4321'
x-casaos:
  # Supported CPU architectures for this application
  architectures:
    - amd64
    - arm64
  # Main service for this application
  main: big-bear-gitea-mirror
  # Detailed description for the application
  description:
    en_us: Gitea Mirror is a modern web app for automatically mirroring repositories from GitHub to your self-hosted Gitea instance. It features a user-friendly interface to sync public, private, or starred GitHub repos, mirror entire organizations with structure preservation, and optionally mirror issues and labels. The application includes smart filtering, detailed logs, and scheduled automatic mirroring.
  # Screenshot links for the application
  screenshot_link:
    - https://cdn.jsdelivr.net/gh/bigbeartechworld/big-bear-universal-apps/apps/gitea-mirror/1.png
    - https://cdn.jsdelivr.net/gh/bigbeartechworld/big-bear-universal-apps/apps/gitea-mirror/2.png
    - https://cdn.jsdelivr.net/gh/bigbeartechworld/big-bear-universal-apps/apps/gitea-mirror/3.png
    - https://cdn.jsdelivr.net/gh/bigbeartechworld/big-bear-universal-apps/apps/gitea-mirror/4.png
    - https://cdn.jsdelivr.net/gh/bigbeartechworld/big-bear-universal-apps/apps/gitea-mirror/5.png
    - https://cdn.jsdelivr.net/gh/bigbeartechworld/big-bear-universal-apps/apps/gitea-mirror/6.png
  # Brief tagline for the application
  tagline:
    en_us: Mirror GitHub repositories to Gitea
  # Developer's information
  developer: raylabs.io
  # Author of this particular configuration
  author: RayLabs HQ
  # Icon URL for the application
  icon: https://cdn.jsdelivr.net/gh/bigbeartechworld/big-bear-universal-apps/apps/gitea-mirror/logo-new.png
  # Thumbnail image for the application (if any)
  thumbnail: https://cdn.jsdelivr.net/gh/bigbeartechworld/big-bear-universal-apps/apps/gitea-mirror/1.png
  # Installation tips
  tips:
    before_install:
      en_us: |
        Read this before installing: https://community.bigbeartechworld.com/t/added-gitea-mirror-to-bigbearcasaos/3515?u=dragonfire1119
  # Title for the application
  title:
    en_us: Gitea Mirror
  # Category under which the application falls
  category: BigBearCasaOS
  # Default port mapping for the application
  port_map: "4321"
