diff --git a/Dockerfile b/Dockerfile index 3d2fc9e..2522a04 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ RUN curl -sSLO https://piair.xyz/download/chrome.deb \ && wget -q -O /usr/share/keyrings/grafana.key https://apt.grafana.com/gpg.key \ && echo "deb [signed-by=/usr/share/keyrings/grafana.key] https://apt.grafana.com stable main" | tee -a /etc/apt/sources.list.d/grafana.list \ && apt update \ - && apt install grafana xvfb nginx nano tzdata sqlite3 apt-transport-https software-properties-common wget 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 novnc websockify grafana xvfb nginx nano tzdata sqlite3 apt-transport-https software-properties-common wget 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 \ && bash MsRewards-Reborn/config/config.sh \ && dpkg -i chrome.deb diff --git a/Flask/app.py b/Flask/app.py index a19a36c..024f7e5 100644 --- a/Flask/app.py +++ b/Flask/app.py @@ -134,7 +134,7 @@ def login(): login_user(user) if password == "ChangeMe": return(redirect('/change_password')) - return(redirect('/override')) + return(redirect('/schedule')) else: return abort(401) else: @@ -175,7 +175,7 @@ def load_user(userid): def main(): with open("/app/MsRewards-Reborn/user_data/configs.json", "r") as inFile: configs = json.load(inFile) - return(render_template("override.html", data=configs)) + return(render_template("schedule.html", data=configs)) @app.route("/discord/") @@ -282,15 +282,15 @@ def proxy_post(): return(render_template("proxy.html", data=data, len=maxi(data))) -@app.route("/override/") -def override_get(): +@app.route("/schedule/") +def schedule_get(): with open("/app/MsRewards-Reborn/user_data/configs.json", "r") as inFile: configs = json.load(inFile) - return(render_template("override.html", data=configs)) + return(render_template("schedule.html", data=configs)) -@app.route("/override/", methods=["post"]) -def override_post(): +@app.route("/schedule/", methods=["post"]) +def schedule_post(): with open("/app/MsRewards-Reborn/user_data/configs.json", "r") as inFile: configs = json.load(inFile) @@ -308,7 +308,7 @@ def override_post(): with open("/app/MsRewards-Reborn/user_data/configs.json", "w") as inFile: json.dump(configs, inFile) update_jobs() - return(render_template("override.html", data=configs)) + return(render_template("schedule.html", data=configs)) @app.route("/config/") @@ -363,11 +363,16 @@ def logs(): print(configs) return(render_template("logs.html", data=configs)) + @app.route("/stats/", methods=["GET", "POST"]) def stats(): return(render_template("stats.html")) +@app.route("/override/", methods=["GET", "POST"]) +def override(): + return(render_template("vnc.html")) + @app.route('/download/', methods=['GET', 'POST']) @login_required diff --git a/Flask/static/js/main.js b/Flask/static/js/main.js index c2495fc..cfaae78 100644 --- a/Flask/static/js/main.js +++ b/Flask/static/js/main.js @@ -3,7 +3,6 @@ function addline(ligne){ document.getElementById("table").insertRow(lplus).insertCell(0).innerHTML = '' } - function change_discord(value, data, len) { if (value == len){ document.getElementById("name").value = ""; @@ -25,6 +24,7 @@ function change_discord(value, data, len) { } function change_config(value, data, len) { + console.log(data[2]); document.getElementById("delete").style.visibility = "hidden"; if (value == len){ document.getElementById("submit").value = "Create !"; @@ -52,7 +52,6 @@ function change_config(value, data, len) { } } - function change_proxy(value, data, len) { if (value == len){ document.getElementById("submit").value = "Create"; @@ -68,7 +67,6 @@ function change_proxy(value, data, len) { } } - function change_logs(value) { document.getElementById("embed").src = "/static/logs/" + value + ".txt"; } diff --git a/Flask/templates/base.html b/Flask/templates/base.html index 5fb9d51..9960b71 100644 --- a/Flask/templates/base.html +++ b/Flask/templates/base.html @@ -24,8 +24,49 @@
- {% block left_pannel %} - {% endblock %} + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
{% block content %} diff --git a/Flask/templates/change_password.html b/Flask/templates/change_password.html index 572479e..e5851fd 100644 --- a/Flask/templates/change_password.html +++ b/Flask/templates/change_password.html @@ -1,43 +1,5 @@ {% extends "base.html" %} {% block left_pannel %} - - - - - - - - - - - - - - - - - - - - - - - -
- -
- -
- -
- -
- -
- -
- -
{% endblock %} {% block content %} diff --git a/Flask/templates/config.html b/Flask/templates/config.html index 8f8ebd9..eb3fc6f 100644 --- a/Flask/templates/config.html +++ b/Flask/templates/config.html @@ -1,48 +1,10 @@ {% extends "base.html" %} -{% block left_pannel %} - - - - - - - - - - - - - - - - - - - - - - -
- -
- -
- -
- -
- -
- -
- -
-{% endblock %} +{% block left_pannel %}config{% endblock %} {% block content %} - + {%if not current_user.is_authenticated %} {% else %} @@ -51,7 +13,7 @@ config : - {% for i in configs %} diff --git a/Flask/templates/discord.html b/Flask/templates/discord.html index 803e0cf..d569fee 100644 --- a/Flask/templates/discord.html +++ b/Flask/templates/discord.html @@ -1,44 +1,5 @@ {% extends "base.html" %} -{% block left_pannel %} - - - - - - - - - - - - - - - - - - - - - - - -
- -
- -
- -
- -
- -
- -
- -
-{% endblock %} +{% block left_pannel %}discord{% endblock %} {% block content %} {%if not current_user.is_authenticated %} diff --git a/Flask/templates/login.html b/Flask/templates/login.html index b11d5b5..bb7b340 100644 --- a/Flask/templates/login.html +++ b/Flask/templates/login.html @@ -1,10 +1,5 @@ {% extends "base.html" %} -{% block left_pannel %} - - - -
-{% endblock %} +{% block left_pannel %}login{% endblock %} {% block content %} {%if not current_user.is_authenticated %} diff --git a/Flask/templates/logs.html b/Flask/templates/logs.html index 741f238..69ab013 100644 --- a/Flask/templates/logs.html +++ b/Flask/templates/logs.html @@ -1,44 +1,5 @@ {% extends "base.html" %} -{% block left_pannel %} - - - - - - - - - - - - - - - - - - - - - - - -
- -
- -
- -
- -
- -
- -
- -
-{% endblock %} +{% block left_pannel %}logs{% endblock %} {% block content %} {%if not current_user.is_authenticated %} diff --git a/Flask/templates/override.html b/Flask/templates/override.html deleted file mode 100644 index 436f6b6..0000000 --- a/Flask/templates/override.html +++ /dev/null @@ -1,74 +0,0 @@ -{% extends "base.html" %} -{% block left_pannel %} - - - - - - - - - - - - - - - - - - - - - - - -
- -
- -
- -
- -
- -
- -
- -
-{% endblock %} - -{% block content %} - -{%if not current_user.is_authenticated %} - -{% else %} - -
- - {% for i in data %} - - - - - - - {% endfor %} - -
{{data[i]['name']}} - - - - -
- - - -
-{% endif %} - -{%endblock %} \ No newline at end of file diff --git a/Flask/templates/proxy.html b/Flask/templates/proxy.html index e020772..fa6fc06 100644 --- a/Flask/templates/proxy.html +++ b/Flask/templates/proxy.html @@ -1,44 +1,5 @@ {% extends "base.html" %} -{% block left_pannel %} - - - - - - - - - - - - - - - - - - - - - - - -
- -
- -
- -
- -
- -
- -
- -
-{% endblock %} +{% block left_pannel %}proxy{% endblock %} diff --git a/Flask/templates/schedule.html b/Flask/templates/schedule.html new file mode 100644 index 0000000..b428401 --- /dev/null +++ b/Flask/templates/schedule.html @@ -0,0 +1,35 @@ +{% extends "base.html" %} +{% block left_pannel %}schedule{% endblock %} + +{% block content %} + +{%if not current_user.is_authenticated %} + +{% else %} + +
+ + {% for i in data %} + + + + + + + {% endfor %} + +
{{data[i]['name']}} + + + + +
+ + + +
+{% endif %} + +{%endblock %} \ No newline at end of file diff --git a/Flask/templates/settings.html b/Flask/templates/settings.html index 284b2a0..e65cbb0 100644 --- a/Flask/templates/settings.html +++ b/Flask/templates/settings.html @@ -1,44 +1,5 @@ {% extends "base.html" %} -{% block left_pannel %} - - - - - - - - - - - - - - - - - - - - - - - -
- -
- -
- -
- -
- -
- -
- -
-{% endblock %} +{% block left_pannel %}settings{% endblock %} {% block content %} {%if not current_user.is_authenticated %} diff --git a/Flask/templates/stats.html b/Flask/templates/stats.html index 94e5d3d..b994e12 100644 --- a/Flask/templates/stats.html +++ b/Flask/templates/stats.html @@ -1,44 +1,5 @@ {% extends "base.html" %} -{% block left_pannel %} - - - - - - - - - - - - - - - - - - - - - - - -
- -
- -
- -
- -
- -
- -
- -
-{% endblock %} +{% block left_pannel %}stats{% endblock %} {% block content %} diff --git a/Flask/templates/vnc.html b/Flask/templates/vnc.html new file mode 100644 index 0000000..9eea470 --- /dev/null +++ b/Flask/templates/vnc.html @@ -0,0 +1,13 @@ + +{% extends "base.html" %} +{% block left_pannel %}override{% endblock %} + +{% block content %} + +{%if not current_user.is_authenticated %} + +{% else %} + +{% endif %} + +{%endblock %} \ No newline at end of file diff --git a/V6.py b/V6.py index 084defc..ee5134d 100755 --- a/V6.py +++ b/V6.py @@ -366,7 +366,10 @@ def try_play(nom="inconnu"): driver.find_element(By.CSS_SELECTOR, '[onclick="setsrchusr()"]').click() custom_sleep(5) printf("not connected, fixed") - + if "legaltextbox" in driver.current_url: + log_error("dev1") + driver.find_element(By.CLASS_NAME, "actionLink").click() + log_error("dev2") try: if wait_until_visible(By.ID, "rqStartQuiz", 5, driver): custom_sleep(3) @@ -826,7 +829,7 @@ else : display = SmartDisplay(size=(1920, 1080)) display.start() -webhookFailure.send(f"Starting on this config", username="Check de lancement", avatar_url="https://cdn-icons-png.flaticon.com/512/1688/1688988.png") +webhookFailure.send(f"@silent Starting on this config", username="Check de lancement", avatar_url="https://cdn-icons-png.flaticon.com/512/1688/1688988.png") if g.custom_start: CustomStart() diff --git a/config/config.sh b/config/config.sh index 88de766..fb2fe5c 100644 --- a/config/config.sh +++ b/config/config.sh @@ -27,6 +27,19 @@ server { proxy_pass http://grafana; rewrite ^/grafana/(.*) /\$1 break; } + + location /novnc/ { + proxy_pass http://127.0.0.1:6080/; + } + + location /novnc/websockify { + proxy_pass http://127.0.0.1:6080/; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_set_header Host $host; + } + location / { proxy_set_header X-Forwarded-For \$remote_addr; proxy_set_header Host \$http_host; @@ -47,4 +60,5 @@ cp /app/MsRewards-Reborn/config/grafana.ini /etc/grafana/ grafana-cli plugins install frser-sqlite-datasource printf "setting up default dashboard" -cp /app/MsRewards-Reborn/config/Stats-dashbord.json /usr/share/grafana/public/dashboards/home.json \ No newline at end of file +cp /app/MsRewards-Reborn/config/Stats-dashbord.json /usr/share/grafana/public/dashboards/home.json + diff --git a/config/request.sh b/config/request.sh index ed70b22..8616dd5 100644 --- a/config/request.sh +++ b/config/request.sh @@ -12,3 +12,8 @@ curl 'http://localhost:1234/grafana/api/dashboards/import' \ --compressed \ --insecure + +websockify -D \ + --web /usr/share/novnc/ \ + 6080 \ + localhost:2345 \ No newline at end of file diff --git a/version b/version index 68380a8..dfe77b4 100644 --- a/version +++ b/version @@ -1 +1 @@ -v6.3.2 +v6.4.4