From f50f48cf018c14a86888fa5965b6e12cf597b5ae Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Fri, 4 Jan 2019 14:48:42 +1300 Subject: [PATCH] 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. --- dockersetup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockersetup.py b/dockersetup.py index 4477a8b..34d74e3 100755 --- a/dockersetup.py +++ b/dockersetup.py @@ -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')