Skip to content

Conversation

bandhan-majumder
Copy link
Contributor

@bandhan-majumder bandhan-majumder commented Aug 12, 2025

What does this PR do?

Currently our docs shows users to generate base64 encoded string of length 32 which fails when we use latin1 format. It becomes 44 in length and as 1 char is exactly 1 byte, it exceeds 32 bytes limit and throws error. We already have mentioned the correct length in some places (more below).

Already exists in :
gitpod
official docs

Update to :
.env.example,
readme
install.sh

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  • Are there environment variables that should be set?
  • What are the minimal test data to have?
  • What is expected (happy path) to have (input and output)?
  • Any other important info that could help to test that PR

Checklist

  • I haven't read the contributing guide
  • My code doesn't follow the style guidelines of this project
  • I haven't commented my code, particularly in hard-to-understand areas
  • I haven't checked if my changes generate no new warnings

Signed-off-by: Bandhan Majumder <bandhanmajumder16@gmail.com>
@bandhan-majumder bandhan-majumder requested a review from a team as a code owner August 12, 2025 22:34
Copy link

vercel bot commented Aug 12, 2025

@bandhan-majumder is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

@graphite-app graphite-app bot added the community Created by Linear-GitHub Sync label Aug 12, 2025
@graphite-app graphite-app bot requested a review from a team August 12, 2025 22:34
@github-actions github-actions bot removed the community Created by Linear-GitHub Sync label Aug 12, 2025
Copy link
Contributor

coderabbitai bot commented Aug 12, 2025

Walkthrough

This PR updates CALENDSO_ENCRYPTION_KEY generation instructions from openssl rand -base64 32 to openssl rand -base64 24 in three places: .env.example, README.md, and deploy/install.sh. No application code is modified. The NEXTAUTH_SECRET generation remains unchanged. The install script’s control flow is otherwise unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~6 minutes

Assessment against linked issues

Objective Addressed Explanation
Correct key decoding in packages/lib/crypto.ts to use proper base64 decoding and ensure a 32-byte key for AES-256 (#22822, CAL-6174) No changes to crypto.ts; only documentation and install script updated.
Ensure encryption/decryption works with a base64-encoded 32-byte key decoded to exactly 32 bytes (#22822, CAL-6174) Key generation changed to 24 bytes base64 output; does not implement decoding fix or validate 32-byte decoded key.

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
Change CALENDSO_ENCRYPTION_KEY generation to openssl rand -base64 24 (deploy/install.sh) Alters key length instead of fixing decoding in crypto.ts; not aligned with the objective to properly decode a base64 32-byte key.
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added ❗️ .env changes contains changes to env variables api area: API, enterprise API, access token, OAuth Low priority Created by Linear-GitHub Sync 🐛 bug Something isn't working labels Aug 12, 2025
Copy link

graphite-app bot commented Aug 12, 2025

Graphite Automations

"Add consumer team as reviewer" took an action on this PR • (08/12/25)

1 reviewer was added to this PR based on Keith Williams's automation.

"Add community label" took an action on this PR • (08/12/25)

1 label was added to this PR based on Keith Williams's automation.

@dosubot dosubot bot added the docs area: docs, documentation, cal.com/docs label Aug 12, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ab703a4 and b1e9cea.

📒 Files selected for processing (3)
  • .env.example (1 hunks)
  • README.md (1 hunks)
  • deploy/install.sh (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Detect changes
  • GitHub Check: Detect changes
🔇 Additional comments (1)
README.md (1)

149-152: Clarify CALENDSO_ENCRYPTION_KEY length in README.md

To eliminate ambiguity around key size, append a parenthetical indicating that -base64 24 produces 32 characters.

  • File: README.md
  • Lines: 149–152
  • Change:
-   - Use `openssl rand -base64 24` to generate a key and add it under `CALENDSO_ENCRYPTION_KEY` in the `.env` file.
+   - Use `openssl rand -base64 24` (32 characters) to generate a key and add it under `CALENDSO_ENCRYPTION_KEY` in the `.env` file.

@bandhan-majumder
Copy link
Contributor Author

There are some flakey tests making noise in the flow. If the unit test fails first time, second time without any changes it works.

@anikdhabal anikdhabal requested a review from volnei August 13, 2025 05:51
@bandhan-majumder
Copy link
Contributor Author

hey @volnei , can you please take a look !?

@bandhan-majumder
Copy link
Contributor Author

hey @keithwillcode, can you please review it since this documentation bug is causing issue to couple of developers?

@bandhan-majumder
Copy link
Contributor Author

hi @volnei, @anikdhabal can you approve this PR?

@bandhan-majumder
Copy link
Contributor Author

@Devanshusharma2005 @kart1ka
can you please review this docs changes ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api area: API, enterprise API, access token, OAuth 🐛 bug Something isn't working docs area: docs, documentation, cal.com/docs ❗️ .env changes contains changes to env variables Low priority Created by Linear-GitHub Sync
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Encryption fails with "Invalid key length" due to incorrect key encoding in crypto.ts
2 participants