2 or 3 changes before tomorrows exams

This commit is contained in:
piair 2023-06-25 09:56:14 +02:00
parent 1e22cfcb4a
commit fabd826aa8
5 changed files with 20 additions and 6 deletions

View File

@ -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'

View File

@ -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('<div class="footer">([^<]+)</div>', f'<div class="footer">{version}</div>', 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)

View File

@ -20,6 +20,7 @@
{% endblock %}
</div>
</div>
<div class="footer">Version not detected yet</div>
</body>
</html>

View File

@ -8,9 +8,9 @@ requests
flask
mysql-connector-python
enquiries
rich
EasyProcess
pyotp
packaging
apscheduler
flask_login
flask_login
gunicorn

View File

@ -1 +1 @@
v6.0.0
v6.0.1