# On Demand Remote Services with Authelia, Sablier & Traefik ## 4 Step Process 1. Add route & service in Traefik external hosts file 2. Add middleware in Sablier config file (sablier.yml) 3. Add labels to compose files on Remote Host 4. Restart services ## Required Information ```bash - the hostname of the remote server - the application/container name - the base url for your proxy host (my-subdomain.duckdns.org) - the ip address of the remote server - the external port exposed by the service - how it will appear on the now loading page - use for a single service, or something descriptive for the group of services that will start together. ``` ## Step 1: Add route & service in Traefik external hosts file ### In /opt/stacks/core/traefik/dynamic/external-host-server_name.yml ```yaml http: routers: # Add a section under routers for each Route (Proxy Host) -: rule: "Host(`.`)" entryPoints: - websecure service: - tls: certResolver: letsencrypt middlewares: - sablier--@file - authelia@docker # comment this line to disable SSO login # next route goes here # All Routes go above this line # Services section defines each service used above services: -: loadBalancer: servers: - url: "http://:" passHostHeader: true # next service goes here ``` ## Step 2: Add middlware to sablier config file ### In /opt/stacks/core/traefik/dynamic/sablier.yml ```yaml http: middlwares: # Add a section under middlewares for each Route (Proxy Host) sablier--: plugin: sablier: sablierUrl: http://sablier-service:10000 group: - sessionDuration: 2m # Increase this for convience ignoreUserAgent: curl # Don't wake the service for a curl command dynamic: displayName: theme: ghost # This can be changed show-details-by-default: true # May want to disable for production # Next middleware goes here ``` ## Step 3: Add labels to compose files on Remote Host ## On the Remote Server ### Apply lables to the services in the compose files ```yaml labels: - sablier.enable=true - sablier.group=- - sablier.start-on-demand=true ``` >**Note**: Traefik & Authelia labels are not used in the compose file for Remote Hosts ## Step 4: Restart services ### On host system ```bash docker restart traefik docker restart sablier-service ``` ### On the Remote Host ```bash cd /opt/stacks/ docker compose down && docker compose up -d docker stop ``` ## Setup Complete Access your service by the proxy url.