Complete public hosting operations for Coulobre 0.9
This commit is contained in:
1 parent
a033d85d1f
commit
9e66510f7c
41 files changed
+2042
-44
No files matched your search
@@ -3,7 +3,7 @@ import os
|
||||
from pathlib import Path
|
||||
|
||||
from . import engine
|
||||
from .config import InstallError
|
||||
from .config import REMOTE_MODES, InstallError
|
||||
|
||||
WORKERS = {
|
||||
"dns": (
|
||||
@@ -119,6 +119,8 @@ def configure_dns():
|
||||
|
||||
|
||||
def configure_mail(target, modern):
|
||||
from . import submission
|
||||
|
||||
vmail = engine.identity("coulobre-vmail", home="/srv/coulobre-mail")
|
||||
dovecot = engine.group("dovecot")
|
||||
ensure_table(Path("/etc/postfix/coulobre-domains"), mode=0o644)
|
||||
@@ -182,7 +184,11 @@ def configure_mail(target, modern):
|
||||
uid=vmail.pw_uid,
|
||||
)
|
||||
replace_stock_config(
|
||||
Path("/etc/dovecot/dovecot.conf"), "dovecot-core", dovecot_config
|
||||
Path("/etc/dovecot/dovecot.conf"),
|
||||
"dovecot-core",
|
||||
dovecot_config.rstrip()
|
||||
+ "\n\n"
|
||||
+ (engine.ASSETS / "dovecot/submission-auth.conf.example").read_text(),
|
||||
)
|
||||
engine.run("doveconf", "-n", label="Validate the Dovecot configuration")
|
||||
engine.run(
|
||||
@@ -191,6 +197,8 @@ def configure_mail(target, modern):
|
||||
*(f"{key}={value}" for key, value in config.items()),
|
||||
label="Configure Postfix mailbox delivery",
|
||||
)
|
||||
engine.systemctl("enable", "--now", "redis-server.service")
|
||||
submission.configure()
|
||||
engine.run("postfix", "check", label="Validate the Postfix configuration")
|
||||
engine.systemctl("enable", "--now", "postfix.service", "dovecot.service")
|
||||
engine.systemctl("restart", "postfix.service", "dovecot.service")
|
||||
@@ -198,7 +206,7 @@ def configure_mail(target, modern):
|
||||
|
||||
def configure_role(installer, name, target):
|
||||
group, worker, receiver, unit = WORKERS[name]
|
||||
if target.mode == "remote":
|
||||
if target.mode in REMOTE_MODES:
|
||||
node_setup = engine.BINDIR / "coulobre-node-setup"
|
||||
engine.run(
|
||||
node_setup,
|
||||
@@ -206,6 +214,13 @@ def configure_role(installer, name, target):
|
||||
name,
|
||||
label=f"Prepare the panel's public key for the {name} node",
|
||||
)
|
||||
if target.mode == "remote-install":
|
||||
from . import remote
|
||||
|
||||
installer.progress(
|
||||
f"Installing the remote {name} node at {target.host}."
|
||||
)
|
||||
remote.install(name, target, installer.plan.admin_email)
|
||||
installer.progress(
|
||||
f"Checking the remote {name} node. Panel key: "
|
||||
f"/etc/coulobre-remote/{name}/id_ed25519.pub"
|
||||
|
||||
Reference in new issue
Block a user