Makefile: make check runs the backend, Python, Vue and compose checks that previously lived only in local notes. deploy.yaml: a test job runs the backend and Python suites in containers on every push, and deploy needs it. Deploy also refuses to run if main has moved past the tested commit. maintenance.yaml takes the env-apply lock around its compose steps, as deploy already did. nginx: the 24 proxied locations that production and dev both carried now live once in nginx_routes.conf.template, rendered by the entrypoint on every boot path. The effective config is unchanged for both. Remove the root package.json and lockfile, which nothing referenced. Co-Authored-By: Claude Opus 5.5 <[email protected]>
75 lines
3.9 KiB
Plaintext
75 lines
3.9 KiB
Plaintext
# =============================================================================
|
|
# nginx_dev_common.conf.template — SHARED BODY of the dev :80 and :443 server
|
|
# blocks.
|
|
#
|
|
# WHY THIS FILE EXISTS
|
|
# In dev the :80 and :443 server blocks are byte-for-byte identical apart
|
|
# from `listen` and the self-signed `ssl_certificate` pair. They used to be
|
|
# ~190 duplicated lines, so every routing fix had to be made twice and could
|
|
# silently drift. Both blocks now `include` this partial instead.
|
|
#
|
|
# HOW IT IS RENDERED
|
|
# nginx/entrypoint.sh runs the SAME envsubst allow-list over this file as
|
|
# over nginx_dev.conf.template, writing the result to
|
|
# /etc/nginx/nginx_dev_common.conf — which is exactly the path the two
|
|
# `include` directives in the rendered nginx.conf point at. If you add
|
|
# a new substituted variable here, it must also be added to ENVSUBST_VARS in
|
|
# the entrypoint, or it will reach nginx unsubstituted.
|
|
#
|
|
# WHAT BELONGS HERE
|
|
# Only what dev does DIFFERENTLY from production inside a server block: the
|
|
# /uploads/ locations without security headers, and `/` proxied to Vite.
|
|
# Everything else — the `set $upstream_*` vars and every reverse-proxied
|
|
# route — is in nginx_routes.conf.template, shared with production and
|
|
# included at the bottom of this file. ADD NEW PROXIED ROUTES THERE, not
|
|
# here.
|
|
# NOT `listen`, `server_name` or the ssl_certificate lines (those differ
|
|
# between the two blocks), and NOT the enclosing braces — this file must be
|
|
# brace-balanced on its own.
|
|
#
|
|
# This is the DEV file only. Production's single :443 www server block in
|
|
# nginx.conf.template includes nginx_routes.conf directly.
|
|
# =============================================================================
|
|
# PRIVATE attachments (admin-only). Attachments on *private* chat
|
|
# messages are written by the backend to /backend/uploads/private/ and
|
|
# must not be readable by the public, so this subpath is put behind the
|
|
# same admin `auth_request` used for /sb/. nginx picks
|
|
# the LONGEST matching prefix location, so this block wins over the
|
|
# public /uploads/ block below for /uploads/private/* regardless of
|
|
# ordering. Same three hardening headers as the public block, because
|
|
# the bytes are just as attacker-supplied.
|
|
location /uploads/private/ {
|
|
auth_request /internal/auth/admin-validate;
|
|
error_page 401 403 = @auth_denied;
|
|
alias /uploads/private/;
|
|
add_header X-Content-Type-Options nosniff always;
|
|
add_header Content-Disposition "inline" always;
|
|
add_header Content-Security-Policy "default-src 'none'; img-src 'self'; style-src 'none'; script-src 'none'" always;
|
|
}
|
|
|
|
# Both /uploads/ blocks are the production ones MINUS
|
|
# `include security_headers.conf`: that file carries HSTS, which must
|
|
# never be sent from localhost. That one line is why they are not in
|
|
# the shared route table (see WHAT DOES NOT in
|
|
# nginx_routes.conf.template). Keep the rest in step with
|
|
# nginx.conf.template.
|
|
location /uploads/ {
|
|
alias /uploads/;
|
|
add_header X-Content-Type-Options nosniff always;
|
|
add_header Content-Disposition "inline" always;
|
|
add_header Content-Security-Policy "default-src 'none'; img-src 'self'; style-src 'none'; script-src 'none'" always;
|
|
}
|
|
|
|
# The Vite dev server; Upgrade/Connection carry its HMR websocket.
|
|
location / {
|
|
proxy_pass http://vue:5173;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_set_header Host $host;
|
|
}
|
|
|
|
# Every other route, shared with production. This file has no regex
|
|
# locations of its own, so where the include sits is cosmetic.
|
|
include /etc/nginx/nginx_routes.conf;
|