Files
deploy-email-plesk-kerio-ne…/config.py
T
2026-05-12 11:04:17 +02:00

49 lines
1.9 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import os
from dotenv import load_dotenv
load_dotenv()
def _bool(v: str, default: bool = False) -> bool:
if v is None:
return default
return v.strip().lower() in ("1", "true", "yes", "on", "ja")
class Config:
# Plesk-Backend:
# "manual" Tool legt nichts an, das Mailpostfach muss von Hand
# im Plesk-Webinterface angelegt werden (Shared-Host-Fall).
# Die Zugangsdaten werden trotzdem im PDF ausgegeben, damit
# der Admin sie 1:1 ins Plesk-Webinterface eintragen kann.
# "api" Plesk REST-API (braucht API-Key oder Admin-Login)
# "ssh" SSH zum Plesk-Server, ruft `plesk bin mail` auf
PLESK_BACKEND = (os.getenv("PLESK_BACKEND") or "manual").strip().lower()
# Plesk REST-API
PLESK_API_KEY = os.getenv("PLESK_API_KEY") or ""
PLESK_USER = os.getenv("PLESK_USER") or ""
PLESK_PASSWORD = os.getenv("PLESK_PASSWORD") or ""
PLESK_PORT = int(os.getenv("PLESK_PORT", "8443"))
# Plesk SSH-Backend
PLESK_SSH_PORT = int(os.getenv("PLESK_SSH_PORT", "22"))
PLESK_SSH_USER = os.getenv("PLESK_SSH_USER") or ""
PLESK_SSH_PASSWORD = os.getenv("PLESK_SSH_PASSWORD") or ""
PLESK_SSH_KEY = os.getenv("PLESK_SSH_KEY") or ""
PLESK_SSH_KEY_PASSPHRASE = os.getenv("PLESK_SSH_KEY_PASSPHRASE") or ""
PLESK_SSH_USE_SUDO = _bool(os.getenv("PLESK_SSH_USE_SUDO"), False)
KERIO_USER = os.getenv("KERIO_ADMIN_USER") or "Admin"
KERIO_PASSWORD = os.getenv("KERIO_ADMIN_PASSWORD") or ""
KERIO_PORT = int(os.getenv("KERIO_ADMIN_PORT", "4040"))
NEXTCLOUD_USER = os.getenv("NEXTCLOUD_ADMIN_USER") or ""
NEXTCLOUD_PASSWORD = os.getenv("NEXTCLOUD_ADMIN_PASSWORD") or ""
POP3_PORT = int(os.getenv("POP3_PORT", "995"))
POP3_KEEP_DAYS = int(os.getenv("POP3_KEEP_DAYS", "14"))
SMTP_PORT = int(os.getenv("SMTP_PORT", "465"))
VERIFY_TLS = _bool(os.getenv("VERIFY_TLS"), True)