Skip to content

Commit 8946f68

Browse files
authored
Merge pull request #1351 from Dokploy/feat/better-auth-2
Feat/Organizations & Better auth
2 parents 0a6382a + 5fb2866 commit 8946f68

File tree

356 files changed

+13381
-4591
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

356 files changed

+13381
-4591
lines changed

.github/workflows/dokploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Dokploy Docker Build
22

33
on:
44
push:
5-
branches: [main, canary, "feat/monitoring"]
5+
branches: [main, canary, "feat/better-auth-2"]
66

77
env:
88
IMAGE_NAME: dokploy/dokploy

apps/api/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ app.use(async (c, next) => {
2828

2929
app.post("/deploy", zValidator("json", deployJobSchema), (c) => {
3030
const data = c.req.valid("json");
31-
const res = queue.add(data, { groupName: data.serverId });
31+
queue.add(data, { groupName: data.serverId });
3232
return c.json(
3333
{
3434
message: "Deployment Added",

apps/api/src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export const deploy = async (job: DeployJob) => {
6464
}
6565
}
6666
}
67-
} catch (error) {
67+
} catch (_) {
6868
if (job.applicationType === "application") {
6969
await updateApplicationStatus(job.applicationId, "error");
7070
} else if (job.applicationType === "compose") {

apps/dokploy/__test__/compose/config/config.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { generateRandomHash } from "@dokploy/server";
2-
import { addSuffixToAllConfigs, addSuffixToConfigsRoot } from "@dokploy/server";
2+
import { addSuffixToAllConfigs } from "@dokploy/server";
33
import type { ComposeSpecification } from "@dokploy/server";
44
import { load } from "js-yaml";
55
import { expect, test } from "vitest";

apps/dokploy/__test__/compose/network/network-root.test.ts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -293,29 +293,6 @@ networks:
293293
dokploy-network:
294294
`;
295295

296-
const expectedComposeFile7 = `
297-
version: "3.8"
298-
299-
services:
300-
web:
301-
image: nginx:latest
302-
networks:
303-
- dokploy-network
304-
305-
networks:
306-
dokploy-network:
307-
driver: bridge
308-
driver_opts:
309-
com.docker.network.driver.mtu: 1200
310-
311-
backend:
312-
driver: bridge
313-
attachable: true
314-
315-
external_network:
316-
external: true
317-
name: dokploy-network
318-
`;
319296
test("It shoudn't add suffix to dokploy-network", () => {
320297
const composeData = load(composeFile7) as ComposeSpecification;
321298

apps/dokploy/__test__/compose/secrets/secret-root.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { generateRandomHash } from "@dokploy/server";
22
import { addSuffixToSecretsRoot } from "@dokploy/server";
33
import type { ComposeSpecification } from "@dokploy/server";
4-
import { dump, load } from "js-yaml";
4+
import { load } from "js-yaml";
55
import { expect, test } from "vitest";
66

77
test("Generate random hash with 8 characters", () => {

apps/dokploy/__test__/compose/volume/volume.test.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
import { generateRandomHash } from "@dokploy/server";
2-
import {
3-
addSuffixToAllVolumes,
4-
addSuffixToVolumesInServices,
5-
} from "@dokploy/server";
1+
import { addSuffixToAllVolumes } from "@dokploy/server";
62
import type { ComposeSpecification } from "@dokploy/server";
73
import { load } from "js-yaml";
84
import { expect, test } from "vitest";

apps/dokploy/__test__/drop/drop.test.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const baseApp: ApplicationNested = {
4545
previewWildcard: "",
4646
project: {
4747
env: "",
48-
adminId: "",
48+
organizationId: "",
4949
name: "",
5050
description: "",
5151
createdAt: "",

apps/dokploy/__test__/traefik/server/update-server-config.test.ts

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ vi.mock("node:fs", () => ({
55
default: fs,
66
}));
77

8-
import type { Admin, FileConfig } from "@dokploy/server";
8+
import type { FileConfig, User } from "@dokploy/server";
99
import {
1010
createDefaultServerTraefikConfig,
1111
loadOrCreateConfig,
1212
updateServerTraefik,
1313
} from "@dokploy/server";
1414
import { beforeEach, expect, test, vi } from "vitest";
1515

16-
const baseAdmin: Admin = {
16+
const baseAdmin: User = {
1717
enablePaidFeatures: false,
1818
metricsConfig: {
1919
containers: {
@@ -40,9 +40,7 @@ const baseAdmin: Admin = {
4040
cleanupCacheApplications: false,
4141
cleanupCacheOnCompose: false,
4242
cleanupCacheOnPreviews: false,
43-
createdAt: "",
44-
authId: "",
45-
adminId: "string",
43+
createdAt: new Date(),
4644
serverIp: null,
4745
certificateType: "none",
4846
host: null,
@@ -53,6 +51,19 @@ const baseAdmin: Admin = {
5351
serversQuantity: 0,
5452
stripeCustomerId: "",
5553
stripeSubscriptionId: "",
54+
banExpires: new Date(),
55+
banned: true,
56+
banReason: "",
57+
email: "",
58+
expirationDate: "",
59+
id: "",
60+
isRegistered: false,
61+
name: "",
62+
createdAt2: new Date().toISOString(),
63+
emailVerified: false,
64+
image: "",
65+
updatedAt: new Date(),
66+
twoFactorEnabled: false,
5667
};
5768

5869
beforeEach(() => {
@@ -103,8 +114,6 @@ test("Should not touch config without host", () => {
103114
});
104115

105116
test("Should remove websecure if https rollback to http", () => {
106-
const originalConfig: FileConfig = loadOrCreateConfig("dokploy");
107-
108117
updateServerTraefik(
109118
{ ...baseAdmin, certificateType: "letsencrypt" },
110119
"example.com",

apps/dokploy/__test__/traefik/traefik.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const baseApp: ApplicationNested = {
2626
previewWildcard: "",
2727
project: {
2828
env: "",
29-
adminId: "",
29+
organizationId: "",
3030
name: "",
3131
description: "",
3232
createdAt: "",

0 commit comments

Comments
 (0)