Pangolin¶
Pangolin is a self-hosted remote access platform. I intend to use it as the public entry point for reaching selected services on my home network without exposing each service directly to the internet. The Pangolin server is intended to run on my Hetzner Cloud VPS.
Pangolin connects remote networks to its server through site connectors, then routes access to resources that an administrator has configured. Resources can be public, such as a web application behind a proxy, or private, where the user connects with a Pangolin client. See the official documentation for how Pangolin works and resource types.
Network access¶
The Hetzner firewall created by
hetzner_vps_playbook.yml
allows the ports used by a self-hosted Pangolin installation:
| Protocol | Port | Purpose |
|---|---|---|
| TCP | 80 | HTTP and certificate validation |
| TCP | 443 | HTTPS and Pangolin web access |
| UDP | 51820 | Tunnels from Pangolin site connectors |
| UDP | 21820 | Client tunnel traffic |
SSH on TCP port 22 is restricted to the public IP address of the Ansible control host when the provisioning playbook runs. The Pangolin ports are open to the internet. For details, see Pangolin's self-hosted DNS and networking guide.
Configuration ownership¶
The Pangolin server and its DNS records are maintained separately. This
repository deploys the site connector on pi01 and configures the Stirling PDF
public resource through a site blueprint. The connector credentials are read
from the pi01 item in the Home-Ops 1Password vault. The intended
network relationship is shown in the architecture overview.
Create the Pangolin site in the Pangolin dashboard before running the site
playbook, then save its site ID and secret in that 1Password item. The public
DNS record for stirling.apps.dbren.uk must resolve to the Pangolin server.
Deploy Docker, the site connector, and its blueprint from the repository root:
Google sign-in¶
Google sign-in is configured in the Pangolin deployment and Google Cloud
Console. The built-in Google identity provider requires Pangolin Enterprise
Edition. For this deployment, set app.identity_provider_mode: "org" in
Pangolin's privateConfig.yml and apply the configuration before adding an
organization identity provider. See Pangolin's Google identity provider
guide.
Configure Google Cloud¶
- In the Google Cloud Console, select or
create the project named
pangolin-dbrenuk. - Open Google Auth Platform and complete the setup. Set the app name to
pangolin.apps.dbren.ukand enter a support email. - Choose an audience. Use Internal only if every allowed account belongs to the same Google Workspace organization. Otherwise choose External. While an External app is in Testing, add each permitted Google account under Test users; Google limits a Testing app to 100 test users.
- Under Branding, add
dbren.ukas an authorized domain. Verify domain ownership in Google if prompted. - Under Clients, create an OAuth client with application type Web
application and name it
Pangolin. Save the generated client ID and client secret securely. The redirect URI will be added after Pangolin provides it.
Configure Pangolin¶
- In the Pangolin organization, open Identity Providers and select Add Identity Provider.
- Choose Google, enter the Google client ID and client secret, and leave Auto Provision Users disabled.
- Create the provider, open its General tab, and copy the Redirect URL.
- Return to the
PangolinOAuth client in Google Cloud Console. Add the copied URL under Authorized redirect URIs and save the client. - In Pangolin, create an external user for every account allowed to sign in. Associate each user with the Google identity provider and assign the appropriate role. Use the exact identifier Pangolin expects for that account. If a login fails with a "No policies matched" error, Pangolin displays the identifier to use when creating the user.
With auto-provisioning disabled, an account must be pre-created in Pangolin to sign in. Google may authenticate other Google accounts, but Pangolin will not admit them to the organization unless their users are provisioned there. See Pangolin's identity provider instructions and auto-provisioning guide.
Update automation¶
The pangolin_update_playbook.yml playbook
updates the existing SQLite Enterprise Edition deployment. It checks the
latest stable releases of Pangolin, Gerbil, Traefik, and Badger, reports which
components need updating, backs up the configuration, and applies the updates.
Run it from the repository root with uv run ansible-playbook
pangolin_update_playbook.yml. It expects the Pangolin installation at
/opt/pangolin on ubuntu01.hetzner.dbren.uk.