From 69650b64648bfbaa0dc7766952406e01c786077c Mon Sep 17 00:00:00 2001 From: Masahiko AMANO Date: Thu, 11 Jun 2026 11:03:26 +0300 Subject: [PATCH] chore(project): set the default port to 42776 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make 42776 the project's default listen port everywhere :8080 was the default: .env.example, the Go config fallback, the Dockerfile (ENV/EXPOSE/healthcheck), and the docs example. 42776 is the sum of the Unicode code points of 七夕 (七 U+4E03 = 19971, 夕 U+5915 = 22805). Co-Authored-By: Claude Opus 4.8 --- .env.example | 4 +++- Dockerfile | 6 +++--- backend/internal/config/config.go | 2 +- docs/GO_PROJECT_STRUCTURE.md | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.env.example b/.env.example index 698ae16..9bffdc1 100644 --- a/.env.example +++ b/.env.example @@ -6,7 +6,9 @@ # --------------------------------------------------------------------------- # Server # --------------------------------------------------------------------------- -LISTEN_ADDR=:8080 +# 42776 is the project's default port: the sum of the Unicode code points of +# 七夕 (七 U+4E03 = 19971, 夕 U+5915 = 22805). +LISTEN_ADDR=:42776 JWT_SECRET=change-me-to-a-random-32-byte-secret JWT_ACCESS_TTL=15m JWT_REFRESH_TTL=720h diff --git a/Dockerfile b/Dockerfile index 85492c6..c6eaeca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -73,17 +73,17 @@ RUN mkdir -p /data/files /data/thumbs /data/import && chown -R app:app /data # Non-secret defaults mirroring .env.example. Secrets (JWT_SECRET, ADMIN_PASSWORD, # DATABASE_URL) are intentionally NOT baked in — pass them at `docker run`. -ENV LISTEN_ADDR=:8080 \ +ENV LISTEN_ADDR=:42776 \ STATIC_DIR=/app/static \ FILES_PATH=/data/files \ THUMBS_CACHE_PATH=/data/thumbs \ IMPORT_PATH=/data/import -EXPOSE 8080 +EXPOSE 42776 VOLUME ["/data"] USER app HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \ - CMD wget -qO- http://127.0.0.1:8080/health >/dev/null 2>&1 || exit 1 + CMD wget -qO- http://127.0.0.1:42776/health >/dev/null 2>&1 || exit 1 ENTRYPOINT ["/app/server"] diff --git a/backend/internal/config/config.go b/backend/internal/config/config.go index a871660..cfc0049 100644 --- a/backend/internal/config/config.go +++ b/backend/internal/config/config.go @@ -105,7 +105,7 @@ func Load() (*Config, error) { } cfg := &Config{ - ListenAddr: defaultStr("LISTEN_ADDR", ":8080"), + ListenAddr: defaultStr("LISTEN_ADDR", ":42776"), JWTSecret: requireStr("JWT_SECRET"), JWTAccessTTL: parseDuration("JWT_ACCESS_TTL", "15m"), JWTRefreshTTL: parseDuration("JWT_REFRESH_TTL", "720h"), diff --git a/docs/GO_PROJECT_STRUCTURE.md b/docs/GO_PROJECT_STRUCTURE.md index fa36bf8..ad7520b 100644 --- a/docs/GO_PROJECT_STRUCTURE.md +++ b/docs/GO_PROJECT_STRUCTURE.md @@ -297,7 +297,7 @@ stored as hash in `activity.sessions.token_hash`. ```env # Server -LISTEN_ADDR=:8080 +LISTEN_ADDR=:42776 JWT_SECRET= JWT_ACCESS_TTL=15m JWT_REFRESH_TTL=720h