diff --git a/.env.example b/.env.example index 1e8e28db..816d4813 100644 --- a/.env.example +++ b/.env.example @@ -14,12 +14,10 @@ AUTH_ADMIN_PASSWORD=secret NEXT_PUBLIC_IS_DEMO=false NEXT_PUBLIC_DEMO_EMAIL=test@mail.com NEXT_PUBLIC_DEMO_PASSWORD=Azerty123! -# CHOOSE EITHER REDIS_URL OR REDIS_HOST, REDIS_USERNAME, REDIS_PASSWORD, REDIS_PORT REDIS_HOST=localhost REDIS_USERNAME= REDIS_PASSWORD= REDIS_PORT=6379 -REDIS_URL=redis://localhost:6379 REDIS_USE_TLS=false SMTP_HOST=youtSmptHost SMTP_PORT=465 diff --git a/env.mjs b/env.mjs index abe78a08..e70fdcd3 100644 --- a/env.mjs +++ b/env.mjs @@ -24,7 +24,6 @@ export const env = createEnv({ .transform((value) => parseInt(value)), REDIS_USERNAME: z.string().optional(), REDIS_PASSWORD: z.string().optional(), - REDIS_URL: z.string().optional(), REDIS_USE_TLS: z .enum(["true", "false"]) .optional() @@ -81,7 +80,6 @@ export const env = createEnv({ REDIS_USERNAME: process.env.REDIS_USERNAME, REDIS_PASSWORD: process.env.REDIS_PASSWORD, REDIS_TLS: process.env.REDIS_TLS, - REDIS_URL: process.env.REDIS_URL, REDIS_USE_TLS: process.env.REDIS_USE_TLS, NEXT_PUBLIC_IS_DEMO: process.env.NEXT_PUBLIC_IS_DEMO, NEXT_PUBLIC_DEMO_EMAIL: process.env.NEXT_PUBLIC_DEMO_EMAIL, diff --git a/src/lib/redis.ts b/src/lib/redis.ts index 4dcb3627..f97e8073 100644 --- a/src/lib/redis.ts +++ b/src/lib/redis.ts @@ -29,6 +29,7 @@ const options: RedisOptions = { numberOfKeys: 1, }, }, + tls: process.env.REDIS_USE_TLS === "true" ? {} : undefined, } export const redis = new Redis(options)