Skip to content

fix(site): restrict local preview server to localhost and rename cache key - #528

Merged
hellobertrand merged 1 commit into
mainfrom
fix/site-snyk
Oct 15, 2026
Merged

hellobertrand merged 1 commit into
mainfrom
fix/site-snyk

Conversation

@hellobertrand

@hellobertrand hellobertrand commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

Bind the preview server to 127.0.0.1 to avoid potential exposure on network interfaces. Additionally, rename the localStorage key to follow consistent naming conventions.

Summary by CodeRabbit

  • Updates
    • The preview server now accepts connections only from the same device, rather than from other devices on the network.
    • GitHub star-count caching behavior is unchanged.
    • No other user-visible behavior has changed.

…e key

Bind the preview server to 127.0.0.1 to avoid potential exposure on network interfaces. Additionally, rename the localStorage key to follow consistent naming conventions.

Signed-off-by: Bertrand Lebonnois <5901952+hellobertrand@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5323072a-ee1f-4897-8c80-d2f33f6f7930
📥 Commits

Reviewing files that changed from the base of the PR and between 9532d72 and facb31f.

📒 Files selected for processing: 2
  • site/build.mjs
  • site/src/assets/site.js

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

📝 Walkthrough

The preview server now binds to 127.0.0.1. The GitHub star-count cache uses the local variable name CACHE instead of KEY, with the stored key and caching behavior unchanged.

Changes: Preview server binding

Layer / File(s) Summary
Bind preview listener
site/build.mjs
The preview server listener now binds to 127.0.0.1.

Star-count cache variable

Layer / File(s) Summary
Rename cache-key variable
site/src/assets/site.js
The cache lookup and write now use CACHE instead of KEY. The stored key and caching behavior are unchanged.

Priority: ➖ Normal

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to facb3

The preview server is restricted to the stated local interface, and the cache rename preserves existing behavior. No material merge risk is identified.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes both changes: restricting the local preview server to localhost and renaming the cache key.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@hellobertrand
hellobertrand merged commit 0a7d4e5 into main Oct 15, 2026
91 checks passed
@hellobertrand
hellobertrand deleted the fix/site-snyk branch October 15, 2026 10:57
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