mirror of
https://github.com/ershisan99/coolify.git
synced 2025-12-18 12:33:06 +00:00
fix
This commit is contained in:
@@ -18,7 +18,7 @@ import { scheduler } from './scheduler';
|
|||||||
import type { ExecaChildProcess } from 'execa';
|
import type { ExecaChildProcess } from 'execa';
|
||||||
import { FastifyReply } from 'fastify';
|
import { FastifyReply } from 'fastify';
|
||||||
|
|
||||||
export const version = '3.12.34';
|
export const version = '3.12.35';
|
||||||
export const isDev = process.env.NODE_ENV === 'development';
|
export const isDev = process.env.NODE_ENV === 'development';
|
||||||
export const proxyPort = process.env.COOLIFY_PROXY_PORT;
|
export const proxyPort = process.env.COOLIFY_PROXY_PORT;
|
||||||
export const proxySecurePort = process.env.COOLIFY_PROXY_SECURE_PORT;
|
export const proxySecurePort = process.env.COOLIFY_PROXY_SECURE_PORT;
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ function generateServices(serviceId, containerId, port, isHttp2 = false, isHttps
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
async function generateRouters(
|
async function generateRouters({
|
||||||
serviceId,
|
serviceId,
|
||||||
domain,
|
domain,
|
||||||
nakedDomain,
|
nakedDomain,
|
||||||
@@ -50,9 +50,8 @@ async function generateRouters(
|
|||||||
isDualCerts,
|
isDualCerts,
|
||||||
isCustomSSL,
|
isCustomSSL,
|
||||||
isHttp2 = false,
|
isHttp2 = false,
|
||||||
basicAuth = false,
|
httpBasicAuth = null,
|
||||||
httpBasicAuth = null
|
}) {
|
||||||
) {
|
|
||||||
const rule = `Host(\`${nakedDomain}\`)${pathPrefix ? ` && PathPrefix(\`${pathPrefix}\`)` : ''}`;
|
const rule = `Host(\`${nakedDomain}\`)${pathPrefix ? ` && PathPrefix(\`${pathPrefix}\`)` : ''}`;
|
||||||
const ruleWWW = `Host(\`www.${nakedDomain}\`)${pathPrefix ? ` && PathPrefix(\`${pathPrefix}\`)` : ''
|
const ruleWWW = `Host(\`www.${nakedDomain}\`)${pathPrefix ? ` && PathPrefix(\`${pathPrefix}\`)` : ''
|
||||||
}`;
|
}`;
|
||||||
@@ -102,7 +101,7 @@ async function generateRouters(
|
|||||||
delete https.tls;
|
delete https.tls;
|
||||||
delete httpsWWW.tls;
|
delete httpsWWW.tls;
|
||||||
|
|
||||||
if (basicAuth) {
|
if (httpBasicAuth) {
|
||||||
http.middlewares.push(`${serviceId}-${pathPrefix}-basic-auth`);
|
http.middlewares.push(`${serviceId}-${pathPrefix}-basic-auth`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -117,7 +116,7 @@ async function generateRouters(
|
|||||||
delete https.tls;
|
delete https.tls;
|
||||||
delete httpsWWW.tls;
|
delete httpsWWW.tls;
|
||||||
|
|
||||||
if (basicAuth) {
|
if (httpBasicAuth) {
|
||||||
httpWWW.middlewares.push(`${serviceId}-${pathPrefix}-basic-auth`);
|
httpWWW.middlewares.push(`${serviceId}-${pathPrefix}-basic-auth`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -149,7 +148,7 @@ async function generateRouters(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (basicAuth) {
|
if (httpBasicAuth) {
|
||||||
https.middlewares.push(`${serviceId}-${pathPrefix}-basic-auth`);
|
https.middlewares.push(`${serviceId}-${pathPrefix}-basic-auth`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -162,7 +161,7 @@ async function generateRouters(
|
|||||||
https.middlewares.push('redirect-to-www');
|
https.middlewares.push('redirect-to-www');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (basicAuth) {
|
if (httpBasicAuth) {
|
||||||
httpsWWW.middlewares.push(`${serviceId}-${pathPrefix}-basic-auth`);
|
httpsWWW.middlewares.push(`${serviceId}-${pathPrefix}-basic-auth`);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -408,11 +407,16 @@ export async function proxyConfiguration(request: FastifyRequest<OnlyId>, remote
|
|||||||
) {
|
) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const httpBasicAuth: any = {
|
let httpBasicAuth = null;
|
||||||
basicAuth: {
|
if (basicAuthUser && basicAuthPw) {
|
||||||
users: [basicAuthUser + ':' + await hashPassword(basicAuthPw, 1)]
|
httpBasicAuth = {
|
||||||
}
|
basicAuth: {
|
||||||
};
|
users: [basicAuthUser + ':' + await hashPassword(basicAuthPw, 1)]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
console.log({ httpBasicAuth })
|
||||||
|
|
||||||
|
|
||||||
if (buildPack === 'compose') {
|
if (buildPack === 'compose') {
|
||||||
const services = Object.entries(JSON.parse(dockerComposeConfiguration));
|
const services = Object.entries(JSON.parse(dockerComposeConfiguration));
|
||||||
@@ -436,23 +440,23 @@ export async function proxyConfiguration(request: FastifyRequest<OnlyId>, remote
|
|||||||
|
|
||||||
traefik.http.routers = {
|
traefik.http.routers = {
|
||||||
...traefik.http.routers,
|
...traefik.http.routers,
|
||||||
...await generateRouters(
|
...await generateRouters({
|
||||||
serviceId,
|
serviceId,
|
||||||
domain,
|
domain,
|
||||||
nakedDomain,
|
nakedDomain,
|
||||||
pathPrefix,
|
pathPrefix,
|
||||||
isHttps,
|
isHttps,
|
||||||
isWWW,
|
isWWW,
|
||||||
dualCerts,
|
isDualCerts: dualCerts,
|
||||||
isCustomSSL,
|
isCustomSSL,
|
||||||
httpBasicAuth
|
httpBasicAuth
|
||||||
)
|
})
|
||||||
};
|
};
|
||||||
traefik.http.services = {
|
traefik.http.services = {
|
||||||
...traefik.http.services,
|
...traefik.http.services,
|
||||||
...generateServices(serviceId, containerId, port)
|
...generateServices(serviceId, containerId, port)
|
||||||
};
|
};
|
||||||
if (application.settings.basicAuth) {
|
if (httpBasicAuth) {
|
||||||
traefik.http.middlewares[`${serviceId}-${pathPrefix}-basic-auth`] = {
|
traefik.http.middlewares[`${serviceId}-${pathPrefix}-basic-auth`] = {
|
||||||
...httpBasicAuth
|
...httpBasicAuth
|
||||||
};
|
};
|
||||||
@@ -475,25 +479,24 @@ export async function proxyConfiguration(request: FastifyRequest<OnlyId>, remote
|
|||||||
const serviceId = `${id}-${port || 'default'}`;
|
const serviceId = `${id}-${port || 'default'}`;
|
||||||
traefik.http.routers = {
|
traefik.http.routers = {
|
||||||
...traefik.http.routers,
|
...traefik.http.routers,
|
||||||
...await generateRouters(
|
...await generateRouters({
|
||||||
serviceId,
|
serviceId,
|
||||||
domain,
|
domain,
|
||||||
nakedDomain,
|
nakedDomain,
|
||||||
pathPrefix,
|
pathPrefix,
|
||||||
isHttps,
|
isHttps,
|
||||||
isWWW,
|
isWWW,
|
||||||
dualCerts,
|
isDualCerts: dualCerts,
|
||||||
isCustomSSL,
|
isCustomSSL,
|
||||||
isHttp2,
|
isHttp2,
|
||||||
basicAuth,
|
|
||||||
httpBasicAuth
|
httpBasicAuth
|
||||||
)
|
})
|
||||||
};
|
};
|
||||||
traefik.http.services = {
|
traefik.http.services = {
|
||||||
...traefik.http.services,
|
...traefik.http.services,
|
||||||
...generateServices(serviceId, id, port, isHttp2, isHttps)
|
...generateServices(serviceId, id, port, isHttp2, isHttps)
|
||||||
};
|
};
|
||||||
if (application.settings.basicAuth) {
|
if (httpBasicAuth) {
|
||||||
traefik.http.middlewares[`${serviceId}-${pathPrefix}-basic-auth`] = {
|
traefik.http.middlewares[`${serviceId}-${pathPrefix}-basic-auth`] = {
|
||||||
...httpBasicAuth
|
...httpBasicAuth
|
||||||
};
|
};
|
||||||
@@ -518,25 +521,24 @@ export async function proxyConfiguration(request: FastifyRequest<OnlyId>, remote
|
|||||||
const serviceId = `${container}-${port || 'default'}`;
|
const serviceId = `${container}-${port || 'default'}`;
|
||||||
traefik.http.routers = {
|
traefik.http.routers = {
|
||||||
...traefik.http.routers,
|
...traefik.http.routers,
|
||||||
...await generateRouters(
|
...await generateRouters({
|
||||||
serviceId,
|
serviceId,
|
||||||
previewDomain,
|
domain: previewDomain,
|
||||||
nakedDomain,
|
nakedDomain,
|
||||||
pathPrefix,
|
pathPrefix,
|
||||||
isHttps,
|
isHttps,
|
||||||
isWWW,
|
isWWW,
|
||||||
dualCerts,
|
isDualCerts: dualCerts,
|
||||||
isCustomSSL,
|
isCustomSSL,
|
||||||
false,
|
isHttp2: false,
|
||||||
basicAuth,
|
|
||||||
httpBasicAuth
|
httpBasicAuth
|
||||||
)
|
})
|
||||||
};
|
};
|
||||||
traefik.http.services = {
|
traefik.http.services = {
|
||||||
...traefik.http.services,
|
...traefik.http.services,
|
||||||
...generateServices(serviceId, container, port, isHttp2)
|
...generateServices(serviceId, container, port, isHttp2)
|
||||||
};
|
};
|
||||||
if (application.settings.basicAuth) {
|
if (httpBasicAuth) {
|
||||||
traefik.http.middlewares[`${serviceId}-${pathPrefix}-basic-auth`] = {
|
traefik.http.middlewares[`${serviceId}-${pathPrefix}-basic-auth`] = {
|
||||||
...httpBasicAuth
|
...httpBasicAuth
|
||||||
};
|
};
|
||||||
@@ -634,16 +636,16 @@ export async function proxyConfiguration(request: FastifyRequest<OnlyId>, remote
|
|||||||
const serviceId = `${oneService}-${port || 'default'}`;
|
const serviceId = `${oneService}-${port || 'default'}`;
|
||||||
traefik.http.routers = {
|
traefik.http.routers = {
|
||||||
...traefik.http.routers,
|
...traefik.http.routers,
|
||||||
...await generateRouters(
|
...await generateRouters({
|
||||||
serviceId,
|
serviceId,
|
||||||
domain,
|
domain,
|
||||||
nakedDomain,
|
nakedDomain,
|
||||||
pathPrefix,
|
pathPrefix,
|
||||||
isHttps,
|
isHttps,
|
||||||
isWWW,
|
isWWW,
|
||||||
dualCerts,
|
isDualCerts: dualCerts,
|
||||||
isCustomSSL,
|
isCustomSSL,
|
||||||
)
|
})
|
||||||
};
|
};
|
||||||
traefik.http.services = {
|
traefik.http.services = {
|
||||||
...traefik.http.services,
|
...traefik.http.services,
|
||||||
@@ -671,16 +673,16 @@ export async function proxyConfiguration(request: FastifyRequest<OnlyId>, remote
|
|||||||
const serviceId = `${oneService}-${port || 'default'}`;
|
const serviceId = `${oneService}-${port || 'default'}`;
|
||||||
traefik.http.routers = {
|
traefik.http.routers = {
|
||||||
...traefik.http.routers,
|
...traefik.http.routers,
|
||||||
...await generateRouters(
|
...await generateRouters({
|
||||||
serviceId,
|
serviceId,
|
||||||
domain,
|
domain,
|
||||||
nakedDomain,
|
nakedDomain,
|
||||||
pathPrefix,
|
pathPrefix,
|
||||||
isHttps,
|
isHttps,
|
||||||
isWWW,
|
isWWW,
|
||||||
dualCerts,
|
isDualCerts: dualCerts,
|
||||||
isCustomSSL
|
isCustomSSL
|
||||||
)
|
})
|
||||||
};
|
};
|
||||||
traefik.http.services = {
|
traefik.http.services = {
|
||||||
...traefik.http.services,
|
...traefik.http.services,
|
||||||
@@ -712,16 +714,16 @@ export async function proxyConfiguration(request: FastifyRequest<OnlyId>, remote
|
|||||||
const serviceId = `${id}-${port || 'default'}`;
|
const serviceId = `${id}-${port || 'default'}`;
|
||||||
traefik.http.routers = {
|
traefik.http.routers = {
|
||||||
...traefik.http.routers,
|
...traefik.http.routers,
|
||||||
...await generateRouters(
|
...await generateRouters({
|
||||||
serviceId,
|
serviceId,
|
||||||
domain,
|
domain,
|
||||||
nakedDomain,
|
nakedDomain,
|
||||||
pathPrefix,
|
pathPrefix,
|
||||||
isHttps,
|
isHttps,
|
||||||
isWWW,
|
isWWW,
|
||||||
dualCerts,
|
isDualCerts: dualCerts,
|
||||||
isCustomSSL
|
isCustomSSL
|
||||||
)
|
})
|
||||||
};
|
};
|
||||||
traefik.http.services = {
|
traefik.http.services = {
|
||||||
...traefik.http.services,
|
...traefik.http.services,
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "coolify",
|
"name": "coolify",
|
||||||
"description": "An open-source & self-hostable Heroku / Netlify alternative.",
|
"description": "An open-source & self-hostable Heroku / Netlify alternative.",
|
||||||
"version": "3.12.34",
|
"version": "3.12.35",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"repository": "github:coollabsio/coolify",
|
"repository": "github:coollabsio/coolify",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user