mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
Merge branch 'Dokploy:canary' into feature/gpu-support-blender-template
This commit is contained in:
commit
c5c3ca39cd
@ -26,7 +26,6 @@ describe("createDomainLabels", () => {
|
|||||||
"traefik.http.routers.test-app-1-web.entrypoints=web",
|
"traefik.http.routers.test-app-1-web.entrypoints=web",
|
||||||
"traefik.http.services.test-app-1-web.loadbalancer.server.port=8080",
|
"traefik.http.services.test-app-1-web.loadbalancer.server.port=8080",
|
||||||
"traefik.http.routers.test-app-1-web.service=test-app-1-web",
|
"traefik.http.routers.test-app-1-web.service=test-app-1-web",
|
||||||
"traefik.http.routers.test-app-1-web.rule=PathPrefix(`/`)",
|
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -37,21 +36,21 @@ describe("createDomainLabels", () => {
|
|||||||
"traefik.http.routers.test-app-1-websecure.entrypoints=websecure",
|
"traefik.http.routers.test-app-1-websecure.entrypoints=websecure",
|
||||||
"traefik.http.services.test-app-1-websecure.loadbalancer.server.port=8080",
|
"traefik.http.services.test-app-1-websecure.loadbalancer.server.port=8080",
|
||||||
"traefik.http.routers.test-app-1-websecure.service=test-app-1-websecure",
|
"traefik.http.routers.test-app-1-websecure.service=test-app-1-websecure",
|
||||||
"traefik.http.routers.test-app-1-websecure.rule=PathPrefix(`/`)",
|
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("shouldn't add the path prefix if is empty", async () => {
|
it("should add the path prefix if is different than / empty", async () => {
|
||||||
const labels = await createDomainLabels(
|
const labels = await createDomainLabels(
|
||||||
appName,
|
appName,
|
||||||
{
|
{
|
||||||
...baseDomain,
|
...baseDomain,
|
||||||
path: "",
|
path: "/hello",
|
||||||
},
|
},
|
||||||
"websecure",
|
"websecure",
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(labels).toEqual([
|
expect(labels).toEqual([
|
||||||
"traefik.http.routers.test-app-1-websecure.rule=Host(`example.com`)",
|
"traefik.http.routers.test-app-1-websecure.rule=Host(`example.com`) && PathPrefix(`/hello`)",
|
||||||
"traefik.http.routers.test-app-1-websecure.entrypoints=websecure",
|
"traefik.http.routers.test-app-1-websecure.entrypoints=websecure",
|
||||||
"traefik.http.services.test-app-1-websecure.loadbalancer.server.port=8080",
|
"traefik.http.services.test-app-1-websecure.loadbalancer.server.port=8080",
|
||||||
"traefik.http.routers.test-app-1-websecure.service=test-app-1-websecure",
|
"traefik.http.routers.test-app-1-websecure.service=test-app-1-websecure",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "dokploy",
|
"name": "dokploy",
|
||||||
"version": "v0.11.0",
|
"version": "v0.11.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
@ -259,21 +259,15 @@ export const createDomainLabels = async (
|
|||||||
domain: Domain,
|
domain: Domain,
|
||||||
entrypoint: "web" | "websecure",
|
entrypoint: "web" | "websecure",
|
||||||
) => {
|
) => {
|
||||||
const { host, port, https, uniqueConfigKey, certificateType } = domain;
|
const { host, port, https, uniqueConfigKey, certificateType, path } = domain;
|
||||||
const routerName = `${appName}-${uniqueConfigKey}-${entrypoint}`;
|
const routerName = `${appName}-${uniqueConfigKey}-${entrypoint}`;
|
||||||
const labels = [
|
const labels = [
|
||||||
`traefik.http.routers.${routerName}.rule=Host(\`${host}\`)`,
|
`traefik.http.routers.${routerName}.rule=Host(\`${host}\`)${path && path !== "/" ? ` && PathPrefix(\`${path}\`)` : ""}`,
|
||||||
`traefik.http.routers.${routerName}.entrypoints=${entrypoint}`,
|
`traefik.http.routers.${routerName}.entrypoints=${entrypoint}`,
|
||||||
`traefik.http.services.${routerName}.loadbalancer.server.port=${port}`,
|
`traefik.http.services.${routerName}.loadbalancer.server.port=${port}`,
|
||||||
`traefik.http.routers.${routerName}.service=${routerName}`,
|
`traefik.http.routers.${routerName}.service=${routerName}`,
|
||||||
];
|
];
|
||||||
|
|
||||||
if (domain.path) {
|
|
||||||
labels.push(
|
|
||||||
`traefik.http.routers.${routerName}.rule=PathPrefix(\`${domain.path}\`)`,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (entrypoint === "web" && https) {
|
if (entrypoint === "web" && https) {
|
||||||
labels.push(
|
labels.push(
|
||||||
`traefik.http.routers.${routerName}.middlewares=redirect-to-https@file`,
|
`traefik.http.routers.${routerName}.middlewares=redirect-to-https@file`,
|
||||||
|
Loading…
Reference in New Issue
Block a user