69 lines
2.6 KiB

# Create an empty config dict
config = dict()
# Main server configuration
# Domains are handled automatically, only put listening address here
config["HOST"] = ""
config["PORT"] = 8282
# name of the default theme directory (just the directory name, no additional /'s or anything.)
## Okay but seriously, I only added this in so I can use a git submodule with a custom theme. if you want to change the default theme, copy it and put the new folder name here
## and again, seriously, leave this as theme unless you've copied and changed it.
config["THEME_FOLDER"] = "theme"
# Enable Stats/metrics endpoint
config["METRICS"] = True
# Will output more logging data from QuadFile's logger
config["DEBUG"] = False
# Extended Debug will enable flask debugging. Keep this off for production use
config["EXTENDED_DEBUG"] = False
# Uses sendfile to get nginx to send the file. (100% recommended if using in production!!!)
config["X-ACCEL-REDIRECT"] = True
# Single user authentication, leave blank to disable authentication
config["KEY"] = ""
# Generates a deletion link for files
config["GEN_DELETEKEY"] = False
# File settings
config["UPLOAD_FOLDER"] = 'data'
config["ALLOW_ALL_FILES"] = False
config["ALLOWED_EXTENSIONS"] = set(['txt', 'pdf', 'bmp', 'png', 'jpg', 'jpeg', 'gif', 'webm', 'log', 'bin', 'webp', 'heif', 'mov', 'mkv', 'mp4', 'mp3', 'ogg', 'flac' ])
# Will use blacklist if this is enabled. You must disable ALLOW_ALL_FILES for this to take effect
## Note: Will always allow files with no extensions, as they /should/ be rendered as text.
config["BLACKLIST"] = True
config["BANNED_EXTENSIONS"] = set(['exe', 'msi'])
# 'unsafe' filetypes to display as text only. (and other generic files you want to be displayed as text)
## Note: needs the . there because im lazy.
config["UNSAFE_EXTENSIONS"] = ('.htm', '.html', '.js', '.mjs', '.css', '.log', '.php')
# If this is set to true, old files will be deleted. TIME is how far behind (in seconds) the last accessed time can be before files get deleted
config["DELETE_FILES"] = True
config["TIME"] = 30
config["CLEAN_INTERVAL"] = 120
# If set to true, the TIME setting above doesn't matter.
## MINDAYS is the minimum lifetime of the file. (The smaller the file, the closer to MAXDAYS it is.)
## Default, seemingly sane defaults are really small files expire after a ~year, thicc files delete after ~5 days.
config["USE_0x0_DELETION"] = True
config["MAX_FILESIZE"] = 512 * 1024 * 1024
config["MINDAYS"] = 5
config["MAXDAYS"] = 365
# Site info displayed to the user
config["SITE_DATA"] = {
"title": "QuadFile",
"size": "512 MiB" # This is only for display, please limit filesize using your web server