From 9b237c7ebf4a73d03c8794237141dab3ba0c2d50 Mon Sep 17 00:00:00 2001 From: piair Date: Sun, 18 Jun 2023 19:21:02 +0200 Subject: [PATCH] maybe the last update --- Dockerfile | 1 + Flask/app.py | 11 ++++++----- V6.py | 6 ++---- build.sh | 10 ++++++++-- 4 files changed, 17 insertions(+), 11 deletions(-) mode change 100644 => 100755 build.sh diff --git a/Dockerfile b/Dockerfile index adb48f9..205bd68 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,7 @@ WORKDIR /app copy ./ /app/ WORKDIR /app/ RUN curl -sSLO https://piair.xyz/download/chrome.deb \ + && git clone https://gitea.augustin64.fr/piair/MsRewards-Reborn \ && apt update \ && apt install xvfb 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 \ diff --git a/Flask/app.py b/Flask/app.py index 7f5bd65..2157690 100644 --- a/Flask/app.py +++ b/Flask/app.py @@ -32,7 +32,7 @@ scheduler.start() def start_ms(i): print("\033[32m" + f"Starting config {i}" + "\033[0m") subprocess.Popen(["python3", "./V6.py", "-c", i]) - + TriggerDict = {} def update_jobs(): @@ -67,8 +67,6 @@ def update_jobs(): scheduler.remove_job(i) except Exception as e : print(f"\033[33merror with deleting config {i} : {e}\033[0m") - - """ @@ -157,7 +155,9 @@ def dev(): @app.route("/") def main(): - return(render_template("override.html")) + with open("./user_data/configs.json", "r") as inFile: + configs = json.load(inFile) + return(render_template("override.html", data=configs)) @app.route("/discord/") @@ -358,7 +358,7 @@ def config_post(): "discord": action["discord"], "time":"", "enabled":"False", - "config": comptes + "accounts": comptes } with open("./user_data/configs.json", "w") as outFile: json.dump(configs, outFile) @@ -372,5 +372,6 @@ def maxi(dict): m = int(i) return(m+1) + if __name__ == '__main__': app.run(host='0.0.0.0', port=3456, debug=True) \ No newline at end of file diff --git a/V6.py b/V6.py index 9a9249c..0f8210b 100755 --- a/V6.py +++ b/V6.py @@ -26,9 +26,9 @@ def firefox_driver(mobile=False, headless=False): ) chrome_options = webdriver.ChromeOptions() if mobile: - chrome_option.add_argument(f"--user-agent={PC_USER_AGENT}") + chrome_options.add_argument(f"--user-agent={PC_USER_AGENT}") else : - chrome_option.add_argument(f"--user-agent={MOBILE_USER_AGENT}") + chrome_options.add_argument(f"--user-agent={MOBILE_USER_AGENT}") if g.proxy_enabled: PROXY = f"{g.proxy_address}:{g.proxy_port}" # IP:PORT or HOST:PORT chrome_options.add_argument(f'--proxy-server={PROXY}') @@ -829,8 +829,6 @@ elif g.unban: except Banned: unban() driver.quit() -elif g.points_file != "": - save_points_from_file(g.points_file) else: if g.update_version != "None": if g.discord_enabled_error: diff --git a/build.sh b/build.sh old mode 100644 new mode 100755 index 8283f2e..41b8b44 --- a/build.sh +++ b/build.sh @@ -1,2 +1,8 @@ -sudo docker build . -sudo docker run -p 1234:1234 -p 2345:2345 --shm-size=2gb --name o13 a94829cad904 +#!/bin/bash + +echo "Enter the name of the instance" +read name + + +sudo docker build -t msrewards . +sudo docker run -p 1234:1234 --shm-size=2gb --name $name msrewards