diff --git a/deploy/apps-silentmode-st.conf b/deploy/apps-silentmode-st.conf index 2732a6c..b7f85b6 100644 --- a/deploy/apps-silentmode-st.conf +++ b/deploy/apps-silentmode-st.conf @@ -36,9 +36,9 @@ server { proxy_set_header X-Forwarded-Proto https; proxy_set_header X-Forwarded-Host apps.silentmode.st; - # Large publisher uploads need a generous ceiling — matches the service's - # own 2 GiB cap. Reads are small; this governs POST /api/upload. - client_max_body_size 2g; + # Matches the service's 200 MiB upload cap. Reads are small; this + # governs POST /api/upload. + client_max_body_size 200m; proxy_request_buffering off; # The service's own long-cache headers decide for static assets; this diff --git a/deploy/prometheus-x.conf b/deploy/prometheus-x.conf index 667ccf4..8e5197b 100644 --- a/deploy/prometheus-x.conf +++ b/deploy/prometheus-x.conf @@ -36,9 +36,10 @@ server { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto https; - # Publishers upload binaries that can be hundreds of MB. 2 GiB - # matches the service's own cap in uploads.js. - client_max_body_size 2g; + # 200 MiB fits Android APKs and most desktop installers; matches the + # service's own cap in uploads.js. Publishers of larger binaries + # self-host and submit a manifest with the external URL + SHA. + client_max_body_size 200m; proxy_request_buffering off; proxy_buffering off; diff --git a/service/pages.js b/service/pages.js index 2fa736c..262268d 100644 --- a/service/pages.js +++ b/service/pages.js @@ -321,7 +321,7 @@ export function submit() {
    -
  1. Upload the binary (any size up to 2 GiB)
  2. +
  3. Upload the binary (up to 200 MiB)
  4. Describe name, publisher name, category, description
  5. Sign with the BCH key for your publisher BNS name
  6. Publish POST to the directory
  7. diff --git a/service/uploads.js b/service/uploads.js index ce016d6..e9e18f9 100644 --- a/service/uploads.js +++ b/service/uploads.js @@ -36,10 +36,14 @@ import { signReport } from './signing.js'; const UPLOAD_DIR = process.env.PROMETHEUS_UPLOAD_DIR || resolve(dirname(fileURLToPath(import.meta.url)), '..', 'uploads'); -// 2 GiB — the ceiling, not the typical size. Change via env rather than code -// so an operator can tighten it without a redeploy. +// 200 MiB — fits every Android APK and most desktop installers; publishers +// of larger binaries self-host and submit a manifest with the external URL + +// SHA. The service's cap and Caddy's `request_body { max_size 200MB }` on +// the prometheus.x vhost must stay in sync — if Caddy rejects first, the +// browser gets an HTML 413 page that the JSON parser cannot read. +// Change via env rather than code so an operator can tighten per-instance. const MAX_FILE_BYTES = Number(process.env.PROMETHEUS_MAX_UPLOAD_BYTES) - || 2 * 1024 * 1024 * 1024; + || 200 * 1024 * 1024; /** * Express-style handler attached to `/api/upload`.