WebHost: Add a yaml checker

This commit is contained in:
Fabian Dill
2020-07-27 04:05:42 +02:00
parent 89cea382ea
commit 63cbdb9449
5 changed files with 112 additions and 9 deletions

View File

@@ -15,11 +15,6 @@ UPLOAD_FOLDER = os.path.relpath('uploads')
LOGS_FOLDER = os.path.relpath('logs')
os.makedirs(LOGS_FOLDER, exist_ok=True)
def allowed_file(filename):
return filename.endswith(('multidata', ".zip"))
app = Flask(__name__)
Pony(app)
@@ -35,8 +30,11 @@ app.config['MAX_CONTENT_LENGTH'] = 4 * 1024 * 1024 # 4 megabyte limit
# if you want persistent sessions on your server, make sure you make this a constant in your config.yaml
app.config["SECRET_KEY"] = os.urandom(32)
app.config['SESSION_PERMANENT'] = True
app.config[
"WAITRESS_THREADS"] = 10 # waitress uses one thread for I/O, these are for processing of views that then get sent
# waitress uses one thread for I/O, these are for processing of views that then get sent
# berserkermulti.world uses gunicorn + nginx; ignoring this option
app.config["WAITRESS_THREADS"] = 10
#a default that just works. berserkermulti.world runs on mariadb
app.config["PONY"] = {
'provider': 'sqlite',
'filename': os.path.abspath('db.db3'),
@@ -111,4 +109,4 @@ def host_room(room: UUID):
from WebHostLib.customserver import run_server_process
from . import tracker, upload, landing # to trigger app routing picking up on it
from . import tracker, upload, landing, check # to trigger app routing picking up on it