From 3c2b29ad26f570960a3b54eacbe0db9a14e3f052 Mon Sep 17 00:00:00 2001 From: zwitschi Date: Mon, 3 Aug 2026 19:02:30 +0200 Subject: [PATCH] refactor: rename Gitea environment variables to CI registry prefix update SETUP.md and .env.example --- .env.example | 17 +++++++--------- .gitea/workflows/cd.yml | 4 ++-- .gitea/workflows/ci.yml | 6 +++--- .gitea/workflows/dependency-updates.yml | 4 ++-- .gitea/workflows/release.yml | 6 +++--- SETUP.md | 26 ++++++++++++------------- docker-compose.yml | 6 +++--- 7 files changed, 32 insertions(+), 37 deletions(-) diff --git a/.env.example b/.env.example index 7b5584f..dcd09f9 100644 --- a/.env.example +++ b/.env.example @@ -31,10 +31,12 @@ ADMIN_SESSION_TTL_HOURS=12 # VITE_PUBLIC_HLS_URL=http://localhost/hls/playlist.m3u8 # Gitea Container Registry (for self-hosted Docker images) -GITEA_REGISTRY_URL=git.allucanget.biz -GITEA_USERNAME=your-gitea-username -GITEA_TOKEN=your-gitea-token -GITEA_REGISTRY_NAMESPACE=zwitschi/linearvoid +CI_REGISTRY_URL=git.allucanget.biz +CI_REGISTRY_USER=your-gitea-username +CI_REGISTRY_TOKEN=your-gitea-token +CI_REGISTRY_NAMESPACE=zwitschi/linearvoid +# Gitea API access (optional, for CI/release automation) +CI_SERVER_URL=https://git.allucanget.biz # Chat / Application Database (compose-safe PostgreSQL by default, SQLite optional) DATABASE_URL=postgres://linearvoid:linearvoid@db:5432/linearvoid?sslmode=disable @@ -61,9 +63,4 @@ GRAFANA_PORT=3001 # Development flags NODE_ENV=development -GO_ENV=development - -# Gitea Configuration -GITEA_SERVER_URL=https://git.allucanget.biz -GITEA_TOKEN=your-gitea-token -GITEA_USERNAME=your-gitea-username \ No newline at end of file +GO_ENV=development \ No newline at end of file diff --git a/.gitea/workflows/cd.yml b/.gitea/workflows/cd.yml index ea0a61f..b9a6038 100644 --- a/.gitea/workflows/cd.yml +++ b/.gitea/workflows/cd.yml @@ -22,8 +22,8 @@ jobs: uses: docker/login-action@v3 with: registry: git.allucanget.biz - username: ${{ secrets.GITEA_USERNAME }} - password: ${{ secrets.GITEA_TOKEN }} + username: ${{ secrets.CI_REGISTRY_USER }} + password: ${{ secrets.CI_REGISTRY_TOKEN }} - name: Pull latest images run: | diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 674d652..24d37cf 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -63,8 +63,8 @@ jobs: uses: docker/login-action@v3 with: registry: git.allucanget.biz - username: ${{ secrets.GITEA_USERNAME }} - password: ${{ secrets.GITEA_TOKEN }} + username: ${{ secrets.CI_REGISTRY_USER }} + password: ${{ secrets.CI_REGISTRY_TOKEN }} - name: Extract metadata for Playout id: meta-playout @@ -169,4 +169,4 @@ jobs: with: generate_release_notes: true env: - GITHUB_TOKEN: ${{ secrets.GITEA_TOKEN }} + GITHUB_TOKEN: ${{ secrets.CI_REGISTRY_TOKEN }} diff --git a/.gitea/workflows/dependency-updates.yml b/.gitea/workflows/dependency-updates.yml index 0736bdc..f9a1400 100644 --- a/.gitea/workflows/dependency-updates.yml +++ b/.gitea/workflows/dependency-updates.yml @@ -13,7 +13,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - token: ${{ secrets.GITEA_TOKEN }} + token: ${{ secrets.CI_REGISTRY_TOKEN }} - name: Setup Node.js uses: actions/setup-node@v4 @@ -42,7 +42,7 @@ jobs: - name: Create Pull Request uses: peter-evans/create-pull-request@v5 with: - token: ${{ secrets.GITEA_TOKEN }} + token: ${{ secrets.CI_REGISTRY_TOKEN }} commit-message: "chore: update dependencies" title: "chore: weekly dependency updates" body: | diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 8f96957..efcec15 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -27,8 +27,8 @@ jobs: uses: docker/login-action@v3 with: registry: git.allucanget.biz - username: ${{ secrets.GITEA_USERNAME }} - password: ${{ secrets.GITEA_TOKEN }} + username: ${{ secrets.CI_REGISTRY_USER }} + password: ${{ secrets.CI_REGISTRY_TOKEN }} - name: Extract version id: version @@ -117,4 +117,4 @@ jobs: generate_release_notes: true tag_name: ${{ steps.version.outputs.version }} env: - GITHUB_TOKEN: ${{ secrets.GITEA_TOKEN }} + GITHUB_TOKEN: ${{ secrets.CI_REGISTRY_TOKEN }} diff --git a/SETUP.md b/SETUP.md index d943bfa..0bfa96b 100644 --- a/SETUP.md +++ b/SETUP.md @@ -12,6 +12,7 @@ This guide covers prerequisites, environment setup, running the application loca - **Git**: For cloning and version control. - **Cloudflare Account**: For R2 storage and CDN (free tier sufficient for most use cases). - **Gitea Account**: Required if you want to push images to the self-hosted registry or use the repository's CI/CD flow. + - Create new secrets in Gitea: Settings → Secrets → Actions, add `CI_REGISTRY_USER` (username) and `CI_REGISTRY_TOKEN` (token with `write:packages` scope) - **Hetzner Cloud Account** (optional for production): For the US-East VPS (Ashburn, VA recommended per ADR-001). ## Development Prerequisites @@ -70,10 +71,12 @@ This guide covers prerequisites, environment setup, running the application loca # VITE_PUBLIC_HLS_URL=http://localhost/hls/playlist.m3u8 # Gitea Container Registry (for self-hosted Docker images) - GITEA_REGISTRY_URL=git.allucanget.biz - GITEA_USERNAME=your-gitea-username - GITEA_TOKEN=your-gitea-token - GITEA_REGISTRY_NAMESPACE=zwitschi/linearvoid + CI_REGISTRY_URL=git.allucanget.biz + CI_REGISTRY_USER=your-gitea-username + CI_REGISTRY_TOKEN=your-gitea-token + CI_REGISTRY_NAMESPACE=zwitschi/linearvoid + # Gitea API access (optional, for CI/release automation) + CI_SERVER_URL=https://git.allucanget.biz # Chat / Database DATABASE_URL=postgres://linearvoid:linearvoid@db:5432/linearvoid?sslmode=disable @@ -99,11 +102,6 @@ This guide covers prerequisites, environment setup, running the application loca # Development flags NODE_ENV=development GO_ENV=development - - # Gitea API access (optional, for CI/release automation) - GITEA_SERVER_URL=https://git.allucanget.biz - GITEA_TOKEN=your-gitea-token - GITEA_USERNAME=your-gitea-username ``` 4. **Check local value overrides for Docker Compose**: @@ -162,12 +160,12 @@ This guide covers prerequisites, environment setup, running the application loca 2. **Create an access token**: - Generate a token with the scopes needed for package/registry access and, if applicable, repository automation. - - Store it as `GITEA_TOKEN` in `.env`. + - Store it as `CI_REGISTRY_TOKEN` in `.env`. 3. **Configure registry variables**: - - Set `GITEA_REGISTRY_URL` to the Gitea host. - - Set `GITEA_REGISTRY_NAMESPACE` to the image namespace, for example `zwitschi/linearvoid`. - - Set `GITEA_USERNAME` to the account that will push or pull images. + - Set `CI_REGISTRY_URL` to the Gitea host. + - Set `CI_REGISTRY_NAMESPACE` to the image namespace, for example `zwitschi/linearvoid`. + - Set `CI_REGISTRY_USER` to the account that will push or pull images. 4. **Authenticate Docker to the registry**: @@ -260,7 +258,7 @@ This guide covers prerequisites, environment setup, running the application loca ``` 5. **Publish or verify required images in Gitea**: - - Ensure the `playout`, `chat`, and `nginx` images exist under `${GITEA_REGISTRY_URL}/${GITEA_REGISTRY_NAMESPACE}`. + - Ensure the `playout`, `chat`, and `nginx` images exist under `${CI_REGISTRY_URL}/${CI_REGISTRY_NAMESPACE}`. - Log in to the registry from the VPS before pulling. 6. **Deploy the production stack**: diff --git a/docker-compose.yml b/docker-compose.yml index f4f404e..6ec29d7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,6 @@ services: playout: - image: ${GITEA_REGISTRY_URL:-git.allucanget.biz}/${GITEA_REGISTRY_NAMESPACE:-zwitschi/linearvoid}/playout:latest + image: ${CI_REGISTRY_URL:-git.allucanget.biz}/${CI_REGISTRY_NAMESPACE:-zwitschi/linearvoid}/playout:latest build: context: ./backend/playout dockerfile: Dockerfile @@ -24,7 +24,7 @@ services: start_period: 10s chat: - image: ${GITEA_REGISTRY_URL:-git.allucanget.biz}/${GITEA_REGISTRY_NAMESPACE:-zwitschi/linearvoid}/chat:latest + image: ${CI_REGISTRY_URL:-git.allucanget.biz}/${CI_REGISTRY_NAMESPACE:-zwitschi/linearvoid}/chat:latest build: context: ./backend/chat dockerfile: Dockerfile @@ -51,7 +51,7 @@ services: start_period: 10s nginx: - image: ${GITEA_REGISTRY_URL:-git.allucanget.biz}/${GITEA_REGISTRY_NAMESPACE:-zwitschi/linearvoid}/nginx:latest + image: ${CI_REGISTRY_URL:-git.allucanget.biz}/${CI_REGISTRY_NAMESPACE:-zwitschi/linearvoid}/nginx:latest build: context: ./infrastructure/nginx dockerfile: Dockerfile