headers
This commit is contained in:
@@ -13,7 +13,7 @@ Group=pytorrent
|
|||||||
WorkingDirectory=/opt/pyTorrent
|
WorkingDirectory=/opt/pyTorrent
|
||||||
Environment="PYTHONUNBUFFERED=1"
|
Environment="PYTHONUNBUFFERED=1"
|
||||||
EnvironmentFile=/opt/pyTorrent/.env
|
EnvironmentFile=/opt/pyTorrent/.env
|
||||||
ExecStart=/opt/pyTorrent/venv/bin/gunicorn --worker-class gthread --workers 1 --threads 32 --bind ${PYTORRENT_HOST}:${PYTORRENT_PORT} --access-logfile - --error-logfile - wsgi:app
|
ExecStart=/opt/pyTorrent/venv/bin/gunicorn -c /opt/pyTorrent/gunicorn.conf.py --worker-class gthread --workers 1 --threads 32 --bind ${PYTORRENT_HOST}:${PYTORRENT_PORT} --access-logfile - --error-logfile - wsgi:app
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=3
|
RestartSec=3
|
||||||
KillSignal=SIGINT
|
KillSignal=SIGINT
|
||||||
|
|||||||
2
gunicorn.conf.py
Normal file
2
gunicorn.conf.py
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
import gunicorn
|
||||||
|
gunicorn.SERVER_SOFTWARE = "pyTorrent"
|
||||||
@@ -64,9 +64,7 @@ def create_app() -> Flask:
|
|||||||
if request.endpoint == "static":
|
if request.endpoint == "static":
|
||||||
response.headers["Cache-Control"] = "public, max-age=31536000, immutable"
|
response.headers["Cache-Control"] = "public, max-age=31536000, immutable"
|
||||||
else:
|
else:
|
||||||
response.headers["Cache-Control"] = "no-cache, no-store, must-revalidate"
|
response.headers["Cache-Control"] = "no-store, private"
|
||||||
response.headers["Pragma"] = "no-cache"
|
|
||||||
response.headers["Expires"] = "0"
|
|
||||||
return response
|
return response
|
||||||
|
|
||||||
from .routes.main import bp as main_bp
|
from .routes.main import bp as main_bp
|
||||||
|
|||||||
@@ -325,4 +325,4 @@ def openapi():
|
|||||||
if path != "/api/auth/login":
|
if path != "/api/auth/login":
|
||||||
for operation in methods.values():
|
for operation in methods.values():
|
||||||
operation.setdefault("security", [{"sessionCookie": []}])
|
operation.setdefault("security", [{"sessionCookie": []}])
|
||||||
return jsonify({"openapi": "3.0.3", "info": {"title": "pyTorrent API", "version": "0.2.0"}, "paths": paths, "components": components})
|
return jsonify({"openapi": "3.0.3", "info": {"title": "pyTorrent API", "version": "0.0.1"}, "paths": paths, "components": components})
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ WorkingDirectory=/opt/pyTorrent
|
|||||||
Environment="PYTHONUNBUFFERED=1"
|
Environment="PYTHONUNBUFFERED=1"
|
||||||
EnvironmentFile=/opt/pyTorrent/.env
|
EnvironmentFile=/opt/pyTorrent/.env
|
||||||
# Note: threaded Gunicorn preserves Flask-SocketIO background tasks without running Werkzeug in production.
|
# Note: threaded Gunicorn preserves Flask-SocketIO background tasks without running Werkzeug in production.
|
||||||
ExecStart=/opt/pyTorrent/venv/bin/gunicorn --worker-class gthread --workers 1 --threads 32 --bind ${PYTORRENT_HOST}:${PYTORRENT_PORT} --access-logfile - --error-logfile - wsgi:app
|
ExecStart=/opt/pyTorrent/venv/bin/gunicorn -c /opt/pyTorrent/gunicorn.conf.py --worker-class gthread --workers 1 --threads 32 --bind ${PYTORRENT_HOST}:${PYTORRENT_PORT} --access-logfile - --error-logfile - wsgi:app
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=3
|
RestartSec=3
|
||||||
KillSignal=SIGINT
|
KillSignal=SIGINT
|
||||||
|
|||||||
Reference in New Issue
Block a user