Harden secret key configuration
This commit is contained in:
@@ -3,7 +3,7 @@ from pathlib import Path
|
||||
from flask import Flask, flash, render_template
|
||||
from werkzeug.exceptions import RequestEntityTooLarge
|
||||
|
||||
from app.config import Config
|
||||
from app.config import Config, validate_secret_key
|
||||
from app.routes import main_blueprint
|
||||
from app.services.storage import cleanup_expired_outputs
|
||||
|
||||
@@ -21,6 +21,7 @@ def create_app(config_class: type[Config] = Config) -> Flask:
|
||||
"""Application factory used by Flask and Gunicorn."""
|
||||
app = Flask(__name__, instance_relative_config=True)
|
||||
app.config.from_object(config_class)
|
||||
validate_secret_key(app.config["SECRET_KEY"])
|
||||
|
||||
output_dir = Path(app.config["OUTPUT_DIRECTORY"])
|
||||
if not output_dir.is_absolute():
|
||||
|
||||
Reference in New Issue
Block a user