diff --git a/WebHostLib/__init__.py b/WebHostLib/__init__.py index e4c2ab83c7..f856eea4c5 100644 --- a/WebHostLib/__init__.py +++ b/WebHostLib/__init__.py @@ -23,6 +23,17 @@ app.jinja_env.filters['any'] = any app.jinja_env.filters['all'] = all app.jinja_env.filters['get_file_safe_name'] = get_file_safe_name +# overwrites of flask default config +app.config["DEBUG"] = False +app.config["PORT"] = 80 +app.config["UPLOAD_FOLDER"] = UPLOAD_FOLDER +app.config["MAX_CONTENT_LENGTH"] = 64 * 1024 * 1024 # 64 megabyte limit +# if you want to deploy, make sure you have a non-guessable secret key +app.config["SECRET_KEY"] = bytes(socket.gethostname(), encoding="utf-8") +app.config["SESSION_PERMANENT"] = True +app.config["MAX_FORM_MEMORY_SIZE"] = 2 * 1024 * 1024 # 2 MB, needed for large option pages such as SC2 + +# custom config app.config["SELFHOST"] = True # application process is in charge of running the websites app.config["GENERATORS"] = 8 # maximum concurrent world gens app.config["HOSTERS"] = 8 # maximum concurrent room hosters @@ -30,19 +41,12 @@ app.config["SELFLAUNCH"] = True # application process is in charge of launching app.config["SELFLAUNCHCERT"] = None # can point to a SSL Certificate to encrypt Room websocket connections app.config["SELFLAUNCHKEY"] = None # can point to a SSL Certificate Key to encrypt Room websocket connections app.config["SELFGEN"] = True # application process is in charge of scheduling Generations. -app.config["DEBUG"] = False -app.config["PORT"] = 80 -app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER -app.config['MAX_CONTENT_LENGTH'] = 64 * 1024 * 1024 # 64 megabyte limit -# if you want to deploy, make sure you have a non-guessable secret key -app.config["SECRET_KEY"] = bytes(socket.gethostname(), encoding="utf-8") # at what amount of worlds should scheduling be used, instead of rolling in the web-thread app.config["JOB_THRESHOLD"] = 1 # after what time in seconds should generation be aborted, freeing the queue slot. Can be set to None to disable. app.config["JOB_TIME"] = 600 # memory limit for generator processes in bytes app.config["GENERATOR_MEMORY_LIMIT"] = 4294967296 -app.config['SESSION_PERMANENT'] = True # waitress uses one thread for I/O, these are for processing of views that then get sent # archipelago.gg uses gunicorn + nginx; ignoring this option