in server/app/lib/config.py [0:0]
def __init__(self, yml: dict):
assert yml, f"No server configuration directives could be found in {CONFIG_FILE}!"
self.bind = yml["bind"]
self.port = int(yml["port"])
self.error_reporting = yml.get("error_reporting", "show")
self.upload_timeout = int(yml.get("upload_timeout", 3600))
self.debug_mode = bool(yml.get("debug_mode", False))
self.debug_user = yml.get("debug_user", "testuser")
self.debug_password = yml.get("debug_password")
if not self.debug_password:
self.debug_password = str(uuid.uuid4())[:8]
if self.debug_mode is True:
log.log("Debug mode enabled:")
log.log(f"Debug username: {self.debug_user}")
log.log(f"Debug password: {self.debug_password}")
self.max_form_size = text_to_int(yml.get("max_form_size", "100mb"))
assert self.max_form_size >= 1024, "Max form size needs to be at least 1kb!"
self.max_content_length = int(self.max_form_size * 1.34) # Max plus b64 overhead
self.rate_limit_per_ip = int(yml.get("rate_limit_per_ip", 0))