65 lines
2.5 KiB
TOML
65 lines
2.5 KiB
TOML
[server]
|
|
host = "0.0.0.0"
|
|
port = 8282
|
|
|
|
# Please enable this if you are using nginx (if you aren't, please do)
|
|
# This should speed up file serving a decent amount.
|
|
# TODO: benchmarks
|
|
nginx_sendfile = false
|
|
|
|
[database] # DATABASE DATABASE JUST LIVING IN THE DATABASE WOOAH
|
|
# What SQL Backend to use
|
|
## Available SQL backends: sqlite, postgres
|
|
sql_backend = "sqlite"
|
|
|
|
# URL for the database, supporting both postgres and sqlite
|
|
# https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING
|
|
# url = "postgres://ephemeral:changeme@localhost:5432/ephemeral"
|
|
|
|
url = "sqlite://ephemeral.db"
|
|
|
|
[logging]
|
|
# Controls the logging level of the ephemeral program, and the crates it uses.
|
|
|
|
# This is production clean with info from ephemeral and errors from the rest.
|
|
level = "ephemeral=info,sqlx=error,hyper=error,salvo_extra=error,salvo=error,mio=error"
|
|
# Development & Testing logging, where it shows as much logs as possible.
|
|
#level = "ephemeral=trace,sqlx=trace,hyper=debug,salvo_extra=trace,salvo=trace,mio=trace"
|
|
|
|
# Enables/Disables metrics generation
|
|
metrics = true
|
|
|
|
[operations]
|
|
# These change the character length of the filename, admin key, and API Key when generated.
|
|
# Leaving it at 6 is good enough for most, since it'll /try/ to regenerate in the case of a collision.
|
|
filename_size = 6
|
|
adminkey_size = 12
|
|
apikey_size = 24
|
|
|
|
# 1 - time based expiration - last view
|
|
# 2 - size based expiration - larger files expire faster
|
|
# 3 - aggregate score - large files viewed more often last longer than less popular files.
|
|
# 4 - lazy aggregate score - files deleted based on file size and last view, whatever is /longer/
|
|
engine_mode = 2
|
|
|
|
# How often should the system check for old files.
|
|
# Should probably keep this as default. (especially for massive instances)
|
|
cleaner_interval = 1800
|
|
|
|
# The longest and shortest time a file can be 'alive' on the server.
|
|
# 7 Days in seconds
|
|
file_expiry_min = 604800
|
|
# 1 Year in seconds
|
|
file_expiry_max = 31536000
|
|
|
|
# size in bytes - default: 1 Gibibyte
|
|
max_filesize = 1073741824
|
|
|
|
|
|
# Mimetypes that are not allowed to be uploaded.
|
|
# Leave empty to allow all files, and please enter these in lowercase.
|
|
banned_mimetype = ["application/x-msdownload", "application/x-msi", "application/x-silverlight", "application/x-ms-dos-executable"]
|
|
|
|
# Files that should only ever be rendered as plaintext.
|
|
# I REALLY recommend not removing these.
|
|
unsafe_mimetype = ["text/html", "text/javascript", "application/javascript", "text/css", "application/x-httpd-php", "application/xhtml+xml"] |