| 5 | 5 | | ## Configuration |
| 6 | 6 | | ZBin is configured through environment variables (all optional): |
| 7 | 7 | | |
| 8 | | - | | Variable | Default | Description | |
| 9 | | - | | --- | --- | --- | |
| 10 | | - | | `MAX_UPLOAD_BYTES` | `104857600` (100 MiB) | Hard cap on a single upload. | |
| 11 | | - | | `MAX_TOTAL_BYTES` | unlimited | Cap on total stored content across all files. When set, an upload that would push the total over the cap is rejected (`507`). | |
| 12 | | - | | `MAX_AGE_MINUTES` | unlimited | Maximum retention. When set, every upload is deleted after at most this many minutes (a longer requested `delete_in_minutes` is clamped down). | |
| 13 | | - | | `UPLOAD_COOLDOWN_SECONDS` | `0` (off) | Minimum seconds between uploads from the same client IP. | |
| 14 | | - | | `DECRYPT_COOLDOWN_SECONDS` | `0` (off) | Minimum seconds between server-side decryption attempts from the same client IP. Bounds the PBKDF2 CPU cost an attacker who knows a file's URL can force by repeatedly requesting it with password cookies. | |
| 15 | | - | | `BEHIND_PROXY` | `false` | Set to `true` (or `1`) when running behind a trusted TLS-terminating reverse proxy (the usual production setup). Reads `X-Forwarded-For` / `X-Real-IP` for the client IP **and** adds the `Secure` flag to the password cookie. Leave off for direct/local HTTP. | |
| 8 | + | | Variable | Default | Description | |
| 9 | + | |----------------------------|-----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |
| 10 | + | | `MAX_UPLOAD_BYTES` | `104857600` (100 MiB) | Hard cap on a single upload. | |
| 11 | + | | `MAX_TOTAL_BYTES` | unlimited | Cap on total stored content across all files. When set, an upload that would push the total over the cap is rejected (`507`). | |
| 12 | + | | `MAX_AGE_MINUTES` | unlimited | Maximum retention. When set, every upload is deleted after at most this many minutes (a longer requested `delete_in_minutes` is clamped down). | |
| 13 | + | | `UPLOAD_COOLDOWN_SECONDS` | `0` (off) | Minimum seconds between uploads from the same client IP. | |
| 14 | + | | `DECRYPT_COOLDOWN_SECONDS` | `0` (off) | Minimum seconds between server-side decryption attempts from the same client IP. Bounds the PBKDF2 CPU cost an attacker who knows a file's URL can force by repeatedly requesting it with password cookies. | |
| 15 | + | | `BEHIND_PROXY` | `false` | Set to `true` (or `1`) when running behind a trusted TLS-terminating reverse proxy (the usual production setup). Reads `X-Forwarded-For` / `X-Real-IP` for the client IP **and** adds the `Secure` flag to the password cookie. Leave off for direct/local HTTP. | |
| 16 | 16 | | |
| 17 | 17 | | > Passwords for server-side decryption travel in a cookie, so ZBin should always be |
| 18 | 18 | | > served over HTTPS behind a reverse proxy (with `BEHIND_PROXY=true`) in any real deployment. |