feat: route paths to non-web processes via proxy:route
Adds proxy:route:set/remove/clear/report so users can declare path-prefix routes to non-web Procfile processes without hand-writing nginx.conf.sigil. Routes are stored on the proxy plugin as a PropertyMap of path to process:port:strip, with set semantics so each invocation produces a fully-determined state and re-application is idempotent. A proxy-supports-routes capability trigger gates the command per backend - nginx-vhosts, traefik-vhosts, caddy-vhosts, and scheduler-k3s render routes today; openresty-vhosts and haproxy-vhosts refuse until their sidecar images learn a path-prefix vocabulary (tracked in dokku/openresty-docker-proxy#137 and the haproxy sidecar). Closes #8725.
This commit is contained in:
29 files changed
+1539
-7
No files matched your search
@@ -14,11 +14,27 @@ trigger-caddy-vhosts-docker-args-process-deploy() {
|
||||
local proxy_container_https_port proxy_container_https_port_candidate proxy_host_https_port_candidate
|
||||
local STDIN=$(cat)
|
||||
|
||||
if [[ "$PROC_TYPE" != "web" ]]; then
|
||||
if [[ "$(plugn trigger proxy-type "$APP")" != "caddy" ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
if [[ "$(plugn trigger proxy-type "$APP")" != "caddy" ]]; then
|
||||
if [[ "$PROC_TYPE" != "web" ]]; then
|
||||
# Non-web processes are only labeled when at least one path-based route
|
||||
# targets the process. Otherwise caddy-docker-proxy should ignore the
|
||||
# container entirely.
|
||||
local route_proc
|
||||
local has_route=false
|
||||
while IFS='|' read -r route_proc _ _ _; do
|
||||
if [[ "$route_proc" == "$PROC_TYPE" ]]; then
|
||||
has_route=true
|
||||
break
|
||||
fi
|
||||
done < <(plugn trigger proxy-routes-list "$APP")
|
||||
if [[ "$has_route" != "true" ]]; then
|
||||
echo -n "$STDIN"
|
||||
return
|
||||
fi
|
||||
fn-caddy-route-labels "$APP" "$PROC_TYPE" "$STDIN"
|
||||
return
|
||||
fi
|
||||
|
||||
|
||||
Reference in new issue
Block a user