Skip to content

fix: persist encryption key in Docker Compose for container restarts - #5576

Closed
anshulgoel22 wants to merge 1 commit into
bytechefhq:masterfrom
anshulgoel22:fix/3700-docker-encryption-key-persistence
Closed

fix: persist encryption key in Docker Compose for container restarts#5576
anshulgoel22 wants to merge 1 commit into
bytechefhq:masterfrom
anshulgoel22:fix/3700-docker-encryption-key-persistence

Conversation

@anshulgoel22

Copy link
Copy Markdown
Contributor

Fixes #3700

Summary

When ByteChef runs in Docker with the default filesystem encryption provider, the key is stored inside the container filesystem (~/.bytechef/key). Recreating the container (docker rm + docker run) generates a new key while PostgreSQL data persists in a volume, so stored OAuth connection credentials cannot be decrypted.

Solution

  • Set BYTECHEF_ENCRYPTION_PROVIDER=property with a stable dev BYTECHEF_ENCRYPTION_PROPERTY_KEY in docker-compose.yml and docker-compose.src.yml
  • Fix BYTECHEF_SECURITY_REMEMBER_ME_KEY env var name (was REMEMBER-ME_KEY with a hyphen)
  • Align README and local Docker install docs with the same encryption env vars for manual docker run

Type of change

  • Bug fix (Docker / self-hosted local setup)

How Has This Been Tested?

  • Verified env var names against ApplicationProperties and existing Helm values.yaml pattern
  • Matches property encryption integration test key used in the codebase

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Set BYTECHEF_ENCRYPTION_PROVIDER=property with a stable dev encryption
key in docker-compose files so OAuth connection credentials remain
decryptable after the ByteChef container is recreated while PostgreSQL
data persists in a volume.

Also fix BYTECHEF_SECURITY_REMEMBER_ME_KEY env var name and document the
encryption settings in README and local Docker install guide.

Fixes bytechefhq#3700

Co-authored-by: Cursor <cursoragent@cursor.com>
@anshulgoel22

Copy link
Copy Markdown
Contributor Author

Opened PR #5576 for this: #5576

Sets BYTECHEF_ENCRYPTION_PROVIDER=property with a stable dev encryption key in docker-compose (and aligns README / local Docker docs) so OAuth connection credentials remain decryptable after the ByteChef container is recreated while PostgreSQL data persists in a volume. Also fixes the remember-me env var name.

Ready for review — thanks!

@ivicac

ivicac commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

Resent #5654

@ivicac ivicac closed this Sep 6, 2026
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.

[bug]: Retain encryption key across container restarts to prevent connection failures

2 participants