From c2be5a84f9a87bae3faa4b4109d97ec6bae26f9d Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Sat, 5 Dec 2020 00:43:18 +0100 Subject: [PATCH] Make debug secret key consistent --- WebHostLib/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/WebHostLib/__init__.py b/WebHostLib/__init__.py index c392990b..97a3980b 100644 --- a/WebHostLib/__init__.py +++ b/WebHostLib/__init__.py @@ -4,6 +4,7 @@ So unless you're Berserker you need to include license information.""" import os import uuid import base64 +import socket from pony.flask import Pony from flask import Flask, request, redirect, url_for, render_template, Response, session, abort, send_from_directory @@ -30,8 +31,8 @@ app.config["DEBUG"] = False app.config["PORT"] = 80 app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER 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) +# 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 webthread app.config["JOB_THRESHOLD"] = 2 app.config['SESSION_PERMANENT'] = True