[Integration] SWAG Proxy Manager โ€” Toggle SWAG nginx proxy confs as switches via SSH

SWAG Proxy Manager

Hi everyone! :waving_hand:

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 + graceful nginx -s reload
  • Turn OFF โ†’ renames the file to .conf.disabled + graceful nginx -s reload

nginx is only reloaded after a successful nginx -t pre-check, so your config is always protected.


Key features

  • :electric_plug: SSH-based โ€” connects to the Docker host over SSH (password or private key); works when HA and Docker are on separate machines
  • :counterclockwise_arrows_button: Auto-discovery โ€” new .conf files appearing on disk are picked up dynamically without restarting HA
  • :label: Clean entity names โ€” method suffixes (.subdomain, .subfolder) are stripped automatically, so you get Radarr, Sonarr, Nextcloud instead of technical file names (inspired by @InTheDaylight14's npm-switches)
  • :package: Docker image version โ€” the SWAG container version (org.opencontainers.image.version label) is detected and displayed in the HA device info
  • :repeat_button: Re-authentication flow โ€” if SSH credentials change, HA triggers the reauth UI automatically
  • :stethoscope: Diagnostics โ€” downloadable JSON snapshot for debugging (credentials redacted)
  • :globe_with_meridians: Translations โ€” English and French included
  • :clipboard: 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.

:backhand_index_pointing_right: GitHub: [GitHub - chpego/ha-swag-proxy: Home Assistant HACS repository that provides switches to enable or disable SWAG proxies. ยท GitHub]

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