Files
gitea-mirror/docker-compose.dev.yml
T
ARUNAVO RAY 3d763cf75e docs: move the user docs to the website and bring the rest up to date (#529)
* docs: move the user docs to the website and fix what the code contradicts

The README is down to the pitch, a quick start and links. The docs/
pages that repeated the website (environment variables, sources, push
targets, notifications, force-push protection, SSO, Nix) and the root
NIX.md and certs/README.md are now short stubs pointing at the site,
after moving their remaining true facts there.

Checking those facts against the code also turned up site pages that
were wrong:
- SAML sign-in does not work from the UI, and the ACS URL was wrong
- the OIDC provider discovery URL lives under /api/auth
- force-push protection does not stop Gitea's own mirror schedule
- a read-only /app/certs mount stops the container at startup
- gitea-mirror-db on Nix does not touch the real database
- several environment variable rows described the wrong behavior
- DESTINATION_PROVIDER is not checked against the destination lock

The link checker now covers every markdown file in the repository, and
four screenshots nothing links to are gone.

* ci: check the environment variable reference against the code

scripts/check-env-docs.ts fails when the app reads a variable the
reference page does not list, or the page lists one nothing reads. The
variables that are read but deliberately undocumented (internal ones,
and those stored but never used) are listed in the script with a
reason, and the check also fails when one of those stops being read.

* docs: bring the maintainer docs up to date

CLAUDE.md, CONTRIBUTING.md, the development workflow, the SSO testing
guide, the Nix packaging notes and the site's own README and CLAUDE.md
described scripts, files, ports and behavior that no longer exist. They
now match the code: Astro 7, multiple sources and destinations, the real
CI steps, the test isolation rules, the TypeScript 7 type check
workaround, and the AGPL license.

GRACEFUL_SHUTDOWN.md and RECOVERY_IMPROVEMENTS.md are merged into
SHUTDOWN_AND_RECOVERY.md. It also records two gaps: a job stopped by a
clean shutdown is not resumed by recovery, and Docker's 10 second stop
timeout is shorter than the 30 second shutdown.

AGENTS.md now points at CLAUDE.md.

* docs: changelog for the docs consolidation

* ci: count the env config loader's envFlag reads in the env check
2026-11-17 16:56:57 +05:30

120 lines
4.1 KiB
YAML

# Development environment with local Gitea instance for testing
# Run with: docker compose -f docker-compose.dev.yml up -d
services:
# Local Gitea instance for testing
gitea:
image: gitea/gitea:latest
container_name: gitea
restart: unless-stopped
entrypoint: ["/tmp/gitea-dev-init.sh"]
environment:
- USER_UID=1000
- USER_GID=1000
- GITEA__database__DB_TYPE=sqlite3
- GITEA__database__PATH=/data/gitea/gitea.db
- GITEA__server__DOMAIN=localhost
- GITEA__server__ROOT_URL=http://localhost:3001/
- GITEA__server__SSH_DOMAIN=localhost
- GITEA__server__SSH_PORT=2222
- GITEA__server__START_SSH_SERVER=true
- GITEA__security__INSTALL_LOCK=true
- GITEA__service__DISABLE_REGISTRATION=false
- GITEA__log__MODE=console
- GITEA__log__LEVEL=Info
ports:
- "3001:3000"
- "2222:22"
volumes:
- gitea-data:/data
- gitea-config:/etc/gitea
- ./scripts/gitea-app.ini:/tmp/app.ini:ro
- ./scripts/gitea-dev-init.sh:/tmp/gitea-dev-init.sh:ro
networks:
- gitea-network
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/"]
interval: 30s
timeout: 10s
retries: 5
start_period: 60s
# Development service connected to local Gitea
gitea-mirror-dev:
# For dev environment, always build from local sources
build:
context: .
dockerfile: Dockerfile
platforms:
- linux/amd64
- linux/arm64
container_name: gitea-mirror-dev
restart: unless-stopped
ports:
- "4321:4321"
volumes:
- gitea-mirror-data:/app/data
# Mount custom CA certificates - choose one option:
# Option 1: Mount individual CA certificates from certs directory
# - ./certs:/app/certs # must be writable: the entrypoint writes ca-bundle.crt here
# Option 2: Mount system CA bundle (if your CA is already in system store)
# - /etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt:ro
depends_on:
- gitea
environment:
- NODE_ENV=development
- DATABASE_URL=file:data/gitea-mirror.db
- HOST=0.0.0.0
- PORT=4321
- BASE_URL=${BASE_URL:-/}
- BETTER_AUTH_SECRET=dev-secret-key
# GitHub/Gitea Mirror Config
- GITHUB_USERNAME=${GITHUB_USERNAME:-your-github-username}
- GITHUB_TOKEN=${GITHUB_TOKEN:-your-github-token}
- GITHUB_EXCLUDED_ORGS=${GITHUB_EXCLUDED_ORGS:-}
- SKIP_FORKS=${SKIP_FORKS:-false}
- PRIVATE_REPOSITORIES=${PRIVATE_REPOSITORIES:-false}
- MIRROR_ISSUES=${MIRROR_ISSUES:-false}
- MIRROR_WIKI=${MIRROR_WIKI:-false}
- MIRROR_STARRED=${MIRROR_STARRED:-false}
- MIRROR_ORGANIZATIONS=${MIRROR_ORGANIZATIONS:-false}
- PRESERVE_ORG_STRUCTURE=${PRESERVE_ORG_STRUCTURE:-false}
- ONLY_MIRROR_ORGS=${ONLY_MIRROR_ORGS:-false}
- SKIP_STARRED_ISSUES=${SKIP_STARRED_ISSUES:-false}
- GITEA_URL=http://gitea:3000
- GITEA_TOKEN=${GITEA_TOKEN:-your-local-gitea-token}
- GITEA_USERNAME=${GITEA_USERNAME:-your-local-gitea-username}
- GITEA_ORGANIZATION=${GITEA_ORGANIZATION:-github-mirrors}
- GITEA_ORG_VISIBILITY=${GITEA_ORG_VISIBILITY:-public}
- DELAY=${DELAY:-3600}
# Optional: Skip TLS verification (insecure, use only for testing)
# - GITEA_SKIP_TLS_VERIFY=${GITEA_SKIP_TLS_VERIFY:-false}
healthcheck:
test:
[
"CMD-SHELL",
"BASE=\"${BASE_URL:-/}\"; if [ \"$${BASE}\" = \"/\" ]; then BASE=\"\"; else BASE=\"$${BASE%/}\"; fi; wget --no-verbose --tries=1 --spider \"http://localhost:4321$${BASE}/api/health\"",
]
interval: 30s
timeout: 5s
retries: 3
start_period: 5s
networks:
- gitea-network
# Define named volumes for data persistence
volumes:
gitea-data: # Gitea data volume
gitea-config: # Gitea config volume
gitea-mirror-data: # Gitea Mirror database volume
# Define networks
networks:
gitea-network:
name: gitea-network
# Let Docker Compose manage this network
# If you need to use an existing network, uncomment the line below
# external: true