Skip to content

fix(sunset): gate sunset mode on cloud deployment and keep PATs working through the wind-down - #1815

Merged
AnishSarkar22 merged 3 commits into
MODSetter:mainfrom
AnishSarkar22:hotpatch/sunset-mode
Sep 20, 2026
Merged

AnishSarkar22 merged 3 commits into
MODSetter:mainfrom
AnishSarkar22:hotpatch/sunset-mode

Conversation

@AnishSarkar22

@AnishSarkar22 AnishSarkar22 commented Sep 20, 2026

Copy link
Copy Markdown
Collaborator

What

  • Gate SUNSET_MODE on DEPLOYMENT_MODE=cloud — self-hosted instances can never be sunset-blocked, even if SUNSET_MODE is set by accident; also fixes DEPLOYMENT_MODE reading a never-set SURFSENSE_DEPLOYMENT_MODE env var that silently defaulted to self-hosted.
  • Keep /api/v1/pats (create/revoke API keys) working under sunset mode — PATs are supposed to survive until the T+30 purge, not die at T-0, fixing cloud users hitting 410 Gone when managing API keys during the wind-down.

Why

Fixes #1814

How to test

@vercel

vercel Bot commented Sep 20, 2026

Copy link
Copy Markdown

@AnishSarkar22 is attempting to deploy a commit to the Rohan Verma's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Sep 20, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 19bac459-a203-4cd3-84db-d748bbfb4b6c

📥 Commits

Reviewing files that changed from the base of the PR and between 51a2f5f and 8ea4ae7.

📒 Files selected for processing (8)
  • .github/workflows/docker-build.yml
  • surfsense_backend/.env.example
  • surfsense_backend/app/config/__init__.py
  • surfsense_backend/app/sunset.py
  • surfsense_backend/tests/unit/test_sunset_flag.py
  • surfsense_backend/tests/unit/test_sunset_write_block.py
  • surfsense_local/backend/modules/llm/models.py
  • surfsense_local/backend/tests/unit/shared/test_secrets.py
 _______________________________________________________________
< e/acc/def/det: Effective accelerationism of defect detection. >
 ---------------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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

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

CREDO23 and others added 3 commits September 20, 2026 18:08
Reminting secret.bin leaves every stored provider key undecryptable. Fernet raised InvalidToken out of the api_key property, so model discovery 500'd and the boot gate, which resolves the selected model through that connection, left the window stuck on "SurfSense could not start". Drop the dead ciphertext and report no key, so the app boots and asks for it again.
@AnishSarkar22 AnishSarkar22 changed the title Hotpatch/sunset mode fix(sunset): gate sunset mode on cloud deployment and keep PATs working through the wind-down Sep 20, 2026
@AnishSarkar22
AnishSarkar22 merged commit 4fb0156 into MODSetter:main Sep 20, 2026
4 of 9 checks passed
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.

turned on the API key access and encountered the issue

2 participants