fix: ship nginx routes with gateway release

This commit is contained in:
nyan404 committed 2026-08-25 21:42:44 +03:00
1 parent 3c40bff4e8
commit 02d367f008
3 files changed
+7 -3

No files matched your search

+3 -1
View File
@@ -1,5 +1,6 @@
FROM --platform=linux/amd64 reg.nyan404.ru/cwshed/cwshed-base:nginx-c2431df29ccc
COPY nginx.conf /etc/nginx/nginx.conf
COPY web /usr/share/nginx/html
RUN chmod -R 755 /usr/share/nginx/html \
@@ -7,4 +8,5 @@ RUN chmod -R 755 /usr/share/nginx/html \
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
#+ Static gateway image: package the web assets with the prebuilt nginx base used in production.
#+ The release image carries its own Nginx routing configuration, so new public
#+ routes are deployed together with their application and static assets.
+2
View File
@@ -63,3 +63,5 @@ Production Belki images and Kubernetes workloads require `linux/amd64`. CI sets
# 2026-08-25: standalone Sudoku
`/sudoku` is a separate public route, backed by `app/sudoku.py` and `web/sudoku.html`. A supplied nickname (case-insensitive) is intentionally only a resume key, not authentication; never present it as private storage. Games persist in `sudoku_games` through `BELKI_DATABASE_URL` in production or `SUDOKU_DB` locally. The public API must never return the saved solution, and it must keep original clues immutable. The generator is the explicitly requested `dokusan==0.1.0`; it is GPL-3.0-only, Alpha, and last released in 2023, so retain the `NOTICE`/README license disclosure and revalidate it before future runtime upgrades.
The final gateway Dockerfile must copy `nginx.conf` into the release image, not rely exclusively on the immutable gateway base. This keeps `/sudoku` and other route changes from producing a successful deployment with an old Nginx configuration and a public 404.
+2 -2
View File
@@ -21,7 +21,7 @@
- GitLab CI runs the build job.
- Production container architecture is explicitly `linux/amd64`: CI sets `DOCKER_DEFAULT_PLATFORM` and passes `--platform linux/amd64`, Dockerfiles pin the platform, and Kubernetes workloads select nodes labeled `kubernetes.io/arch: amd64`. The former private Python base tag was arm64-only and is no longer used by the application image.
- The job targets GitLab runner tag `fast` and builds through a privileged `docker:29.6.1-dind` service at `DOCKER_HOST=tcp://docker:2375`, with an explicit `alias: docker` and `DOCKER_TLS_CERTDIR=""`.
- Runtime dependency layers are prebuilt and stored in the private registry: `reg.nyan404.ru/cwshed-clone/belki-base:py312-d6c42c4497ce` contains Python 3.12, `pip 26.2.1`, and the current `requirements.txt`; `reg.nyan404.ru/cwshed/cwshed-base:nginx-c2431df29ccc` contains Nginx plus `nginx.conf`. Adding, removing, or updating a runtime dependency requires rebuilding/pushing and retagging the matching base image before CI; ordinary CI builds only copy application or static files.
- Runtime dependency layers are prebuilt and stored in the private registry: `reg.nyan404.ru/cwshed-clone/belki-base:py312-d6c42c4497ce` contains Python 3.12, `pip 26.2.1`, and the current `requirements.txt`; `reg.nyan404.ru/cwshed/cwshed-base:nginx-c2431df29ccc` provides Nginx. Adding, removing, or updating a runtime dependency requires rebuilding/pushing and retagging the matching base image before CI. The final gateway image copies both `nginx.conf` and static assets so routing changes ship in an ordinary release.
- The `ryzen-runner-dind` service on `root@10.3.1.168` has a valid Runner registration and its helper container can reach `https://git.nyan404.ru/`. On 2026-08-21 its malformed `DOCKER_AUTH_CONFIG` was removed and the pre-change configuration was backed up on the host as `/etc/gitlab-runner/config.toml.bak-20260821-1334`.
- The job waits for the DinD daemon and runs `docker info` before starting the build.
- GitLab Runner retries source checkout up to three times (`GET_SOURCES_ATTEMPTS=3`) to absorb transient connectivity failures before the job script starts. A persistent inability to reach `git.nyan404.ru:443` still requires repair on the selected runner host.
@@ -50,7 +50,7 @@
- 2026-08-25: made the active `/sudoku` game screen viewport-bound on phones. The board and keypad scale to the available dynamic viewport; the save/new/user actions are fixed above the safe area, avoiding vertical document scrolling. Added `sudoku.webmanifest` and `sudoku-sw.js` for standalone installation, with network-first navigation so deploys do not become stuck on a cached shell.
- 2026-08-25: added an in-app `/sudoku` install action. Android uses a saved `beforeinstallprompt` event after a tap; iOS/iPadOS displays explicit Safari add-to-home-screen instructions because that event is not supported there.
- 2026-08-25: added `/sudoku`: a standalone mobile-first game with nickname-based cross-device resume, server-side answer keys, automatic save, new-board generation, and four ranked difficulty presets. `app/sudoku.py` stores `sudoku_games` in the same production PostgreSQL database as Belki, or `SUDOKU_DB` SQLite locally. The API returns no solution data; it validates clues and Sudoku constraints before saving.
- 2026-08-25: added `/sudoku` and `/sudoku/` gateway proxies in `nginx.conf`; publishing them requires rebuilding the immutable `Dockerfile.gateway-base` image and updating `Dockerfile.gateway` to its resulting tag before CI/deployment.
- 2026-08-25: added `/sudoku` and `/sudoku/` gateway proxies in `nginx.conf`. The final gateway image copies this configuration after its Nginx base, so routing changes are delivered by the standard CI build without requiring a separate base-image release.
- 2026-08-25: added `dokusan==0.1.0` as the explicitly selected Sudoku generator/solver. It is GPL-3.0-only and Alpha/last released in 2023; the image's distribution obligations and upstream source are recorded in `NOTICE` and `README.md`. The lifecycle check found the pinned PyPI release available; that is not a security assessment.
- 2026-06-27: updated the Docker CI image to `docker:29.6.1-cli` and aligned the pipeline to `docker:dind` with `DOCKER_HOST=tcp://docker:2375`.
- 2026-06-27: verified the working runner on `docker-03.homelab.local` and confirmed `docker:29.6.1-dind` is reachable from the job network.