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

Use python package socrate instead of Mailustart

This commit is contained in:
hoellen
2019-07-25 10:33:57 +02:00
parent 2788909a13
commit 9de5dc2592
17 changed files with 71 additions and 59 deletions

View File

@ -6,6 +6,7 @@ import jinja2
import glob
import os
import subprocess
from socrate import conf
def setup():
conn = psycopg2.connect(user='postgres')
@ -47,9 +48,8 @@ os.system("mkdir -p /backup/wal_archive")
os.system("chown -R postgres:postgres /backup")
# Render config files
convert = lambda src, dst: open(dst, "w").write(jinja2.Template(open(src).read()).render(**os.environ))
for pg_file in glob.glob("/conf/*.conf"):
convert(pg_file, os.path.join("/data", os.path.basename(pg_file)))
conf.jinja(pg_file, os.environ, os.path.join("/data", os.path.basename(pg_file)))
# (Re)start postgresql locally for DB and user creation
os.system("sudo -u postgres pg_ctl start -D /data -o '-h \"''\" '")