1
0
mirror of https://github.com/Mailu/Mailu.git synced 2025-03-03 14:52:36 +02:00

Use os.environment.get()

This commit is contained in:
Tim Möhlmann 2019-08-21 16:34:25 +03:00
parent 078082fac9
commit 52971ed42e
No known key found for this signature in database
GPG Key ID: 8677988D8072E8DE

View File

@ -5,11 +5,12 @@ import os
os.system("flask mailu advertise") os.system("flask mailu advertise")
os.system("flask db upgrade") os.system("flask db upgrade")
if 'INITIAL_ADMIN_ACCOUNT' in os.environ and 'INITIAL_ADMIN_DOMAIN' in os.environ and 'INITIAL_ADMIN_PW' in os.environ: account = os.environ.get("INITIAL_ADMIN_ACCOUNT")
mode = 'ifmissing' domain = os.environ.get("INITIAL_ADMIN_DOMAIN")
if 'INITIAL_ADMIN_MODE' in os.environ: password = os.environ.get("INITIAL_ADMIN_PW")
mode = os.environ['INITIAL_ADMIN_MODE']
os.system("flask mailu admin %s %s '%s' --mode %s" % ( if account is not None and domain is not None and password is not None:
os.environ['INITIAL_ADMIN_ACCOUNT'], os.environ['INITIAL_ADMIN_DOMAIN'], os.environ['INITIAL_ADMIN_PW'], mode)) mode = os.environ.get("INITIAL_ADMIN_MODE", default="ifmissing")
os.system("flask mailu admin %s %s '%s' --mode %s" % (account, domain, password, mode))
os.system("gunicorn -w 4 -b :80 --access-logfile - --error-logfile - --preload 'mailu:create_app()'") os.system("gunicorn -w 4 -b :80 --access-logfile - --error-logfile - --preload 'mailu:create_app()'")