mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-12-11 23:14:20 -05:00
improve logging for generate_config_from_template
This commit is contained in:
parent
043ab6da13
commit
a1732bbff9
@ -67,10 +67,11 @@ def generate_config_from_template(environ, ownership):
|
|||||||
# generate a new secret and write it to a file
|
# generate a new secret and write it to a file
|
||||||
|
|
||||||
if os.path.exists(filename):
|
if os.path.exists(filename):
|
||||||
|
log("Reading %s from %s" % (secret, filename))
|
||||||
with open(filename) as handle:
|
with open(filename) as handle:
|
||||||
value = handle.read()
|
value = handle.read()
|
||||||
else:
|
else:
|
||||||
log("Generating a random secret for {}".format(name))
|
log("Generating a random secret for {}".format(secret))
|
||||||
value = codecs.encode(os.urandom(32), "hex").decode()
|
value = codecs.encode(os.urandom(32), "hex").decode()
|
||||||
with open(filename, "w") as handle:
|
with open(filename, "w") as handle:
|
||||||
handle.write(value)
|
handle.write(value)
|
||||||
|
Loading…
Reference in New Issue
Block a user