A simple, fast, and elegant dashboard for visualizing Traefik routes in real-time.
- Real-time Route Monitoring: Automatically fetches and displays Traefik routes.
- Modern UI: A clean, responsive, and customizable user interface.
- Glassmorphism Design: A beautiful, modern, and elegant "glassy" look.
- Dynamic Icons: Automatically fetches icons for your services.
- Customizable Refresh Interval: Configure how often routes are updated.
- Theme Support: Light, Dark, and Dynamic (system preference) themes.
- Icon Customization: Use regex patterns to assign custom icons to routes.
- Clickable Route Cards: Jump straight to any route via the route tile shortcut.
- Route Search: Filter routes instantly by name, service, or rule.
- Docker-Based: Easy deployment with Docker and Docker Compose.
- Lightweight & Fast: Minimal resource usage, fast loading times.
- YAML Configuration: Simple YAML configuration for all customizations.
- Docker and Docker Compose installed.
- Traefik running with the API enabled.
-
Clone the repository:
git clone https://github.com/karam-ajaj/TraefikLens.git cd TraefikLens -
Configure the dashboard:
Create a
configuration.ymlfile by copying theconfiguration.example.yml:cp configuration.example.yml configuration.yml
Edit
configuration.ymlto match your Traefik setup:traefik: api_url: "http://traefik:8080/api" refresh_interval: 5
-
Run with Docker Compose:
docker-compose up -d
-
Access the dashboard:
Open your browser and navigate to http://localhost:8000 (or the port you configured).
All configuration is managed through the configuration.yml file. Here is a comprehensive example:
version: 2.0
traefik:
api_url: "http://traefik:8080/api" # Your Traefik API URL
refresh_interval: 3600 # In seconds
timeout: 5
dashboard:
title: "TraefikLens Dashboard"
default_theme: "dynamic" # Can be "light", "dark", or "dynamic"
icons:
default_icon: "mdi:web"
dynamic:
enabled: true
base_url: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/"
extension: ".svg"
slug_strategy: "service"
rules:
- pattern: ".*api.*"
icon: "mdi:api"
- pattern: ".*dashboard.*"
icon: "mdi:monitor-dashboard"
- pattern: ".*admin.*"
icon: "mdi:shield-account"
categories:
label_key: "traefiklens.category"
additional_keys:
- "traefiklens_category"
rules:
- pattern: "media"
category: "Media"
- pattern: "^auth-.*"
category: "Security"
services:
exclude:
- "-https@" # Exclude routes with names ending in "-https@"
overrides:
- service: "my-service@docker"
display_name: "My Awesome Service"
icon: "mdi:rocket"
manual:
- name: "My Manual Service"
url: "https://example.com"
icon: "mdi:web"
category: "External"
labels:
- "traefiklens.category=media" # Only show services with this label
display:
strip_provider_suffix: true
strip_suffixes:
- "-http"
- "-https"
- "-tcp"See configuration.example.yml for all available options.
You can exclude services, override their display names and icons, and even add manual services that are not in Traefik.
services:
exclude:
- ".*-https" # Exclude routes ending with -https
overrides:
- service: "my-service@docker"
display_name: "My Awesome Service"
icon: "mdi:rocket"
manual:
- name: "My Manual Service"
url: "https://example.com"
icon: "mdi:web"
category: "External"Group services into categories by defining rules in your configuration.yml. The first rule that matches a service's name will be used.
categories:
rules:
- pattern: "media"
category: "Media"
- pattern: "^auth-.*"
category: "Security"You can also still use Traefik labels or overrides to categorize services.
# In your docker-compose.yml for a service
labels:
- "traefiklens.category=My Category"Customize icons for your services using regex patterns.
icons:
rules:
- pattern: ".*-api"
icon: "mdi:api"To run the application in development mode:
-
Install the Python dependencies:
pip install -r requirements.txt
-
Run the Flask application:
python app.py
The application will be available at http://localhost:8000.
Contributions are welcome! Please feel free to submit a pull request or open an issue.
