mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2025-12-19 12:51:29 +00:00
43 lines
1.1 KiB
Python
43 lines
1.1 KiB
Python
import os
|
|
import sys
|
|
|
|
def main():
|
|
container_name = os.getenv("CONTAINER_NAME")
|
|
|
|
if container_name == "sogo-mailcow":
|
|
from modules.BootstrapSogo import Bootstrap
|
|
elif container_name == "nginx-mailcow":
|
|
from modules.BootstrapNginx import Bootstrap
|
|
elif container_name == "postfix-mailcow":
|
|
from modules.BootstrapPostfix import Bootstrap
|
|
elif container_name == "dovecot-mailcow":
|
|
from modules.BootstrapDovecot import Bootstrap
|
|
else:
|
|
print(f"No bootstrap handler for container: {container_name}", file=sys.stderr)
|
|
sys.exit(1)
|
|
|
|
b = Bootstrap(
|
|
container=container_name,
|
|
db_config={
|
|
"host": "localhost",
|
|
"user": os.getenv("DBUSER"),
|
|
"password": os.getenv("DBPASS"),
|
|
"database": os.getenv("DBNAME"),
|
|
"unix_socket": "/var/run/mysqld/mysqld.sock",
|
|
'connection_timeout': 2
|
|
},
|
|
db_table="service_settings",
|
|
db_settings=['sogo'],
|
|
redis_config={
|
|
"host": os.getenv("REDIS_SLAVEOF_IP") or "redis-mailcow",
|
|
"port": int(os.getenv("REDIS_SLAVEOF_PORT") or 6379),
|
|
"password": os.getenv("REDISPASS"),
|
|
"db": 0
|
|
}
|
|
)
|
|
|
|
b.bootstrap()
|
|
|
|
if __name__ == "__main__":
|
|
main()
|