|
|
@ -2,19 +2,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
# Launch as a eventlet.wsgi server instance.
|
|
|
|
# Launch as a eventlet.wsgi server instance.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
from distutils.util import strtobool
|
|
|
|
|
|
|
|
import eventlet
|
|
|
|
|
|
|
|
import eventlet.wsgi
|
|
|
|
import getopt
|
|
|
|
import getopt
|
|
|
|
import os
|
|
|
|
import os
|
|
|
|
import signal
|
|
|
|
import signal
|
|
|
|
import sys
|
|
|
|
import sys
|
|
|
|
|
|
|
|
|
|
|
|
import eventlet
|
|
|
|
|
|
|
|
import eventlet.wsgi
|
|
|
|
|
|
|
|
from . import store, changedetection_app, content_fetcher
|
|
|
|
from . import store, changedetection_app, content_fetcher
|
|
|
|
from . import __version__
|
|
|
|
from . import __version__
|
|
|
|
|
|
|
|
|
|
|
|
# Only global so we can access it in the signal handler
|
|
|
|
# Only global so we can access it in the signal handler
|
|
|
|
datastore = None
|
|
|
|
|
|
|
|
app = None
|
|
|
|
app = None
|
|
|
|
|
|
|
|
datastore = None
|
|
|
|
|
|
|
|
|
|
|
|
def sigterm_handler(_signo, _stack_frame):
|
|
|
|
def sigterm_handler(_signo, _stack_frame):
|
|
|
|
global app
|
|
|
|
global app
|
|
|
@ -106,8 +107,9 @@ def main():
|
|
|
|
# @Note: Incompatible with password login (and maybe other features) for now, submit a PR!
|
|
|
|
# @Note: Incompatible with password login (and maybe other features) for now, submit a PR!
|
|
|
|
@app.after_request
|
|
|
|
@app.after_request
|
|
|
|
def hide_referrer(response):
|
|
|
|
def hide_referrer(response):
|
|
|
|
if os.getenv("HIDE_REFERER", False):
|
|
|
|
if strtobool(os.getenv("HIDE_REFERER", False)):
|
|
|
|
response.headers["Referrer-Policy"] = "no-referrer"
|
|
|
|
response.headers["Referrer-Policy"] = "no-referrer"
|
|
|
|
|
|
|
|
|
|
|
|
return response
|
|
|
|
return response
|
|
|
|
|
|
|
|
|
|
|
|
# Proxy sub-directory support
|
|
|
|
# Proxy sub-directory support
|
|
|
|