How briankohler/stunnel-openvpn works
Project Overview and Main Components
• The project provisions a remote OpenVPN server on DigitalOcean using Terraform, and it automatically connects a macOS client (with prerequisites like Tunnelblick and Homebrew) to the VPN via an STunnel wrapper.
• Key components include:
• Client Side: macOS machine running Tunnelblick (the VPN client).
• Provisioning Layer: Shell scripts (create.sh, destroy.sh) to trigger infrastructure provisioning and teardown.
• Infrastructure Management: Terraform script (digitalocean.tf) to provision a DigitalOcean droplet.
• Configuration Management: Puppet modules (within the puppet directory including Puppetfile, and rpm packages such as firehol.rpm, iprange.rpm, netdata.rpm, along with the site.pp file) that configure the droplet.
• Server Services: OpenVPN and STunnel installed on the provisioned remote server, as well as any auxiliary services (possibly monitored by Netdata) and additional security/firewall setups.
Architectural Relationships and Interactions
• The process begins with the user running create.sh, which calls Terraform (via digitalocean.tf) to create a droplet on DigitalOcean.
• Once the droplet is provisioned, Puppet is used (with files in the puppet directory and site.pp) to configure the server—this involves:
• Generating new SSH keys and SSL certificates.
• Installing and configuring STunnel to wrap OpenVPN connections so that they mimic normal HTTPS traffic.
• The userdata.sh script likely acts as an initialization script that runs on the new server to drive these configurations.
• The client (macOS) then connects using Tunnelblick, which interfaces with the server’s OpenVPN/STunnel setup.
• Optionally, destroy.sh is provided for tearing down the infrastructure.