middleware-manager
Middleware Manager is a microservice that seamlessly integrates with your existing Pangolin.
100K+
Before installing the Middleware Manager, ensure you have the following:
The simplest way to deploy the Middleware Manager is by adding it to your existing Pangolin docker-compose.yml file:
middleware-manager:
image: hhftechnology/middleware-manager:latest
container_name: middleware-manager
restart: unless-stopped
volumes:
- ./data:/data # For database persistence
- ./config/traefik/rules:/conf # Where Traefik config will be written
- ./config/middleware-manager/templates.yaml:/app/config/templates.yaml # Optional for custom templates
environment:
- PANGOLIN_API_URL=http://pangolin:3001/api/v1 # URL to your Pangolin API
- TRAEFIK_CONF_DIR=/conf # Directory to write Traefik configurations
- DB_PATH=/data/middleware.db # Path to SQLite database
- PORT=3456 # Port for web UI and API
ports:
- "3456:3456"
networks:
- pangolin # Must be on same network as Pangolin
After adding this configuration to your docker-compose.yml file, run:
docker compose up -d middleware-manager
For development or custom deployment scenarios, you can also install the Middleware Manager manually:
Clone the repository:
git clone https://github.com/hhftechnology/middleware-manager.git
cd middleware-manager
Configure environment:
cp .env.example .env
# Edit .env with your specific configuration
Build and start the service:
make build
./middleware-manager
Note that manual installation requires Go 1.19+ and Node.js 16+ for building the application.
The Middleware Manager can be configured using the following environment variables:
| Variable | Description | Default |
|---|---|---|
PANGOLIN_API_URL | URL to your Pangolin API | http://pangolin:3001/api/v1 |
TRAEFIK_CONF_DIR | Directory to write Traefik configurations | /conf |
DB_PATH | Path to SQLite database | /data/middleware.db |
PORT | Port for web UI and API | 3456 |
CHECK_INTERVAL_SECONDS | How often to check for new resources (seconds) | 30 |
GENERATE_INTERVAL_SECONDS | How often to update configuration files (seconds) | 10 |
DEBUG | Enable debug logging | false |
ALLOW_CORS | Enable CORS for API | false |
CORS_ORIGIN | Allowed CORS origin | "" (all) |
You can create custom middleware templates by mounting a templates.yaml file to the container. This file defines default middlewares that will be available in your installation:
# Example templates.yaml
middlewares:
- id: "security-headers"
name: "Strong Security Headers"
type: "headers"
config:
customResponseHeaders:
Server: ""
X-Powered-By: ""
browserXSSFilter: true
contentTypeNosniff: true
customFrameOptionsValue: "SAMEORIGIN"
forceSTSHeader: true
stsIncludeSubdomains: true
stsSeconds: 63072000
- id: "rate-limit"
name: "Standard Rate Limiting"
type: "rateLimit"
config:
average: 100
burst: 50
After installation, follow these steps to verify everything is working correctly:
Access the Web UI:
Open your browser and navigate to http://your-server:3456
You should see the Middleware Manager dashboard.
Check Resource Synchronization: The Middleware Manager should automatically start fetching resources from Pangolin. Navigate to the "Resources" tab to see if your resources are being listed.
Verify Traefik Configuration:
After the service has been running for a minute, check the configured TRAEFIK_CONF_DIR for a file named resource-overrides.yml. This file will contain the Traefik configuration generated by the Middleware Manager.
Test Integration:
If you encounter issues during setup:
docker compose logs middleware-manager
Content type
Image
Digest
sha256:d9fa857c2…
Size
14.1 MB
Last updated
3 months ago
docker pull hhftechnology/middleware-manager:20260421