mirror of
https://github.com/augustin64/projet-tipe
synced 2025-01-23 23:26:25 +01:00
Add CLI arguments
This commit is contained in:
parent
f904482199
commit
7a0182b5a9
1
.gitignore
vendored
1
.gitignore
vendored
@ -6,3 +6,4 @@
|
|||||||
.test-cache
|
.test-cache
|
||||||
.vscode
|
.vscode
|
||||||
*.bin
|
*.bin
|
||||||
|
app-secret
|
@ -47,6 +47,9 @@ app = Flask(__name__)
|
|||||||
app.config["SECRET_KEY"] = token_urlsafe(40)
|
app.config["SECRET_KEY"] = token_urlsafe(40)
|
||||||
print(f" * Secret: {SECRET}")
|
print(f" * Secret: {SECRET}")
|
||||||
|
|
||||||
|
with open("app-secret", "w", encoding="utf8") as file:
|
||||||
|
file.write(SECRET)
|
||||||
|
|
||||||
|
|
||||||
@app.route("/authenticate", methods=["POST"])
|
@app.route("/authenticate", methods=["POST"])
|
||||||
def authenticate():
|
def authenticate():
|
||||||
|
10
src/parallel/client.py
Normal file → Executable file
10
src/parallel/client.py
Normal file → Executable file
@ -15,9 +15,17 @@ import requests
|
|||||||
CACHE = "/tmp/parallel/client_cache" # Replace with an absolute path
|
CACHE = "/tmp/parallel/client_cache" # Replace with an absolute path
|
||||||
DELTA = os.path.join(CACHE, "delta_shared.bin")
|
DELTA = os.path.join(CACHE, "delta_shared.bin")
|
||||||
RESEAU = os.path.join(CACHE, "reseau_shared.bin")
|
RESEAU = os.path.join(CACHE, "reseau_shared.bin")
|
||||||
SECRET = input("SECRET : ")
|
|
||||||
|
if len(sys.argv) > 1:
|
||||||
|
HOST = sys.argv[1]
|
||||||
|
else:
|
||||||
HOST = input("HOST : ")
|
HOST = input("HOST : ")
|
||||||
|
|
||||||
|
if len(sys.argv) > 2:
|
||||||
|
SECRET = sys.argv[2]
|
||||||
|
else:
|
||||||
|
SECRET = input("SECRET : ")
|
||||||
|
|
||||||
session = requests.Session()
|
session = requests.Session()
|
||||||
os.makedirs(CACHE, exist_ok=True)
|
os.makedirs(CACHE, exist_ok=True)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user