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