[GH-ISSUE #69] Values and tokens not populating automatically from docker compose #35

Closed
opened 2026-02-27 15:54:41 +03:00 by kerem · 4 comments
Owner

Originally created by @Tailscale-VPS on GitHub (Aug 8, 2025).
Original GitHub issue: https://github.com/RayLabsHQ/gitea-mirror/issues/69

My docker compose

services:
  gitea-mirror:
    image: docker.gitea.com/gitea:1.24.4
    container_name: gitea-mirror
    security_opt:
      - no-new-privileges:true
    networks:
      - proxy
    environment:
      - USER_UID=1001
      - USER_GID=1001
      - GITEA__service__DISABLE_REGISTRATION=true
      - GITEA__service__REQUIRE_SIGNIN_VIEW=true
    volumes:
      - /home/ubuntu/docker/stacks/app-data/gitea-mirror:/data
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    labels:
      - traefik.enable=true
      - traefik.http.routers.gitea-mirror-rtr.entrypoints=websecure
      - traefik.http.routers.gitea-mirror-rtr.rule=Host(`site.example.com`)
      - traefik.http.routers.gitea-mirror-rtr.middlewares=chain-authelia@file
      - traefik.http.routers.gitea-mirror-rtr.service=gitea-mirror-svc
      - traefik.http.services.gitea-mirror-svc.loadbalancer.server.port=3000
    restart: unless-stopped

  gitea-mirror-backend:
    image: ghcr.io/raylabshq/gitea-mirror:v3.2.1
    container_name: gitea-mirror-backend
    security_opt:
      - no-new-privileges:true
    networks:
      - proxy
    user: 1001:1001
    environment:
      - NODE_ENV=production
      - DATABASE_URL=file:data/gitea-mirror.db
      - HOST=0.0.0.0
      - PORT=4321
      - BETTER_AUTH_URL=https://site-backend.example.com
      - BETTER_AUTH_TRUSTED_ORIGINS=https://site-backend.example.com
      - BETTER_AUTH_SECRET=LtQ5NC8ZoHrM
      - ENCRYPTION_SECRET=dH4SsQfWUo
      - GITHUB_USERNAME=Username
      - GITHUB_TOKEN=ghp_wbm6ah
      - SKIP_FORKS=false
      - PRIVATE_REPOSITORIES=true
      - MIRROR_ISSUES=true
      - MIRROR_WIKI=true
      - MIRROR_STARRED=true
      - MIRROR_ORGANIZATIONS=false
      - PRESERVE_ORG_STRUCTURE=false
      - ONLY_MIRROR_ORGS=false
      - SKIP_STARRED_ISSUES=false
      - GITEA_URL=http://gitea-mirror:3000
      - GITEA_TOKEN=3661faca771b6e3
      - GITEA_USERNAME=admin
      - GITEA_ORGANIZATION=github-mirrors
      - GITEA_ORG_VISIBILITY=public
      - DELAY=3600
    volumes:
      - /home/ubuntu/docker/stacks/app-data/gitea-mirror-backend:/app/data
    labels:
      - traefik.enable=true
      - traefik.http.routers.gitea-mirror-backend-rtr.entrypoints=websecure
      - traefik.http.routers.gitea-mirror-backend-rtr.rule=Host(`site-backend.example.com`)
      - traefik.http.routers.gitea-mirror-backend-rtr.middlewares=chain-authelia@file
      - traefik.http.routers.gitea-mirror-backend-rtr.service=gitea-mirror-backend-svc
      - traefik.http.services.gitea-mirror-backend-svc.loadbalancer.server.port=4321
    healthcheck:
      test:
        [
          "CMD",
          "wget",
          "--no-verbose",
          "--tries=3",
          "--spider",
          "http://localhost:4321/api/health",
        ]
      interval: 30s
      timeout: 10s
      retries: 5
      start_period: 15s
    depends_on:
      - gitea-mirror
    restart: unless-stopped

networks:
  proxy:
    external: true

After using this compose the UI should have been populated with all the values, But when I opened it i had to manually fill everything like Github username, Gitea username , tokens,etc.

Originally created by @Tailscale-VPS on GitHub (Aug 8, 2025). Original GitHub issue: https://github.com/RayLabsHQ/gitea-mirror/issues/69 My docker compose ``` services: gitea-mirror: image: docker.gitea.com/gitea:1.24.4 container_name: gitea-mirror security_opt: - no-new-privileges:true networks: - proxy environment: - USER_UID=1001 - USER_GID=1001 - GITEA__service__DISABLE_REGISTRATION=true - GITEA__service__REQUIRE_SIGNIN_VIEW=true volumes: - /home/ubuntu/docker/stacks/app-data/gitea-mirror:/data - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro labels: - traefik.enable=true - traefik.http.routers.gitea-mirror-rtr.entrypoints=websecure - traefik.http.routers.gitea-mirror-rtr.rule=Host(`site.example.com`) - traefik.http.routers.gitea-mirror-rtr.middlewares=chain-authelia@file - traefik.http.routers.gitea-mirror-rtr.service=gitea-mirror-svc - traefik.http.services.gitea-mirror-svc.loadbalancer.server.port=3000 restart: unless-stopped gitea-mirror-backend: image: ghcr.io/raylabshq/gitea-mirror:v3.2.1 container_name: gitea-mirror-backend security_opt: - no-new-privileges:true networks: - proxy user: 1001:1001 environment: - NODE_ENV=production - DATABASE_URL=file:data/gitea-mirror.db - HOST=0.0.0.0 - PORT=4321 - BETTER_AUTH_URL=https://site-backend.example.com - BETTER_AUTH_TRUSTED_ORIGINS=https://site-backend.example.com - BETTER_AUTH_SECRET=LtQ5NC8ZoHrM - ENCRYPTION_SECRET=dH4SsQfWUo - GITHUB_USERNAME=Username - GITHUB_TOKEN=ghp_wbm6ah - SKIP_FORKS=false - PRIVATE_REPOSITORIES=true - MIRROR_ISSUES=true - MIRROR_WIKI=true - MIRROR_STARRED=true - MIRROR_ORGANIZATIONS=false - PRESERVE_ORG_STRUCTURE=false - ONLY_MIRROR_ORGS=false - SKIP_STARRED_ISSUES=false - GITEA_URL=http://gitea-mirror:3000 - GITEA_TOKEN=3661faca771b6e3 - GITEA_USERNAME=admin - GITEA_ORGANIZATION=github-mirrors - GITEA_ORG_VISIBILITY=public - DELAY=3600 volumes: - /home/ubuntu/docker/stacks/app-data/gitea-mirror-backend:/app/data labels: - traefik.enable=true - traefik.http.routers.gitea-mirror-backend-rtr.entrypoints=websecure - traefik.http.routers.gitea-mirror-backend-rtr.rule=Host(`site-backend.example.com`) - traefik.http.routers.gitea-mirror-backend-rtr.middlewares=chain-authelia@file - traefik.http.routers.gitea-mirror-backend-rtr.service=gitea-mirror-backend-svc - traefik.http.services.gitea-mirror-backend-svc.loadbalancer.server.port=4321 healthcheck: test: [ "CMD", "wget", "--no-verbose", "--tries=3", "--spider", "http://localhost:4321/api/health", ] interval: 30s timeout: 10s retries: 5 start_period: 15s depends_on: - gitea-mirror restart: unless-stopped networks: proxy: external: true ``` After using this compose the UI should have been populated with all the values, But when I opened it i had to manually fill everything like Github username, Gitea username , tokens,etc.
kerem closed this issue 2026-02-27 15:54:41 +03:00
Author
Owner

@arunavo4 commented on GitHub (Aug 9, 2025):

Hi @Tailscale-VPS over time these have got neglegted since I was using the Web UI for eveyrthing. I have updated the code to load these Env variables. I have PR open I will test the PR and make a new version release. Feel free to test the PR.

<!-- gh-comment-id:3170189120 --> @arunavo4 commented on GitHub (Aug 9, 2025): Hi @Tailscale-VPS over time these have got neglegted since I was using the Web UI for eveyrthing. I have updated the code to load these Env variables. I have PR open I will test the PR and make a new version release. Feel free to test the PR.
Author
Owner

@Tailscale-VPS commented on GitHub (Aug 9, 2025):

Tested latest image v3.2.2 after cleaning the data dir.
Initially after 1st boot -

Image
Probably because no user exists at 1st boot.

After creating the user and restarting the container it picked up the env variables -

Image

One thing i like to point out is that release,tags and some other metadata was not ticked (as there are no env variables in docker compose for now).
Can we also make env variables for those?

<!-- gh-comment-id:3170367630 --> @Tailscale-VPS commented on GitHub (Aug 9, 2025): Tested latest image v3.2.2 after cleaning the data dir. Initially after 1st boot - ![Image](https://github.com/user-attachments/assets/a376bf2b-550d-435e-a53b-b6ee6ba9ceb0) Probably because no user exists at 1st boot. After creating the user and restarting the container it picked up the env variables - ![Image](https://github.com/user-attachments/assets/0e8f0265-c1d4-4ee2-a7d1-83dda60074b3) One thing i like to point out is that release,tags and some other metadata was not ticked (as there are no env variables in docker compose for now). Can we also make env variables for those?
Author
Owner

@arunavo4 commented on GitHub (Aug 9, 2025):

Sure @Tailscale-VPS I will add eveything as Docker env variables. Thank you for the quick feeback

<!-- gh-comment-id:3170380000 --> @arunavo4 commented on GitHub (Aug 9, 2025): Sure @Tailscale-VPS I will add eveything as Docker env variables. Thank you for the quick feeback
Author
Owner

@arunavo4 commented on GitHub (Aug 9, 2025):

@Tailscale-VPS I have added more Env variables in v3.2.3. Have a look.

<!-- gh-comment-id:3170407718 --> @arunavo4 commented on GitHub (Aug 9, 2025): @Tailscale-VPS I have added more Env variables in v3.2.3. Have a look.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/gitea-mirror#35
No description provided.