$ show dvassallo/singleserver
This repository provides a self-hosted platform for deploying and managing web applications on a single server. It integrates Cloudflare for public access via tunnels, Tailscale for secure private access, Docker and Kamal for containerized deployment, and GitHub for webhook-triggered updates. The system consists of a daemon that handles incoming webhooks and manages deployments, and a CLI for initial setup and ongoing administration. Applications are deployed with zero-downtime using Kamal, and the platform automates the configuration of DNS, TLS, and service discovery. The architecture centers around a single Go binary that operates in two modes: as a background service (singleserverd) to process GitHub webhooks and orchestrate deployments, and as a command-line interface (singleserver) for users to configure the platform, add applications, and manage resources. State is stored in files under /etc/singleserver (configuration, credentials) and /srv (source code, storage, backups). The platform emphasizes simplicity and automation, aiming to reduce the operational overhead of running multiple applications on a single VPS. Key features include an interactive setup wizard for connecting provider accounts, automatic DNS and TLS configuration via Cloudflare, secure access through Tailscale Funnel, and a built-in diagnostics tool (doctor) to verify system health. The design prioritizes reliability through atomic file updates, context-aware command execution, and comprehensive error handling. The project includes extensive unit tests and end-to-end validation scenarios that exercise real integrations with the supported services.
The LLM identified 3 files worth highlighting for reuse:
Provides a flexible output system for CLI applications that can render structured data as human-readable grouped text or machine-readable JSON. Supports custom formatting via template functions and handles output destinations. Demonstrates skill in designing a dual-mode output system that caters to both operators and automation.
Encapsulates the execution of external commands with context-aware timeouts, output capture, and error wrapping. Provides helpers for running commands and capturing combined output, ensuring safe handling of child processes. Demonstrates skill in robust subprocess management within Go applications.
Implements interactive prompts for CLI applications with automatic fallback to non-interactive mode (using environment variables or defaults) when stdin is not a terminal. Supports various input types (string, int, bool) with validation. Demonstrates skill in building user-friendly CLI workflows that work in both interactive and automated environments.