remove old code
This commit is contained in:
parent
ee6229ff72
commit
645dd6ac1d
22
add_user.py
22
add_user.py
|
@ -1,22 +0,0 @@
|
||||||
# This is probably false advertising because it doesn't actually add a user for you.
|
|
||||||
# It only generates a string that you can copy-paste into users.py
|
|
||||||
|
|
||||||
from pyshare_receiver import salthash
|
|
||||||
from pyshare import character_pool
|
|
||||||
from random import choices
|
|
||||||
|
|
||||||
import sys
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
if len(sys.argv) != 3:
|
|
||||||
print('''
|
|
||||||
Usage:
|
|
||||||
$ python add_user.py <username> <password>
|
|
||||||
''')
|
|
||||||
sys.exit(0)
|
|
||||||
else:
|
|
||||||
username, password = sys.argv[1:]
|
|
||||||
salt = ''.join(choices(character_pool, k=10))
|
|
||||||
hash = salthash(password, salt)
|
|
||||||
print(f" '{username}': ['{hash}', '{salt}'],")
|
|
14
users.py
14
users.py
|
@ -1,14 +0,0 @@
|
||||||
# Add credentials for your own users here.
|
|
||||||
# Since I'll only have very few users (probably just me), using a proper DB is overkill
|
|
||||||
# The password hash is generated by
|
|
||||||
# hashlib.sha3_256(bytes((password + salt).encode('utf8'))).hexdigest()
|
|
||||||
|
|
||||||
# If you actually want to use this for something serious, you should probably use argon2 or something
|
|
||||||
|
|
||||||
users = {
|
|
||||||
'user1': ['c7d9c9621e417ea09141edbac126cd1f3ab1b2b94b2ad3b155a1e26a88b216c0', 'user1salt'],
|
|
||||||
}
|
|
||||||
|
|
||||||
# And btw, the password is just 'password'.
|
|
||||||
# I'm just saying this because there will be that one guy who actually thinks
|
|
||||||
# "Oh, I could totally brute-force this password now"
|
|
Loading…
Reference in New Issue
Block a user