dockersetup: fix auto-generated passwords

* We can't use # because it can result in part of the password being
  trimmed off when it gets put in a configuration file.
* Similarly, our parsing splits on = so it is unwise to allow as a valid
  character.
* Add uppercase characters for a little more randomisation.
This commit is contained in:
Paul Eggleton 2019-01-04 14:48:42 +13:00
parent 99a86d7e0a
commit f50f48cf01

View File

@ -363,7 +363,7 @@ def setup_https(hostname, http_port, https_port, letsencrypt, cert, cert_key):
def generatepasswords(passwordlength):
return ''.join([random.SystemRandom().choice('abcdefghijklmnopqrstuvwxyz0123456789!@#%^&*-_=+') for i in range(passwordlength)])
return ''.join([random.SystemRandom().choice('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@%^&*-_+') for i in range(passwordlength)])
def readfile(filename):
f = open(filename,'r')