aboutsummaryrefslogtreecommitdiff
path: root/gerboweb/gerboweb.py
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2022-07-05 22:31:09 +0200
committerjaseg <git@jaseg.de>2022-07-05 22:31:09 +0200
commit00de98d5e3bc836715d04b7d8b8934389062f63d (patch)
tree51f6ad21a4387fb1ed4fc77c825fd694f361a901 /gerboweb/gerboweb.py
parent3ba932209fc33206a28483d07fb0e108d1b16a2b (diff)
downloadgerbolyze-00de98d5e3bc836715d04b7d8b8934389062f63d.tar.gz
gerbolyze-00de98d5e3bc836715d04b7d8b8934389062f63d.tar.bz2
gerbolyze-00de98d5e3bc836715d04b7d8b8934389062f63d.zip
gerboweb: Add prod container build
Diffstat (limited to 'gerboweb/gerboweb.py')
-rw-r--r--gerboweb/gerboweb.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/gerboweb/gerboweb.py b/gerboweb/gerboweb.py
index 0a0dda0..6ab255c 100644
--- a/gerboweb/gerboweb.py
+++ b/gerboweb/gerboweb.py
@@ -6,6 +6,7 @@ import tempfile
import uuid
from functools import wraps
from os import path
+from pathlib import Path
import os
import sqlite3
@@ -20,6 +21,11 @@ from job_queue import JobQueue
app = Flask(__name__, static_url_path='/static')
app.config.from_envvar('GERBOWEB_SETTINGS')
+if app.config['SECRET_KEY'] is None:
+ if (p := Path('/run/secrets/gerboweb')).isfile():
+ app.config['SECRET_KEY'] = p.read_bytes()
+ else:
+ app.config['SECRET_KEY'] = os.urandom(32)
class UploadForm(FlaskForm):
upload_file = FileField(validators=[DataRequired()])