diff --git a/apps/api/src/lib/services.ts b/apps/api/src/lib/services.ts index 4b3ebed0b..4838794cc 100644 --- a/apps/api/src/lib/services.ts +++ b/apps/api/src/lib/services.ts @@ -226,16 +226,12 @@ export async function getTemplates() { "ports": [ "80" ], - "proxy": { - "traefik": { - "configurations": [ - { - "domain":"$$config_coolify_fqdn_appwrite", - "port": "80" - } - ] + "proxy": [ + { + "domain": "$$config_coolify_fqdn_appwrite", + "port": "80" } - } + ] }, "$$id-executor": { "image": "appwrite/appwrite:$$core_version", @@ -352,16 +348,12 @@ export async function getTemplates() { ], "volumes": [], "entrypoint": "realtime", - "proxy": { - "traefik": { - "configurations": [ - { - "port": "80", - "pathPrefix": "/v1/realtime" - } - ] + "proxy": [ + { + "port": "80", + "pathPrefix": "/v1/realtime" } - } + ] }, "$$id-redis": { "image": "redis:7.0.4-alpine", diff --git a/apps/api/src/routes/api/v1/services/handlers.ts b/apps/api/src/routes/api/v1/services/handlers.ts index 074a255e4..4a08bf080 100644 --- a/apps/api/src/routes/api/v1/services/handlers.ts +++ b/apps/api/src/routes/api/v1/services/handlers.ts @@ -137,7 +137,7 @@ export async function parseAndFindServiceTemplates(service: any, workdir?: strin const extras = variable?.extras if (envValue.startsWith('$$config') || extras?.isVisibleOnUI) { if (envValue.startsWith('$$config_coolify')) { - console.log({envValue,envKey}) + console.log({ envValue, envKey }) } parsedTemplate[realKey].environment.push( { name: envKey, value: envValue, label, description, defaultValue, extras } @@ -146,13 +146,13 @@ export async function parseAndFindServiceTemplates(service: any, workdir?: strin } } // TODO: seconday domains are not working - kinda working - if (value?.proxy?.traefik?.configurations) { - for (const proxyValue of value.proxy.traefik.configurations) { + if (value?.proxy && value.proxy.length > 0) { + for (const proxyValue of value.proxy) { if (proxyValue.domain) { - const variable = foundTemplate.variables.find(v => v.id === proxyValue.domain) + const variable = foundTemplate.variables.find(v => v.id === proxyValue.domain) if (variable) { - const { name, label, description, defaultValue, extras } = variable - const found = await prisma.serviceSetting.findFirst({where: {variableName: proxyValue.domain}}) + const { name, label, description, defaultValue, extras } = variable + const found = await prisma.serviceSetting.findFirst({ where: { variableName: proxyValue.domain } }) parsedTemplate[realKey].environment.push( { name, value: found.value || '', label, description, defaultValue, extras } ) diff --git a/apps/api/src/routes/webhooks/traefik/handlers.ts b/apps/api/src/routes/webhooks/traefik/handlers.ts index b886de241..9d4267ce4 100644 --- a/apps/api/src/routes/webhooks/traefik/handlers.ts +++ b/apps/api/src/routes/webhooks/traefik/handlers.ts @@ -384,8 +384,8 @@ export async function traefikConfiguration(request, reply) { for (const oneService of Object.keys(found.services)) { const isProxyConfiguration = found.services[oneService].proxy; if (isProxyConfiguration) { - const { proxy: { traefik: { configurations } } } = found.services[oneService]; - for (const configuration of configurations) { + const { proxy } = found.services[oneService]; + for (const configuration of proxy) { const publicPort = service[type]?.publicPort; if (fqdn) { data.services.push({