1
0
mirror of https://github.com/Mailu/Mailu.git synced 2024-12-14 10:53:30 +02:00
Mailu/webmails/rainloop/start.py

30 lines
983 B
Python
Raw Normal View History

#!/usr/bin/python3
import os
import shutil
import logging as log
import sys
2019-01-24 16:14:33 +02:00
from mailustart import resolve, convert
2019-01-08 05:16:05 +02:00
log.basicConfig(stream=sys.stderr, level=os.environ.get("LOG_LEVEL", "WARNING"))
# Actual startup script
2019-01-24 16:14:33 +02:00
os.environ["FRONT_ADDRESS"] = resolve(os.environ.get("FRONT_ADDRESS", "front"))
os.environ["IMAP_ADDRESS"] = resolve(os.environ.get("IMAP_ADDRESS", "imap"))
2018-12-07 13:37:40 +02:00
os.environ["MAX_FILESIZE"] = str(int(int(os.environ.get("MESSAGE_SIZE_LIMIT"))*0.66/1048576))
base = "/data/_data_/_default_/"
shutil.rmtree(base + "domains/", ignore_errors=True)
os.makedirs(base + "domains", exist_ok=True)
os.makedirs(base + "configs", exist_ok=True)
convert("/default.ini", "/data/_data_/_default_/domains/default.ini")
2019-02-22 15:01:06 +02:00
convert("/application.ini", "/data/_data_/_default_/configs/application.ini")
2018-12-07 13:37:40 +02:00
convert("/php.ini", "/usr/local/etc/php/conf.d/rainloop.ini")
2018-10-08 15:35:09 +02:00
os.system("chown -R www-data:www-data /data")
2018-10-08 15:47:10 +02:00
os.execv("/usr/local/bin/apache2-foreground", ["apache2-foreground"])