diff options
author | B. Stack <bgstack15@gmail.com> | 2022-03-17 17:33:42 -0400 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2022-03-17 17:33:42 -0400 |
commit | 8785f50d470dc6f23c5728447c8f3d5c04ca84f2 (patch) | |
tree | eb2aca6ebfa73307fc7b988b4a435d10260337a2 /stackbin.py | |
parent | Merge branch 'dev' into 'master' (diff) | |
download | stackbin-8785f50d470dc6f23c5728447c8f3d5c04ca84f2.tar.gz stackbin-8785f50d470dc6f23c5728447c8f3d5c04ca84f2.tar.bz2 stackbin-8785f50d470dc6f23c5728447c8f3d5c04ca84f2.zip |
include SET_URL conf setting for self-setting
Diffstat (limited to 'stackbin.py')
-rw-r--r-- | stackbin.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/stackbin.py b/stackbin.py index b245206..321cd91 100644 --- a/stackbin.py +++ b/stackbin.py @@ -98,6 +98,11 @@ def refresh_string(delay,url): """ return f'<meta http-equiv="Refresh" content="{delay}; url={url}">' +@app.before_first_request +def visit_set(): + if 'SET_URL' in app.config and '/set' in app.config['SET_URL']: + os.system(f"curl {app.config['SET_URL']} 1>/dev/null 2>&1 &") + @app.before_request def check_user_status(): g.user = None @@ -381,7 +386,7 @@ def favicon(): @app.route('/set') def get_proxied_path(): prefix = "/" - print(f"DEBUG: request.environ: {request.environ}") + #print(f"DEBUG: request.environ: {request.environ}") if 'HTTP_X_FORWARDED_PREFIX' in request.environ: hl = len(dict(request.headers)["X-Forwarded-Host"].split(", ")) pl = len(dict(request.headers)["X-Forwarded-Prefix"].split(", ")) |