From b032da798b69d4e6429e04be882af232b747b8de Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Tue, 31 May 2022 12:02:09 +0200 Subject: [PATCH] fix: ftp connection --- src/lib/haproxy/index.ts | 2 +- src/routes/webhooks/traefik/other.json.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/haproxy/index.ts b/src/lib/haproxy/index.ts index b9a8e9581..3f1176432 100644 --- a/src/lib/haproxy/index.ts +++ b/src/lib/haproxy/index.ts @@ -161,7 +161,7 @@ export async function startTraefikTCPProxy( image: 'traefik:v2.6', command: [ `--entrypoints.tcp.address=:${publicPort}`, - `--providers.http.endpoint=${otherTraefikEndpoint}?id=${id}&privatePort=${privatePort}&publicPort=${publicPort}&type=tcp`, + `--providers.http.endpoint=${otherTraefikEndpoint}?id=${id}&privatePort=${privatePort}&publicPort=${publicPort}&type=tcp&address=${dependentId}`, '--providers.http.pollTimeout=2s', '--log.level=error' ], diff --git a/src/routes/webhooks/traefik/other.json.ts b/src/routes/webhooks/traefik/other.json.ts index a1c357878..3dc4d0e59 100644 --- a/src/routes/webhooks/traefik/other.json.ts +++ b/src/routes/webhooks/traefik/other.json.ts @@ -9,6 +9,7 @@ export const get: RequestHandler = async (event) => { const privatePort = event.url.searchParams.get('privatePort'); const publicPort = event.url.searchParams.get('publicPort'); const type = event.url.searchParams.get('type'); + const address = event.url.searchParams.get('address') || id; let traefik = {}; if (publicPort && type && privatePort) { if (type === 'tcp') { @@ -24,7 +25,7 @@ export const get: RequestHandler = async (event) => { services: { [id]: { loadbalancer: { - servers: [{ address: `${id}:${privatePort}` }] + servers: [{ address: `${address}:${privatePort}` }] } } }