# paste.emmett1.my configuration # # Simple KEY=VALUE. Blank lines and lines starting with # are ignored. # Every key can also be overridden by an environment variable of the same # name, which takes precedence over this file. # # Restart after editing: doas sv restart paste # ---------------------------------------------------------------- network -- # Address/port the app listens on. lighttpd proxies to this. LISTEN_HOST=127.0.0.1 LISTEN_PORT=8099 # Public base URL used to build the links handed back to clients. BASE_URL=https://paste.emmett1.my # Proxies whose X-Forwarded-For header we trust for the real client IP. # Comma-separated IPs or CIDRs. A request arriving from anything else has # its header ignored and its socket peer address used instead. TRUSTED_PROXIES=127.0.0.1,::1 # How many reverse proxies sit in front of this app. lighttpd appends to # X-Forwarded-For instead of replacing it, so the real client is this many # entries in from the right; everything further left is whatever the client # typed. Leave at 1 unless you put something in front of lighttpd (a CDN, # another proxy), in which case raise it to match. TRUSTED_HOPS=1 # ---------------------------------------------------------------- storage -- # Where blobs and the SQLite database live. Relative paths resolve against # the directory this config file is in. DATA_DIR=data # --------------------------------------------------------------- limits ---- # Largest single upload, in bytes. 512 MiB. MAX_SIZE=536870912 # Length of generated IDs, and of IDs when -Fsecret= is passed. ID_LENGTH=4 SECRET_ID_LENGTH=24 # --------------------------------------------------------------- expiry ---- # Retention scales with size: small files live MAX_AGE_DAYS, a file at # MAX_SIZE lives MIN_AGE_DAYS, on the curve 0x0.st uses. MIN_AGE_DAYS=30 MAX_AGE_DAYS=365 # Hard ceiling on a client-requested -Fexpires= value, in days. # 0 means clients may request any expiry, including none. MAX_REQUESTED_AGE_DAYS=365 # --------------------------------------------------------------- features -- # Remote upload: curl -Furl=https://example.com/x.png # The fetcher refuses non-public addresses and pins the validated IP for the # connection, so DNS rebinding cannot redirect it at a service on localhost. # Set to 0 to switch the feature off entirely. REMOTE_UPLOAD=1 REMOTE_TIMEOUT=20 REMOTE_MAX_REDIRECTS=3 # URL shortener: curl -Fshorten=https://example.com/very/long SHORTEN=1 # --------------------------------------------------------------- serving --- # Serve uploaded HTML as text/plain instead of text/html. Uploads are always # sent with a sandbox CSP and nosniff, so scripts cannot run either way; this # additionally stops the browser rendering the markup at all. SANITIZE_HTML=1 # ----------------------------------------------------------- rate limits --- # Per client IP, over a rolling hour. 0 disables that limit. RATE_UPLOADS_PER_HOUR=120 RATE_BYTES_PER_HOUR=2147483648