From a1b8e032e9f6a22f51ccfe3d77a18a9c0270079e Mon Sep 17 00:00:00 2001 From: stupidcomputer Date: Sun, 12 Jan 2025 21:20:56 -0600 Subject: [PATCH] make secrets removed from source --- flasktrack/app.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flasktrack/app.py b/flasktrack/app.py index 4e0f3b8..23bb0a1 100644 --- a/flasktrack/app.py +++ b/flasktrack/app.py @@ -3,13 +3,13 @@ import json from flasktrack.appendbase import Appendbase -submit_secret = "test" app = Flask(__name__) +app.config.from_envvar("FLASKTRACK_CREDENTIAL_LOCATION") base = Appendbase.from_file("base.json") @app.route('//submit', methods=[ "POST"]) def handle_new_data(secret): - if secret != submit_secret: + if secret != app.config["SUBMIT_SECRET"]: return '' print(request.form) base.append(request.form.to_dict()) @@ -19,7 +19,7 @@ def handle_new_data(secret): @app.route('//view') def return_monitor_page(secret): - if secret != submit_secret: + if secret != app.config["SUBMIT_SECRET"]: return '' data_js = "let location_data = " + json.dumps(base.stuff) + ";"