SWAG Proxy Manager
Hi everyone! ![]()
I'd like to share a custom integration I built to manage SWAG (Secure Web Application Gateway)
by LinuxServer.io directly from Home Assistant.
What it does
SWAG organises its nginx configuration into two directories:
proxy-confs/โ per-app reverse proxy rules (Radarr, Sonarr, Nextcloud, etc.)site-confs/โ virtual host site configurations
Each .conf / .conf.disabled file becomes a switch entity in Home Assistant.
- Turn ON โ renames the file to
.conf+ gracefulnginx -s reload - Turn OFF โ renames the file to
.conf.disabled+ gracefulnginx -s reload
nginx is only reloaded after a successful nginx -t pre-check, so your config is always protected.
Key features
SSH-based โ connects to the Docker host over SSH (password or private key); works when HA and Docker are on separate machines
Auto-discovery โ new .conffiles appearing on disk are picked up dynamically without restarting HA
Clean entity names โ method suffixes (.subdomain,.subfolder) are stripped automatically, so you getRadarr,Sonarr,Nextcloudinstead of technical file names (inspired by @InTheDaylight14's npm-switches)
Docker image version โ the SWAG container version (org.opencontainers.image.versionlabel) is detected and displayed in the HA device info
Re-authentication flow โ if SSH credentials change, HA triggers the reauth UI automatically
Diagnostics โ downloadable JSON snapshot for debugging (credentials redacted)
Translations โ English and French included
IQS Silver โ built following the Integration Quality Scale (runtime_data, parallel_updates, log-when-unavailable, reconfigure flow, etc.)
Example use cases
# Disable a proxy at night
automation:
- alias: "Disable Radarr after midnight"
trigger:
- platform: time
at: "00:00:00"
action:
- service: switch.turn_off
target:
entity_id: switch.radarr
Installation
Available via HACS as a custom repository.
HACS โ Integrations โ โฎ โ Custom repositories โ Add URL โ Integration
---
### Screenshots / setup
**Step 1** โ SSH connection (host, port, user, password or key path)
**Step 2** โ SWAG paths (`proxy-confs`, `site-confs`) and container name
All validated live before the entry is created.
---
### Feedback welcome!
This is my first published HA integration โ happy to hear any feedback on the code,
missing features, or edge cases you'd like handled. ๐
Tested on:
- Home Assistant 2024.x+
- SWAG running in Docker on a separate Linux host
- SSH with both password and ed25519 key authentication