media-updates/nginx.conf
Richard 2fc0981195 Somewhere for the app to look for a newer version of itself
Two static files behind nginx and a script that writes them. No
authentication: there is no account to check against, and the APK carries
no secret — the credential in that app is the addon URL, which lives in
the device keystore.

The APKs are committed rather than stored elsewhere. At ~34MB and a few
releases a year that beats standing up artifact storage for one app, and
the history is disposable because only the newest artifact is ever
fetched.

release.py reads the version out of amber-adult's pubspec instead of
taking it as an argument. A manifest advertising a build number the APK
does not carry is an update the device installs and is then offered
again, every launch, forever.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-30 03:53:38 +02:00

29 lines
915 B
Nginx Configuration File

server {
listen 80;
root /usr/share/nginx/html;
# Nginx's bundled mime.types does not name the APK type on every build, and
# a wrong Content-Type is enough for a download manager to save an HTML
# error page under the right filename. Say it explicitly.
types {
application/json json;
application/vnd.android.package-archive apk;
}
default_type application/octet-stream;
# The manifest changes every release; the APKs never do, because a new
# release is a new filename. Cache accordingly.
location = /manifest.json {
add_header Cache-Control "no-cache";
}
location ~ \.apk$ {
add_header Cache-Control "public, max-age=31536000, immutable";
}
# Nothing here is a secret, but nothing here is a directory listing either.
autoindex off;
location / {
try_files $uri =404;
}
}