"Automated Service Provisioning for Traefik + AdGuard + Homepage"
- Python 42.4%
- HTML 30.9%
- Shell 13.4%
- CSS 12.2%
- JavaScript 1.1%
- GET /api/services now automatically adds domain field from Traefik if missing - Fixes empty domain field in edit modal for legacy services - Domain is now always populated when editing services 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> |
||
|---|---|---|
| config | ||
| scripts | ||
| static | ||
| templates | ||
| .env.example | ||
| .gitignore | ||
| adguard_sync.py | ||
| app.py | ||
| deploy.sh | ||
| dynamic.yml | ||
| README.md | ||
| requirements.txt | ||
| ROADMAP.md | ||
| service-manager.service | ||
| services.yml | ||
| SESSION_SUMMARY.md | ||
| traefik_parser.py | ||
| traefik_writer.py | ||
🚀 Service Manager
A comprehensive automation platform for Traefik reverse proxy with integrated AdGuard DNS management and Homepage dashboard integration.
✨ Features
Core Functionality
- 📝 Service Management: Full CRUD operations for services
- 🔄 Traefik Integration: Direct read/write to Traefik dynamic configuration
- 📡 Live Status Monitoring: Real-time health checks with auto-refresh every 30s
- 🌐 Automated DNS: Automatic DNS rewrite creation in AdGuard Home
- 🔍 Search & Filter: Fast service search and multi-criteria sorting
- 💾 Export/Import: Backup and restore services (JSON/YAML)
Workflow Automation
- Add Service via UI → Service name, domain, backend URL
- Automatic Traefik Config → Router + Service written to
dynamic.yml - Traefik Auto-Reload → File Provider detects changes
- DNS Entry Created → AdGuard DNS rewrite added automatically
- Service Live → Instantly accessible via HTTPS
UI Features
- Dual Mode Forms: Simple mode (basic) + Traefik mode (advanced)
- Status Badges: Live online/offline indicators with response times
- Dark Theme: Modern, responsive design
- Toast Notifications: User feedback for all actions
🎯 Quick Start
Prerequisites
- Traefik 2.x with File Provider
- AdGuard Home
- Python 3.8+
Installation
# Clone repository
git clone http://192.168.10.113:3000/adminar/service-manager.git
cd service-manager
# Install dependencies
pip3 install -r requirements.txt
# Configure environment
cp .env.example .env
nano .env # Edit with your settings
# Run
python3 app.py
Deployment to Traefik LXC (Recommended)
For production deployment in Proxmox LXC container:
./deploy.sh
This will:
- Install Service Manager in Traefik LXC (201)
- Configure systemd service for auto-start
- Set up environment variables
- Start the service on port 5001
📋 Configuration
Create .env file (see .env.example):
# Traefik
TRAEFIK_CONFIG=/etc/traefik/dynamic.yml
TRAEFIK_IP=192.168.10.91
TRAEFIK_ENABLED=True
# AdGuard
ADGUARD_ENABLED=True
ADGUARD_URL=http://192.168.10.200
ADGUARD_USER=adminar
ADGUARD_PASS=your-password
# Flask
DEBUG=False
PORT=5001
HOST=0.0.0.0
🎨 Usage
Web Interface
Access at: http://localhost:5001 or https://manager.local.rebermann.de
Main Pages:
/- Service overview with live status/add-service- Add new service (Simple or Traefik mode)/traefik- View Traefik services with router details
Adding a Service
Simple Mode:
- Service name (e.g.,
jellyfin) - Backend URL (e.g.,
http://192.168.10.47:8096)
Traefik Mode:
- Service name
- Domain (e.g.,
jellyfin.local.rebermann.de) - Backend URL
- Entry points (websecure/web)
- TLS enabled/disabled
- Middlewares (optional)
- Health check (optional)
API Endpoints
Services:
GET /api/services- List all servicesPOST /api/services- Create servicePUT /api/services/<name>- Update serviceDELETE /api/services/<name>- Delete serviceGET /api/services/status- Get all service statuses
Traefik:
GET /api/traefik/services- Get Traefik servicesPOST /api/traefik/service- Add service to TraefikDELETE /api/traefik/service/<name>- Remove from TraefikPOST /api/traefik/sync- Sync Traefik → services.yml
AdGuard:
GET /api/adguard/rewrites- Get DNS rewritesPOST /api/adguard/sync- Sync DNS entries to AdGuard
🏗️ Architecture
Service Manager (Flask)
├── Traefik Integration
│ ├── traefik_parser.py - Read dynamic.yml
│ └── traefik_writer.py - Write dynamic.yml
├── AdGuard Integration
│ └── adguard_sync.py - DNS rewrite management
├── Frontend (Templates)
│ ├── index.html - Service overview
│ ├── add_service.html - Add service form
│ └── traefik.html - Traefik view
└── Static Assets
├── css/style.css - Dark theme
└── js/app.js - Toast notifications
📦 Deployment
Systemd Service
# Service status
systemctl status service-manager
# View logs
journalctl -u service-manager -f
# Restart
systemctl restart service-manager
Update Deployment
cd /opt/service-manager
git pull
systemctl restart service-manager
🔧 Development
Requirements
- Flask 3.0.3
- PyYAML 6.0.1
- requests 2.31.0
- python-dotenv 1.0.1
Project Structure
service-manager/
├── app.py # Main Flask application
├── traefik_parser.py # Traefik config reader
├── traefik_writer.py # Traefik config writer
├── adguard_sync.py # AdGuard DNS integration
├── config/
│ └── config.py # Configuration
├── templates/ # HTML templates
├── static/ # CSS/JS assets
├── scripts/ # Helper scripts
├── deploy.sh # Deployment script
└── service-manager.service # Systemd unit file
📚 Documentation
- ROADMAP.md - Development roadmap
- SESSION_SUMMARY.md - Development session notes
- scripts/README.md - Script documentation
🤝 Contributing
This is a personal homelab project. Feel free to fork and adapt for your own use.
📝 License
MIT License - See LICENSE file for details
🎉 Credits
Built with Claude Code
Developed for Proxmox + Traefik + AdGuard homelab setup