2 or 3 changes before tomorrows exams
This commit is contained in:
parent
1e22cfcb4a
commit
fabd826aa8
@ -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 \
|
&& 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
|
&& dpkg -i chrome.deb
|
||||||
ENV TZ="Europe/Paris"
|
ENV TZ="Europe/Paris"
|
||||||
WORKDIR /app/MsRewards-Reborn/
|
WORKDIR /app/MsRewards-Reborn/Flask/
|
||||||
CMD python3 -u Flask/app.py
|
CMD gunicorn -w 4 -b 0.0.0.0:2345 'app:app'
|
||||||
|
|
||||||
|
14
Flask/app.py
14
Flask/app.py
@ -67,6 +67,18 @@ def update_jobs():
|
|||||||
except Exception as e :
|
except Exception as e :
|
||||||
print(f"\033[33merror with deleting config {i} : {e}\033[0m")
|
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
|
#Flask app
|
||||||
@ -265,6 +277,7 @@ def proxy_post():
|
|||||||
|
|
||||||
@app.route("/override/")
|
@app.route("/override/")
|
||||||
def override_get():
|
def override_get():
|
||||||
|
edit_version()
|
||||||
with open("/app/MsRewards-Reborn/user_data/configs.json", "r") as inFile:
|
with open("/app/MsRewards-Reborn/user_data/configs.json", "r") as inFile:
|
||||||
configs = json.load(inFile)
|
configs = json.load(inFile)
|
||||||
return(render_template("override.html", data=configs))
|
return(render_template("override.html", data=configs))
|
||||||
@ -272,6 +285,7 @@ def override_get():
|
|||||||
|
|
||||||
@app.route("/override/", methods=["post"])
|
@app.route("/override/", methods=["post"])
|
||||||
def override_post():
|
def override_post():
|
||||||
|
edit_version()
|
||||||
with open("/app/MsRewards-Reborn/user_data/configs.json", "r") as inFile:
|
with open("/app/MsRewards-Reborn/user_data/configs.json", "r") as inFile:
|
||||||
configs = json.load(inFile)
|
configs = json.load(inFile)
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="footer">Version not detected yet</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
@ -8,9 +8,9 @@ requests
|
|||||||
flask
|
flask
|
||||||
mysql-connector-python
|
mysql-connector-python
|
||||||
enquiries
|
enquiries
|
||||||
rich
|
|
||||||
EasyProcess
|
EasyProcess
|
||||||
pyotp
|
pyotp
|
||||||
packaging
|
packaging
|
||||||
apscheduler
|
apscheduler
|
||||||
flask_login
|
flask_login
|
||||||
|
gunicorn
|
Loading…
Reference in New Issue
Block a user