"Automated Service Provisioning for Traefik + AdGuard + Homepage"
  • Python 42.4%
  • HTML 30.9%
  • Shell 13.4%
  • CSS 12.2%
  • JavaScript 1.1%
Find a file
Axel Rebermann a54598ff9f Enrich services with domain from Traefik routers
- 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>
2025-10-04 15:13:14 +02:00
config Phase 3 Complete: Full Service Provisioning Workflow 2025-10-02 21:49:43 +02:00
scripts Phase 3 Complete: Full Service Provisioning Workflow 2025-10-02 21:49:43 +02:00
static Fix: 404 redirect bug and add compact widget for Homepage 2025-10-02 23:01:47 +02:00
templates Add comprehensive logging system 2025-10-04 15:11:43 +02:00
.env.example Final: Fix config and add comprehensive documentation 2025-10-02 22:57:21 +02:00
.gitignore Phase 1 Complete: Core Service Manager Features 2025-10-02 20:54:11 +02:00
adguard_sync.py Fix: Disable SSL warnings for AdGuard HTTPS connection 2025-10-02 22:29:08 +02:00
app.py Enrich services with domain from Traefik routers 2025-10-04 15:13:14 +02:00
deploy.sh Final: Fix config and add comprehensive documentation 2025-10-02 22:57:21 +02:00
dynamic.yml Phase 2 Complete: Traefik Integration 2025-10-02 21:24:43 +02:00
README.md Final: Fix config and add comprehensive documentation 2025-10-02 22:57:21 +02:00
requirements.txt Phase 1 Complete: Core Service Manager Features 2025-10-02 20:54:11 +02:00
ROADMAP.md Phase 1 Complete: Core Service Manager Features 2025-10-02 20:54:11 +02:00
service-manager.service Add deployment script and systemd service file 2025-10-02 22:06:52 +02:00
services.yml Phase 2 Complete: Traefik Integration 2025-10-02 21:24:43 +02:00
SESSION_SUMMARY.md Phase 1 Complete: Core Service Manager Features 2025-10-02 20:54:11 +02:00
traefik_parser.py Phase 2 Complete: Traefik Integration 2025-10-02 21:24:43 +02:00
traefik_writer.py Phase 3 Complete: Full Service Provisioning Workflow 2025-10-02 21:49:43 +02:00

🚀 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

  1. Add Service via UI → Service name, domain, backend URL
  2. Automatic Traefik Config → Router + Service written to dynamic.yml
  3. Traefik Auto-Reload → File Provider detects changes
  4. DNS Entry Created → AdGuard DNS rewrite added automatically
  5. 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

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:

  1. Service name (e.g., jellyfin)
  2. Backend URL (e.g., http://192.168.10.47:8096)

Traefik Mode:

  1. Service name
  2. Domain (e.g., jellyfin.local.rebermann.de)
  3. Backend URL
  4. Entry points (websecure/web)
  5. TLS enabled/disabled
  6. Middlewares (optional)
  7. Health check (optional)

API Endpoints

Services:

  • GET /api/services - List all services
  • POST /api/services - Create service
  • PUT /api/services/<name> - Update service
  • DELETE /api/services/<name> - Delete service
  • GET /api/services/status - Get all service statuses

Traefik:

  • GET /api/traefik/services - Get Traefik services
  • POST /api/traefik/service - Add service to Traefik
  • DELETE /api/traefik/service/<name> - Remove from Traefik
  • POST /api/traefik/sync - Sync Traefik → services.yml

AdGuard:

  • GET /api/adguard/rewrites - Get DNS rewrites
  • POST /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

🤝 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