1
0
mirror of https://github.com/Mailu/Mailu.git synced 2025-06-15 00:05:11 +02:00

Create user for healthcheck

This commit is contained in:
Tim Möhlmann
2018-11-19 11:55:41 +02:00
parent a2b5b4d2e0
commit 2ced020513
2 changed files with 16 additions and 3 deletions

View File

@ -9,8 +9,11 @@ import os
def setup():
conn = psycopg2.connect('user=postgres')
queries = anosql.load_queries('postgres', '/conf/queries.sql')
queries.create_user(conn)
# Mailu user
queries.create_mailu_user(conn)
queries.update_pw(conn, pw=os.environ.get("SECRET_KEY"))
# Healthcheck user
queries.create_health_user(conn)
conn.commit()
# create db cannot be atomic. But this script is the only active connection, this is kinda safe.
if not queries.check_db(conn):