mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Merge branch 'master' into v3
This commit is contained in:
commit
e611d05c34
@ -65,16 +65,16 @@ def setup():
|
|||||||
print("Password has been set.")
|
print("Password has been set.")
|
||||||
elif auth.defaultuser.checkpw("admin"):
|
elif auth.defaultuser.checkpw("admin"):
|
||||||
# if the actual pw is admin, it means we've never set this up properly (eg first start after update)
|
# if the actual pw is admin, it means we've never set this up properly (eg first start after update)
|
||||||
newpw, newpw_repeat = 1, 2
|
while True:
|
||||||
while newpw != newpw_repeat:
|
|
||||||
newpw = prompt("Please set a password for web backend access. Leave this empty to generate a random password.",skip=SKIP,secret=True)
|
newpw = prompt("Please set a password for web backend access. Leave this empty to generate a random password.",skip=SKIP,secret=True)
|
||||||
if newpw is None:
|
if newpw is None:
|
||||||
newpw = randomstring(32)
|
newpw = randomstring(32)
|
||||||
newpw_repeat = newpw
|
|
||||||
print("Generated password:",col["yellow"](newpw))
|
print("Generated password:",col["yellow"](newpw))
|
||||||
|
break
|
||||||
else:
|
else:
|
||||||
newpw_repeat = prompt("Please type again to confirm.",skip=SKIP,secret=True)
|
newpw_repeat = prompt("Please type again to confirm.",skip=SKIP,secret=True)
|
||||||
if newpw != newpw_repeat: print("Passwords do not match!")
|
if newpw != newpw_repeat: print("Passwords do not match!")
|
||||||
|
else: break
|
||||||
auth.defaultuser.setpw(newpw)
|
auth.defaultuser.setpw(newpw)
|
||||||
|
|
||||||
if malojaconfig["SEND_STATS"] is None:
|
if malojaconfig["SEND_STATS"] is None:
|
||||||
|
Loading…
Reference in New Issue
Block a user