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
@@ -4,6 +4,7 @@ import sys
|
||||
from getpass import getpass
|
||||
|
||||
from .config import (
|
||||
REMOTE_MODES,
|
||||
InstallError,
|
||||
check_password,
|
||||
parse_plan,
|
||||
@@ -28,7 +29,9 @@ def number(value, label):
|
||||
|
||||
def interactive_plan():
|
||||
panel = {"hostname": prompt("Panel hostname")}
|
||||
access = panel["access"] = prompt("Panel access (tls or proxy)", "tls")
|
||||
access = panel["access"] = prompt(
|
||||
"Panel access (tls, acme, or proxy)", "tls"
|
||||
)
|
||||
if access == "tls":
|
||||
panel["certificate"] = prompt("Panel certificate path")
|
||||
panel["key"] = prompt("Panel private key path")
|
||||
@@ -46,9 +49,12 @@ def interactive_plan():
|
||||
},
|
||||
}
|
||||
for name in ("dns", "mail"):
|
||||
mode = prompt(f"{name.upper()} role (off, local, or remote)", "off")
|
||||
mode = prompt(
|
||||
f"{name.upper()} role (off, local, remote, or remote-install)",
|
||||
"off",
|
||||
)
|
||||
target = data[name] = {"mode": mode}
|
||||
if mode == "remote":
|
||||
if mode in REMOTE_MODES:
|
||||
target["host"] = prompt(
|
||||
f"{name.upper()} node SSH hostname or address"
|
||||
)
|
||||
@@ -56,10 +62,20 @@ def interactive_plan():
|
||||
prompt("SSH port", "22"), f"the {name} node"
|
||||
)
|
||||
target["host_key"] = prompt("Verified SSH host public key file")
|
||||
elif name == "mail" and mode == "local":
|
||||
target["host"] = prompt("Local mail hostname")
|
||||
target["certificate"] = prompt("Mail certificate path")
|
||||
target["key"] = prompt("Mail private key path")
|
||||
if mode == "remote-install":
|
||||
target["ssh_user"] = prompt("SSH administrator username")
|
||||
target["ssh_identity"] = prompt(
|
||||
"SSH administrator private key file"
|
||||
)
|
||||
if name == "mail" and mode in {"local", "remote-install"}:
|
||||
field = "host" if mode == "local" else "mail_hostname"
|
||||
target[field] = prompt("Public mail hostname")
|
||||
target["tls"] = prompt("Mail TLS (provided or acme)", "provided")
|
||||
if target["tls"] == "provided":
|
||||
target["certificate"] = prompt(
|
||||
"Certificate path on the mail host"
|
||||
)
|
||||
target["key"] = prompt("Private key path on the mail host")
|
||||
return parse_plan(data)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user