Skip to content

A modern and easy to use dashboard. 80+ integrations. 20K+ icons built in. Authentication out of the box. No YAML, drag and drop configuration.

fix: empty env variables should be ignored (#2040)

Meier Lukas175927970b25
diff --git a/apps/nextjs/src/env.ts b/apps/nextjs/src/env.ts
index 72d1c3837..91787c8bb 100644
--- a/apps/nextjs/src/env.ts
+++ b/apps/nextjs/src/env.ts
@@ -35,4 +35,5 @@ export const env = createEnv({
// NEXT_PUBLIC_CLIENTVAR: process.env.NEXT_PUBLIC_CLIENTVAR,
},
skipValidation: shouldSkipEnvValidation(),
+ emptyStringAsUndefined: true,
});
diff --git a/e2e/onboarding.spec.ts b/e2e/onboarding.spec.ts
index 061f5e6d8..d2731853a 100644
--- a/e2e/onboarding.spec.ts
+++ b/e2e/onboarding.spec.ts
@@ -49,9 +49,9 @@ describe("Onboarding", () => {
environment: {
AUTH_PROVIDERS: "ldap",
AUTH_LDAP_URI: "ldap://host.docker.internal:3890",
- AUTH_LDAP_BASE: "",
- AUTH_LDAP_BIND_DN: "",
- AUTH_LDAP_BIND_PASSWORD: "",
+ AUTH_LDAP_BASE: "not-used",
+ AUTH_LDAP_BIND_DN: "not-used",
+ AUTH_LDAP_BIND_PASSWORD: "not-used",
},
mounts: {
"/appdata": localMountPath,
diff --git a/packages/auth/env.ts b/packages/auth/env.ts
index 6d9aa3354..5dea7de46 100644
--- a/packages/auth/env.ts
+++ b/packages/auth/env.ts
@@ -86,4 +86,5 @@ export const env = createEnv({
AUTH_OIDC_NAME_ATTRIBUTE_OVERWRITE: process.env.AUTH_OIDC_NAME_ATTRIBUTE_OVERWRITE,
},
skipValidation,
+ emptyStringAsUndefined: true,
});
diff --git a/packages/common/env.ts b/packages/common/env.ts
index fda1b7859..2faeda250 100644
--- a/packages/common/env.ts
+++ b/packages/common/env.ts
@@ -26,4 +26,5 @@ export const env = createEnv({
SECRET_ENCRYPTION_KEY: process.env.SECRET_ENCRYPTION_KEY,
},
skipValidation: shouldSkipEnvValidation(),
+ emptyStringAsUndefined: true,
});
diff --git a/packages/db/env.ts b/packages/db/env.ts
index 4c5ae0319..8e25601ce 100644
--- a/packages/db/env.ts
+++ b/packages/db/env.ts
@@ -27,7 +27,11 @@ export const env = createEnv({
.default(drivers.betterSqlite3),
...(urlRequired
? {
- DB_URL: z.string(),
+ DB_URL:
+ // Fallback to the default sqlite file path in production
+ process.env.NODE_ENV === "production" && isDriver("better-sqlite3")
+ ? z.string().default("/appdata/db/db.sqlite")
+ : z.string().nonempty(),
}
: {}),
...(hostRequired
@@ -58,4 +62,5 @@ export const env = createEnv({
DB_PORT: process.env.DB_PORT,
},
skipValidation: shouldSkipEnvValidation(),
+ emptyStringAsUndefined: true,
});