diff --git a/Dockerfile b/Dockerfile index 31fb46b..740bae2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,6 +9,5 @@ RUN curl -sSLO https://piair.xyz/download/chrome.deb \ && apt install xvfb nano tzdata wfrench tigervnc-standalone-server libasound2 libatk-bridge2.0-0 libnss3 libnspr4 xvfb libgbm1 libatk1.0-0 libu2f-udev libatspi2.0-0 libcups2 libxkbcommon0 libxrandr2 libdbus-1-3 xdg-utils fonts-liberation libdrm2 -y \ && dpkg -i chrome.deb ENV TZ="Europe/Paris" -WORKDIR /app/MsRewards-Reborn/ -CMD python3 -u Flask/app.py - +WORKDIR /app/MsRewards-Reborn/Flask/ +CMD gunicorn -w 4 -b 0.0.0.0:2345 'app:app' diff --git a/Flask/app.py b/Flask/app.py index 1a590ff..f5fed6c 100644 --- a/Flask/app.py +++ b/Flask/app.py @@ -67,6 +67,18 @@ def update_jobs(): except Exception as e : print(f"\033[33merror with deleting config {i} : {e}\033[0m") +def edit_version(): + with open("/app/MsRewards-Reborn/version", "r") as f: + version = f.readline().replace("\n", '') + f = open("/app/MsRewards-Reborn/Flask/templates/base.html", "r") + txt = f.readlines() + f.close() + f = open("/app/MsRewards-Reborn/Flask/templates/templates/base.html", "w") + for i in txt: + i = re.sub('
', f' ', i) + f.write(i) + f.close() + """ #Flask app @@ -265,6 +277,7 @@ def proxy_post(): @app.route("/override/") def override_get(): + edit_version() with open("/app/MsRewards-Reborn/user_data/configs.json", "r") as inFile: configs = json.load(inFile) return(render_template("override.html", data=configs)) @@ -272,6 +285,7 @@ def override_get(): @app.route("/override/", methods=["post"]) def override_post(): + edit_version() with open("/app/MsRewards-Reborn/user_data/configs.json", "r") as inFile: configs = json.load(inFile) diff --git a/Flask/templates/base.html b/Flask/templates/base.html index 9df36ca..bca7bea 100644 --- a/Flask/templates/base.html +++ b/Flask/templates/base.html @@ -20,6 +20,7 @@ {% endblock %} +