3542913689
- Smart TLS: skip certbot for IPs/.local/.lan, self-signed with SAN, HSTS max-age=0 for self-signed certs, split LAN vs public messages - Dynamic PHP: versionless meta-packages, runtime detection via php_ver fact - Vaultwarden: fail-fast on armv7l (32-bit ARM not supported upstream) - Module prompts: accept IPs for matrix/cloud/vault/media, hard error on email with IP, all_in_one skips certbot email for LAN - Matrix: skip matrix. prefix strip for IPs, warn about immutable server_name - OS family guards: ansible_os_family == Debian on all apt tasks - SSH key path: expanduser().resolve() on user-provided key paths - Cloudflare Tunnel: post-deploy script (setup-tunnel.sh) using CF API token — no browser auth needed, creates tunnel + credentials + DNS + systemd Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
30 lines
1.1 KiB
Python
30 lines
1.1 KiB
Python
"""Vaultwarden (Bitwarden-compatible) deployment module — binary + systemd + nginx."""
|
|
|
|
import secrets
|
|
|
|
CYAN = "\033[38;5;51m"
|
|
WHITE = "\033[38;5;255m"
|
|
GREY = "\033[38;5;244m"
|
|
RESET = "\033[0m"
|
|
|
|
|
|
def gather_config(config):
|
|
"""Gather Vaultwarden configuration."""
|
|
print(f"\n{CYAN} ┌─ Vaultwarden Configuration ───────────────────────┐{RESET}")
|
|
print(f" {CYAN}│{RESET} {GREY}Pre-built binary + systemd + nginx{RESET}")
|
|
|
|
config["domain"] = config.get("domain") or input(
|
|
f" {CYAN}│{RESET} Domain or IP (e.g. vault.example.com or 192.168.1.100): "
|
|
).strip()
|
|
|
|
config["vault_admin_token"] = input(
|
|
f" {CYAN}│{RESET} Admin token (blank=generate): "
|
|
).strip() or secrets.token_urlsafe(32)
|
|
|
|
config["vault_signups_allowed"] = input(
|
|
f" {CYAN}│{RESET} Allow signups? [{WHITE}no{RESET}]: "
|
|
).strip().lower() in ("yes", "y", "true")
|
|
|
|
print(f" {CYAN}└─────────────────────────────────────────────────────┘{RESET}")
|
|
return config
|