feat: add poor mans version of clan vars
This commit is contained in:
parent
13ca5cadd4
commit
a5de9aea37
4 changed files with 41 additions and 2 deletions
19
script/qbittorrent/hash.py
Normal file
19
script/qbittorrent/hash.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#!/usr/bin/bash
|
||||
|
||||
import base64
|
||||
import hashlib
|
||||
import sys
|
||||
import uuid
|
||||
|
||||
password = sys.argv[1]
|
||||
salt = uuid.uuid4()
|
||||
salt_bytes = salt.bytes
|
||||
|
||||
password = str.encode(password)
|
||||
hashed_password = hashlib.pbkdf2_hmac("sha512", password, salt_bytes, 100000, dklen=64)
|
||||
b64_salt = base64.b64encode(salt_bytes).decode("utf-8")
|
||||
b64_password = base64.b64encode(hashed_password).decode("utf-8")
|
||||
password_string = "@ByteArray({salt}:{password})".format(
|
||||
salt=b64_salt, password=b64_password
|
||||
)
|
||||
print(password_string)
|
||||
3
script/qbittorrent/password
Normal file
3
script/qbittorrent/password
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
pwgen -s 128 1
|
||||
3
script/qbittorrent/password_hash
Normal file
3
script/qbittorrent/password_hash
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
python ./hash.py "$(just vars get ulmo qbittorrent/password | jq -r)"
|
||||
Loading…
Add table
Add a link
Reference in a new issue