C1: bump shower to v1.0.2 (WhiteNoise upstreamed); cache static on fly
App v1.0.2 ships WhiteNoise for /static/ and /media/, so the
blumeops-side workaround is no longer needed:
- containers/shower/default.nix: drop the WhiteNoise pip dep + the
middleware-injection block from local_settings. The shim is back
to just path overrides (DATABASES.NAME, MEDIA_ROOT, STATIC_ROOT).
- version → 1.0.2, outputHash → fakeHash for re-pinning.
- service-versions.yaml mirrored.
fly/nginx.conf: cache /static/ (1y) and /media/ (1d) per location for
shower.eblu.me. /static/ filenames are content-hashed thanks to
CompressedManifestStaticFilesStorage so a year is safe and invalidation
is automatic on the next collectstatic.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
eec455e56a
commit
473bc78181
3 changed files with 57 additions and 3 deletions
|
|
@ -21,7 +21,7 @@
|
||||||
{ pkgs ? import <nixpkgs> { } }:
|
{ pkgs ? import <nixpkgs> { } }:
|
||||||
|
|
||||||
let
|
let
|
||||||
version = "1.0.1";
|
version = "1.0.2";
|
||||||
|
|
||||||
python = pkgs.python314;
|
python = pkgs.python314;
|
||||||
|
|
||||||
|
|
@ -107,7 +107,7 @@ let
|
||||||
outputHashAlgo = "sha256";
|
outputHashAlgo = "sha256";
|
||||||
# Pinned dep closure — reproducible until version bumps. To recompute,
|
# Pinned dep closure — reproducible until version bumps. To recompute,
|
||||||
# set to pkgs.lib.fakeHash and read the failure.
|
# set to pkgs.lib.fakeHash and read the failure.
|
||||||
outputHash = "sha256-9J2cxNxFSkSWLy2nwPtqV0Qtn54YVJ3LiijsqKQT+uc=";
|
outputHash = pkgs.lib.fakeHash;
|
||||||
|
|
||||||
dontFixup = true;
|
dontFixup = true;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -343,6 +343,60 @@ http {
|
||||||
return 403 "The host console is tailnet-only — visit shower.ops.eblu.me.\n";
|
return 403 "The host console is tailnet-only — visit shower.ops.eblu.me.\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Static assets — WhiteNoise + CompressedManifestStaticFilesStorage
|
||||||
|
# gives content-hashed filenames, so cache aggressively. Hashed
|
||||||
|
# names make cache invalidation automatic on app upgrades.
|
||||||
|
location /static/ {
|
||||||
|
proxy_pass https://indri_backend$request_uri;
|
||||||
|
proxy_ssl_verify off;
|
||||||
|
proxy_ssl_server_name on;
|
||||||
|
proxy_ssl_name shower.ops.eblu.me;
|
||||||
|
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Connection $connection_upgrade;
|
||||||
|
proxy_set_header Host shower.ops.eblu.me;
|
||||||
|
proxy_set_header X-Real-IP $http_fly_client_ip;
|
||||||
|
proxy_set_header X-Forwarded-For $http_fly_client_ip;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
|
||||||
|
proxy_cache services;
|
||||||
|
proxy_cache_valid 200 1y;
|
||||||
|
proxy_cache_valid 404 1m;
|
||||||
|
proxy_cache_use_stale error timeout updating;
|
||||||
|
proxy_cache_lock on;
|
||||||
|
proxy_cache_key $host$uri;
|
||||||
|
proxy_ignore_headers Cache-Control Set-Cookie;
|
||||||
|
|
||||||
|
add_header X-Cache-Status $upstream_cache_status;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Prize photo uploads. Shorter TTL than /static/ because filenames
|
||||||
|
# aren't content-hashed — operators can re-upload a prize photo
|
||||||
|
# and we want guests to see the new image within a day.
|
||||||
|
location /media/ {
|
||||||
|
proxy_pass https://indri_backend$request_uri;
|
||||||
|
proxy_ssl_verify off;
|
||||||
|
proxy_ssl_server_name on;
|
||||||
|
proxy_ssl_name shower.ops.eblu.me;
|
||||||
|
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Connection $connection_upgrade;
|
||||||
|
proxy_set_header Host shower.ops.eblu.me;
|
||||||
|
proxy_set_header X-Real-IP $http_fly_client_ip;
|
||||||
|
proxy_set_header X-Forwarded-For $http_fly_client_ip;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
|
||||||
|
proxy_cache services;
|
||||||
|
proxy_cache_valid 200 1d;
|
||||||
|
proxy_cache_valid 404 1m;
|
||||||
|
proxy_cache_use_stale error timeout updating;
|
||||||
|
proxy_cache_lock on;
|
||||||
|
proxy_cache_key $host$uri;
|
||||||
|
proxy_ignore_headers Cache-Control Set-Cookie;
|
||||||
|
|
||||||
|
add_header X-Cache-Status $upstream_cache_status;
|
||||||
|
}
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
proxy_pass https://indri_backend$request_uri;
|
proxy_pass https://indri_backend$request_uri;
|
||||||
proxy_ssl_verify off;
|
proxy_ssl_verify off;
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ services:
|
||||||
- name: shower
|
- name: shower
|
||||||
type: argocd
|
type: argocd
|
||||||
last-reviewed: 2026-05-10
|
last-reviewed: 2026-05-10
|
||||||
current-version: "1.0.1"
|
current-version: "1.0.2"
|
||||||
upstream-source: https://forge.eblu.me/eblume/adelaide-baby-shower-app
|
upstream-source: https://forge.eblu.me/eblume/adelaide-baby-shower-app
|
||||||
notes: |
|
notes: |
|
||||||
Django app for Adelaide / Heidi / Addie's baby shower. Wheel
|
Django app for Adelaide / Heidi / Addie's baby shower. Wheel
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue