From eb1f6cbaf65cb05e4ac0fd3d09db2f4e914806df Mon Sep 17 00:00:00 2001 From: Max Value Date: Mon, 9 Dec 2024 06:08:48 +0000 Subject: [PATCH] Added proxyfix and WSGI script --- index.py | 4 ++++ wsgi.py | 5 +++++ 2 files changed, 9 insertions(+) create mode 100644 wsgi.py diff --git a/index.py b/index.py index 7765fc3..f842953 100755 --- a/index.py +++ b/index.py @@ -3,6 +3,7 @@ from flask import Flask, Response, request, render_template, redirect, send_from_directory, url_for from flask_httpauth import HTTPBasicAuth from werkzeug.security import generate_password_hash, check_password_hash +from werkzeug.middleware.proxy_fix import ProxyFix from multiprocessing import Value from os import listdir import sqlite3 @@ -11,6 +12,9 @@ import json import os.path app = Flask(__name__) +app.wsgi_app = ProxyFix( + app.wsgi_app, x_for=1, x_proto=1, x_host=1, x_prefix=1 +) auth = HTTPBasicAuth() db_keys = ["title", "album", "artist", "year", "link", "info", "category", "playing", "intime", "outtime"] allowed_audio = ["mp3", "wav", "ogg", "flac"] diff --git a/wsgi.py b/wsgi.py new file mode 100644 index 0000000..d659370 --- /dev/null +++ b/wsgi.py @@ -0,0 +1,5 @@ +#! .venv/bin/python3 + +from index import app + +application = app -- 2.39.2