Brana Frontend - Gate Control Panel
Static HTML page served by nginx, communicating directly with Home Assistant via REST API. Mobile-first design (max-width 420px, dark mode).
Access
Features
- Displays current gate state (open/closed/unknown) from Home Assistant
- Action buttons: open, close, stop
- Calls HA services via
https://ha.sebson.space (CSP allows only this host)
- Modal dialog for entering HA token (stored in localStorage)
- Status indicators:
- Ready - green
- Processing - blue (animated)
- Error - red
Nginx Configuration
- Security headers:
X-Frame-Options DENY, Content-Security-Policy, X-Content-Type-Options
- Real IP from
X-Real-IP header (trusts 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 - Traefik ranges)
- Gzip compression for assets
/health - health check endpoint
Useful Commands
# Follow nginx logs
docker compose logs -f brana-frontend
# Validate nginx config
docker exec brana-frontend nginx -t
# Reload config without restart
docker exec brana-frontend nginx -s reload
# Rebuild after changes to index.html
docker compose build brana-frontend && docker compose up -d brana-frontend