Skip to content

Commit

Permalink
fix: redis tls
Browse files Browse the repository at this point in the history
  • Loading branch information
rharkor committed Nov 20, 2023
1 parent 06a0729 commit ea59cab
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 4 deletions.
2 changes: 0 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@ AUTH_ADMIN_PASSWORD=secret
NEXT_PUBLIC_IS_DEMO=false
NEXT_PUBLIC_DEMO_EMAIL=[email protected]
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
Expand Down
2 changes: 0 additions & 2 deletions env.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions src/lib/redis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const options: RedisOptions = {
numberOfKeys: 1,
},
},
tls: process.env.REDIS_USE_TLS === "true" ? {} : undefined,
}

export const redis = new Redis(options)
Expand Down

0 comments on commit ea59cab

Please sign in to comment.