Skip to content

[BUG] Redis auth attempted with unset credentials when REDIS_URI is absent #541

Description

@Justxd22

Describe the bug
Nostream attempts Redis authentication even when no Redis credentials are configured, causing WRONGPASS on local Redis instances that allow unauthenticated access.

src/cache/client.ts:

exportconstgetCacheConfig=(): RedisClientOptions=>({url: process.env.REDIS_URI
? process.env.REDIS_URI
: `redis://${process.env.REDIS_USER}:${process.env.REDIS_PASSWORD}@${process.env.REDIS_HOST}:${process.env.REDIS_PORT}`,password: process.env.REDIS_PASSWORD,})

notice how it uses process.env.REDIS_PASSWORD even when it's empty/unset or null, resulting in failed connection due to broken URI

To Reproduce

  1. Configure .env with only:
REDIS_HOST=localhostREDIS_PORT=6379
  1. Start nostream pnpm run dev and trigger a redis operation like visiting 127.0.0.1:8008/invoices
  2. Observe repeated Redis connection/auth errors.

Expected behavior
If credentials REDIS_PASSWORD are unset, nostream should connect to Redis without AUTH.

System (please complete the following information):

  • OS: Arch linux
  • Platform: pnpm
  • Version: latest

Logs

uncaughterror: [ErrorReply: WRONGPASSinvalidusername-passwordpairoruser is disabled.]uncaughterror: [ErrorReply: WRONGPASSinvalidusername-passwordpairoruser is disabled.]uncaughterror: [ErrorReply: WRONGPASSinvalidusername-passwordpairoruser is disabled.]uncaughterror: [ErrorReply: WRONGPASSinvalidusername-passwordpairoruser is disabled.]uncaughterror: [ErrorReply: WRONGPASSinvalidusername-passwordpairoruser is disabled.]uncaughterror: [ErrorReply: WRONGPASSinvalidusername-passwordpairoruser is disabled.]uncaughterror: [ErrorReply: WRONGPASSinvalidusername-passwordpairoruser is disabled.]uncaughterror: [ErrorReply: WRONGPASSinvalidusername-passwordpairoruser is disabled.]uncaughterror: [ErrorReply: WRONGPASSinvalidusername-passwordpairoruser is disabled.]

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions