$ show SteveLTN/https-portal
HTTPS-PORTAL is a Docker image that automates HTTPS setup using Nginx and Let's Encrypt. It provides a fully automated reverse proxy that obtains SSL certificates, configures Nginx, and handles renewal. The container runs multiple supervised processes via s6-overlay: Nginx, docker-gen (for automatic container discovery), cron (for certificate renewal), and a dynamic environment watcher. Configuration is driven by environment variables, primarily the `DOMAINS` variable which supports a rich syntax for specifying upstreams, redirects, basic auth, access restrictions, custom ports, and per-domain stages. The codebase is primarily Ruby scripts that parse domain descriptors, generate Nginx configuration from ERB templates, and orchestrate certificate signing via acme-tiny. The architecture is clean and modular, with clear separation between domain parsing, certificate management, and Nginx configuration generation. The repository includes comprehensive integration tests using Docker Compose and RSpec.
The LLM identified 2 files worth highlighting for reuse:
The Domain class parses the complex `DOMAINS` environment variable syntax into structured data. It handles upstreams, redirects, basic auth, access restrictions, custom ports, stages, and multiple upstreams with parameters. The parsing is done via a single well-crafted regex and provides clean accessor methods. This component is self-contained and could be extracted for use in other projects that need to parse similar domain configuration strings.
A clean implementation of ERB template rendering using a dynamic binding object. It creates a CleanBinding class that defines methods from a hash, then uses that binding to render ERB templates. This pattern avoids polluting the global namespace and provides a safe way to pass variables to templates. It is reusable in any Ruby project that needs to render ERB templates with a controlled set of variables.