From 573756eaa213fcfe2796f81c0945077da96a632d Mon Sep 17 00:00:00 2001 From: simiondolha <34995943+simiondolha@users.noreply.github.com> Date: Tue, 13 Jan 2026 15:46:39 +0100 Subject: [PATCH] docs: fix CALENDSO_ENCRYPTION_KEY generation command (#26658) The AES256 encryption used for 2FA requires exactly 32 bytes. The previous command `openssl rand -base64 32` generates a 44-character base64 string (32 bytes encoded in base64), which is too long. Changed to `openssl rand -base64 24` which generates exactly 32 characters (24 bytes encoded in base64 = 32 characters). This was causing 2FA setup failures with "Something went wrong" errors and RangeError: Invalid key length in self-hosted Docker installations. Fixes #22365 Co-authored-by: simiondolha Co-authored-by: Claude Opus 4.5 Co-authored-by: Keith Williams --- .env.example | 2 +- agents/knowledge-base.md | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index ab656ae549..019cfef8d6 100644 --- a/.env.example +++ b/.env.example @@ -94,7 +94,7 @@ CRON_ENABLE_APP_SYNC=false # Application Key for symmetric encryption and decryption # must be 32 bytes for AES256 encryption algorithm -# You can use: `openssl rand -base64 24` to generate one +# You can use: `openssl rand -base64 24` to generate a 32-character key CALENDSO_ENCRYPTION_KEY= # Intercom Config diff --git a/agents/knowledge-base.md b/agents/knowledge-base.md index 6b0cb7f592..f3a630f852 100644 --- a/agents/knowledge-base.md +++ b/agents/knowledge-base.md @@ -13,7 +13,8 @@ Development - Install dependencies: `yarn` - Set up environment: - Copy `.env.example` to `.env` - - Generate keys with `openssl rand -base64 32` for both `NEXTAUTH_SECRET` and `CALENDSO_ENCRYPTION_KEY` + - Generate NEXTAUTH_SECRET with `openssl rand -base64 32` + - Generate CALENDSO_ENCRYPTION_KEY with `openssl rand -base64 24` (must be 32 characters for AES256) - Configure Postgres database URL in `.env` - Set DATABASE_DIRECT_URL to the same value as DATABASE_URL