This commit is contained in:
2026-09-08 09:24:35 +03:00
commit 19d8e1111a
6 changed files with 530 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
import secrets
import argparse
# Generates a long random hex key suitable for use as a client access key.
# Run this once per client (main/test/etc.) and put the result into:
# - server-side config.json (as the dict key, mapped to the folder)
# - updater.py CLIENT_KEYS (as the value, mapped to the display name)
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Generate a random hex access key for a client.")
parser.add_argument("--bytes", type=int, default=32,
help="Number of random bytes (default 32 -> 64 hex chars).")
args = parser.parse_args()
key = secrets.token_hex(args.bytes)
print(key)