code may be a bit messy but.... also implemented a storage usage stat (that can be toggled in .env) that shows on the home page, you can also enable the total limit to show as well eventually i need to implement clearing old unfinished uploads both on startup, admin actions, and cleaning up on upload failure
54 lines
2.7 KiB
Bash
54 lines
2.7 KiB
Bash
# directory where uploads are stored
|
|
MINIBIN_UPLOAD_DIR=uploads
|
|
MINIBIN_DATABASE_PATH=minibin.sqlite
|
|
# the public host of minibin
|
|
MINIBIN_HOST=https://example.tld
|
|
# the address minibin binds to
|
|
MINIBIN_ADDR=localhost:8080
|
|
# max size uploadable in KiB, 97657 is around 100 MB
|
|
MINIBIN_MAX_PASTE_KIB=97657
|
|
MINIBIN_MAX_FILE_KIB=97657
|
|
# the max amount of storage minibin will use for uploads
|
|
# 0 means no limit
|
|
MINIBIN_MAX_STORAGE_USAGE_KIB=0
|
|
# allowed expiries, shown in the order they are written
|
|
# syntax: h(our),d(ay),w(eek),mo(nth),y(ear), 0 = indefinite/no expiry
|
|
MINIBIN_EXPIRIES=1h,12h,1d,7d,2w,1mo,6mo,1y,5y,0
|
|
# when set to true, will normalize mime types
|
|
# the browser could execute to text/plain to prevent it
|
|
# only normalizes when returning content, not on upload
|
|
MINIBIN_NORMALIZE_MIME_TYPES=true
|
|
# prevents uploads with the specified mime types, separated by commas
|
|
# this example is pretty long, but it is majority (if not all) of the executable types github.com/gabriel-vasile/mimetype detects
|
|
MINIBIN_BANNED_MIME_TYPES="application/vnd.microsoft.portable-executable,application/java-archive,application/x-executable,application/vnd.android.package-archive,application/x-ms-installer,application/x-elf,application/vnd.debian.binary-package"
|
|
# this is the amount of leading zero bits required for proof of work completion
|
|
# 8-12 is a good range, 8 being quickest, while 12 is the slowest
|
|
# with my computer 12 can take around 10-20 seconds
|
|
# whereas 8 takes around a few seconds or less
|
|
MINIBIN_POW_DIFFICULTY=10
|
|
# comma separated options the user can select when reporting
|
|
# options show in the order they are written
|
|
# leading spaces WILL be included, so make sure you dont include them
|
|
MINIBIN_REPORT_OPTIONS="Malware (including links),CSAM/CSEM,Copyright Infringement,Fraud"
|
|
# where minibin gets the client's ip from
|
|
# available options: remote, cloudflare, xff
|
|
# remote: the ip connecting to minibin
|
|
# cloudflare: uses the CF-Connecting-IP header
|
|
# xff: uses the X-Forwarded-For header, ignores trusted proxies
|
|
MINIBIN_IP_ADDRESS_SOURCE=remote
|
|
# comma separated list of trusted CIDRs
|
|
# cloudflares: https://cloudflare.com/ips/
|
|
MINIBIN_TRUSTED_PROXIES=127.0.0.1/32
|
|
# comma separated list of asn numbers
|
|
# any asn in this list will be completely banned from all routes (except for static assets and qts)
|
|
MINIBIN_BANNED_ASNS=""
|
|
|
|
## Public Stats Related Environment Variables
|
|
# whether or not to display storage usage on the homepage
|
|
# will also return it on uploads if enabled
|
|
MINIBIN_STATS_DISPLAY_STORAGE_USAGE=false
|
|
# whether or not to display the max amount of storage minibin can use
|
|
# on the home and returning it on uploads
|
|
# this can NOT be enabled if MINIBIN_STATS_DISPLAY_STORAGE_USAGE isn't
|
|
MINIBIN_STATS_DISPLAY_STORAGE_LIMIT=flase
|