Initial commit: Alfred Proxy with OAuth, TTS, and FCM push notifications

- Environment-based configuration (no hardcoded secrets)
- OAuth authentication via Authentik
- ElevenLabs TTS integration via SAG CLI
- FCM push notification support
- User preferences sync system
- Multi-user support with per-user context files
- No internal IPs or service accounts in tracked files
This commit is contained in:
2026-02-09 11:13:01 -08:00
commit 44ac8b6d1c
20 changed files with 5981 additions and 0 deletions

54
SYSTEMD.md Normal file
View File

@@ -0,0 +1,54 @@
# Alfred Proxy Systemd Service
## Service Management
```bash
# Status
systemctl --user status alfred-proxy
# Start
systemctl --user start alfred-proxy
# Stop
systemctl --user stop alfred-proxy
# Restart
systemctl --user restart alfred-proxy
# Enable (auto-start)
systemctl --user enable alfred-proxy
# Disable (no auto-start)
systemctl --user disable alfred-proxy
# View logs
journalctl --user -u alfred-proxy -f
# View proxy-specific logs
tail -f /tmp/alfred-proxy.log
```
## Auto-Restart
The service is configured with:
- **Restart=always** - Always restart on failure
- **RestartSec=5** - Wait 5 seconds between restarts
## Error Handling Improvements
Added to `server.js`:
1. **Global exception handler** - Catches uncaught exceptions
2. **Global rejection handler** - Catches unhandled promise rejections
3. **Proper interval cleanup** - Clears ping intervals on disconnection
These prevent the service from crashing on unexpected errors.
## Service File Location
`~/.config/systemd/user/alfred-proxy.service`
To modify: edit the file, then run:
```bash
systemctl --user daemon-reload
systemctl --user restart alfred-proxy
```