Skip to content

Support for external Redis/Valkey with ACL / RBAC username and logical DB#203

Open
rcarvalhoxavier wants to merge 10 commits into
chatwoot:mainfrom
gupy-io:main
Open

Support for external Redis/Valkey with ACL / RBAC username and logical DB#203
rcarvalhoxavier wants to merge 10 commits into
chatwoot:mainfrom
gupy-io:main

Conversation

@rcarvalhoxavier

Copy link
Copy Markdown

Summary

This PR adds first-class support for external Redis/Valkey in production-style clusters: TLS (rediss), Redis 6+ ACL / RBAC username, optional logical DB in REDIS_URL, and consistent password handling so it matches redis-rb and Chatwoot’s expectations.

What we implemented

External Redis / Valkey (ACL + TLS)

  • REDIS_URL generation (_helpers.tpl): supports rediss:// when env.REDIS_TLS is true; optional redis.username for ACL; optional redis.database as path suffix; URL-encoded user/password in the URI when credentials are embedded.
  • Single source of truth — chatwoot.redis.externalAclEmbedActive: one helper is true only when external Redis uses ACL with user + password embedded in REDIS_URL (Helm knows the password, no redis.existingSecret, redis.aclEmbedPasswordInUrl enabled). The same condition drives:
    • the user:pass@host branch of chatwoot.redis.url, and
    • whether REDIS_PASSWORD is written to the generated env Secret (omitted in embed mode to avoid duplicate AUTH with TLS+ACL clients).
  • redis.aclEmbedPasswordInUrl (default true): when ACL username is set and the password is available to Helm, the password can live only in REDIS_URL. If redis.existingSecret is used, Helm cannot inline the password into REDIS_URL; the chart keeps user@host in the URL and REDIS_PASSWORD from the Deployment secretKeyRef (unchanged pattern).

Env Secret

  • REDIS_PASSWORD in the generated Secret is emitted when not redis.existingSecret and redis.enabled OR external ACL embed is not active — equivalent to omitting the key only in the external ACL-embed case described above.

Documentation

  • README updates for external Redis, ACL, TLS, and password/URL behavior.

Why we need this

We run Chatwoot on EKS with managed PostgreSQL and managed Valkey/ElastiCache (TLS, ACL user, secrets from AWS Secrets Manager). The default chart path (bundled Bitnami Redis or a minimal redis:// + separate password) is not enough for TLS + ACL without careful REDIS_URL and env composition. These changes make Helm predictable for that deployment model while preserving compatibility with bundled Redis/Postgres flows.

- Added support for external Redis configurations, including username and database options.
- Updated the Redis URL generation logic to accommodate ACL/Valkey RBAC users.
- Modified migrations job template to reference the new external Redis secret handling.

Signed-off-by: Rodrigo Xavier <rcarvalhoxavier@gmail.com>
- Clarified descriptions for Redis password, username, and database options in the README.
- Added notes on how to use the embedded Redis chart and external Redis configurations.

Signed-off-by: Rodrigo Xavier <rcarvalhoxavier@gmail.com>
Signed-off-by: Rodrigo Xavier <rcarvalhoxavier@gmail.com>
- Updated values.yaml to include aclEmbedPasswordInUrl option for better security with external Redis.
- Modified _helpers.tpl to conditionally emit REDIS_PASSWORD based on ACL settings.
- Adjusted env-secret.yaml to ensure REDIS_PASSWORD is only included when necessary, preventing duplicate AUTH issues.

Signed-off-by: Rodrigo Xavier <rcarvalhoxavier@gmail.com>
…edPasswordInUrl option

- Revised descriptions for Redis password and username to reflect changes in handling with ACL support.
- Added details about the aclEmbedPasswordInUrl option for improved security in Redis configurations.

Signed-off-by: Rodrigo Xavier <rcarvalhoxavier@gmail.com>
- Renamed helper function to clarify its purpose regarding external Redis ACL with embedded credentials.
- Updated logic in _helpers.tpl and env-secret.yaml to conditionally emit REDIS_PASSWORD based on Redis configuration, ensuring proper handling of ACL settings and avoiding duplicate AUTH issues.

Signed-off-by: Rodrigo Xavier <rcarvalhoxavier@gmail.com>
@rcarvalhoxavier rcarvalhoxavier changed the title Support fo external Redis/Valkey with ACL / RBAC username and logical DB Support for external Redis/Valkey with ACL / RBAC username and logical DB Apr 8, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1973e21ee2

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread charts/chatwoot/templates/_helpers.tpl Outdated
- Updated the Redis URL generation logic in _helpers.tpl to ensure proper URL encoding of user credentials, enhancing security and consistency in external Redis configurations.
- Clarified comments regarding the handling of existing secrets and embedded credentials.

Signed-off-by: Rodrigo Xavier <rcarvalhoxavier@gmail.com>
Signed-off-by: Rodrigo Xavier <rcarvalhoxavier@gmail.com>
Signed-off-by: Rodrigo Xavier <rcarvalhoxavier@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant