$ account sunweaver
This repository is a Bash-based server provisioning tool that converts a bare Debian 13 (Trixie) VPS into a dedicated Nextcloud High-Performance Backend (HPB) server. It installs and wires together the full Talk/HPB stack: nextcloud-spreed-signaling (built from source or from Debian packages), NATS message bus, coturn TURN/STUN server, Janus WebRTC gateway, and Collabora Online (CODE) for document editing, all fronted by an Nginx reverse proxy with Let's Encrypt certificates (separate RSA and ECDSA chains), UFW firewall, unattended-upgrades, and msmtp for email notifications. The output is a secrets file containing the Talk app credentials, TURN credentials, and per-Nextcloud-domain shared secrets that an administrator pastes into the Nextcloud Talk/Office settings. It supports multiple Nextcloud domains and can run fully unattended via a settings.sh file or interactively through whiptail dialogs. Architecturally it is a monolithic orchestrator (setup-nextcloud-hpb.sh) that loads settings, renders placeholder-based config templates from data/ into a temporary directory, then sources modular install_* functions from src/setup-{ufw,collabora,signaling,nginx,certbot,unattendedupgrades,msmtp}.sh. The configuration files under data/ are upstream service configs (Janus, coturn, signaling-server, nginx, coolwsd) with <PLACEHOLDER> tokens substituted via sed/perl. The design shows real operational craftsmanship: a dry-run mode is threaded through every step, deploy_file() uses SHA-256 checksums to make deployments idempotent, external IP detection has fallback endpoints, and secrets are written to a 0640 file while being masked in logs. The most reusable components are isolated shell patterns rather than whole modules: the checksum-based deploy_file() and perl-based replace_placeholder_in_files() functions in the main script (placeholder substitution that survives arbitrary password characters), the Certbot rate-limit/staging-certificate handling in src/setup-certbot.sh, and the version-marker + .deb cache build system for Janus in src/setup-signaling.sh. These patterns can be lifted into other provisioning projects. Caveats: the code has no tests, relies heavily on global variables shared across sourced modules, and contains a few real defects — the dry-run dialog always sets DRY_RUN=true when the setting is left empty, and the SSH-disable check compares the literal string 'DISABLE_SSH_SERVER' instead of the variable, so that feature never activates. Several commented-out legacy blocks remain. Despite this, the project is actively maintained (release 1.3.6, July 2026) and targets the current Debian release.