-
Notifications
You must be signed in to change notification settings - Fork 0
fix(vpn): make gluetun VPN work end-to-end + add NordVPN #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,11 +13,17 @@ export interface CaddyOptions { | |
| enabled: boolean; | ||
| tld: string; | ||
| }; | ||
| // When VPN is on, qBittorrent shares gluetun's netns and has no container | ||
| // name of its own, so Caddy must proxy its vhost to gluetun instead. | ||
| vpn?: { enabled: boolean }; | ||
| } | ||
|
|
||
| interface CaddyServiceEntry { | ||
| id: string; | ||
| port: number; | ||
| // Docker network host Caddy reverse-proxies to. Usually the same as `id`; | ||
| // becomes "gluetun" for qBittorrent when VPN routing is on. | ||
| upstream: string; | ||
| } | ||
|
|
||
| interface CaddyContext { | ||
|
|
@@ -29,9 +35,14 @@ interface CaddyContext { | |
| } | ||
|
|
||
| export function buildCaddyContext(services: Service[], opts: CaddyOptions): CaddyContext { | ||
| const vpnEnabled = opts.vpn?.enabled ?? false; | ||
| const entries: CaddyServiceEntry[] = services | ||
| .filter((svc) => svc.adminPort !== undefined) | ||
| .map((svc) => ({ id: svc.id, port: svc.adminPort as number })); | ||
| .map((svc) => ({ | ||
| id: svc.id, | ||
| port: svc.adminPort as number, | ||
| upstream: vpnEnabled && svc.id === "qbittorrent" ? "gluetun" : svc.id, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
For VPN installs with local DNS enabled, this computes Useful? React with 👍 / 👎. |
||
| })); | ||
|
|
||
| return { | ||
| mode: opts.mode, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
arrstack updateThe renderer defaults omitted
vpnoptions to false, butarrstack updateregenerates the Caddyfile without passingstate.vpn. For existing VPN installs in DuckDNS/Cloudflare mode, an update therefore rewrites the qBittorrent vhost back toreverse_proxy qbittorrent:8080even though compose still puts qBittorrent in gluetun's network namespace, breaking remote qBittorrent access after every update.Useful? React with 👍 / 👎.