Merge branch 'Dokploy:canary' into feature/gpu-support-blender-template

This commit is contained in:
Vishal kadam 2024-11-07 16:36:50 +05:30 committed by GitHub
commit c765d7d9eb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 44 additions and 24 deletions

BIN
.github/sponsors/mandarin.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -60,12 +60,15 @@ For detailed documentation, visit [docs.dokploy.com](https://docs.dokploy.com).
### Hero Sponsors 🎖
<div style="display: flex; align-items: center; gap: 20px;">
<a href="https://www.hostinger.com/vps-hosting?ref=dokploy" target="_blank" style="display: inline-block;">
<a href="https://www.hostinger.com/vps-hosting?ref=dokploy" target="_blank" style="display: inline-block; margin-right: 10px;">
<img src=".github/sponsors/hostinger.jpg" alt="Hostinger" height="50"/>
</a>
<a href="https://www.lxaer.com/?ref=dokploy" target="_blank" style="display: inline-block;">
<a href="https://www.lxaer.com/?ref=dokploy" target="_blank" style="display: inline-block; margin-right: 10px;">
<img src=".github/sponsors/lxaer.png" alt="LX Aer" height="50"/>
</a>
<a href="https://mandarin3d.com/?ref=dokploy" target="_blank" style="display: inline-block;">
<img src=".github/sponsors/mandarin.png" alt="Mandarin" height="50"/>
</a>
</div>
### Premium Supporters 🥇

View File

@ -26,11 +26,30 @@ describe("createDomainLabels", () => {
"traefik.http.routers.test-app-1-web.entrypoints=web",
"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.rule=PathPrefix(`/`)",
]);
});
it("should create labels for websecure entrypoint", async () => {
const labels = await createDomainLabels(appName, baseDomain, "websecure");
expect(labels).toEqual([
"traefik.http.routers.test-app-1-websecure.rule=Host(`example.com`)",
"traefik.http.routers.test-app-1-websecure.entrypoints=websecure",
"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.rule=PathPrefix(`/`)",
]);
});
it("shouldn't add the path prefix if is empty", async () => {
const labels = await createDomainLabels(
appName,
{
...baseDomain,
path: "",
},
"websecure",
);
expect(labels).toEqual([
"traefik.http.routers.test-app-1-websecure.rule=Host(`example.com`)",
"traefik.http.routers.test-app-1-websecure.entrypoints=websecure",

View File

@ -23,29 +23,27 @@ export const ToggleDockerCleanup = ({ serverId }: Props) => {
const enabled = data?.enableDockerCleanup || server?.enableDockerCleanup;
const { mutateAsync } = api.settings.updateDockerCleanup.useMutation();
const handleToggle = async (checked: boolean) => {
try {
await mutateAsync({
enableDockerCleanup: checked,
serverId: serverId,
});
if (serverId) {
await refetchServer();
} else {
await refetch();
}
toast.success("Docker Cleanup updated");
} catch (error) {
toast.error("Docker Cleanup Error");
}
};
return (
<div className="flex items-center gap-4">
<Switch
checked={enabled}
onCheckedChange={async (e) => {
await mutateAsync({
enableDockerCleanup: e,
serverId: serverId,
})
.then(async () => {
toast.success("Docker Cleanup Enabled");
})
.catch(() => {
toast.error("Docker Cleanup Error");
});
if (serverId) {
refetchServer();
} else {
refetch();
}
}}
/>
<Switch checked={!!enabled} onCheckedChange={handleToggle} />
<Label className="text-primary">Daily Docker Cleanup</Label>
</div>
);

View File

@ -268,7 +268,7 @@ export const createDomainLabels = async (
`traefik.http.routers.${routerName}.service=${routerName}`,
];
if (domain.path && domain.path.length > 0 && domain.path !== "/") {
if (domain.path) {
labels.push(
`traefik.http.routers.${routerName}.rule=PathPrefix(\`${domain.path}\`)`,
);