Skip to content

[Website] Reject OPFS root and sites-directory mounts - #4533

Merged
adamziel merged 1 commit into
trunkfrom
reject-opfs-root-mounts
Oct 28, 2026
Merged

adamziel merged 1 commit into
trunkfrom
reject-opfs-root-mounts

Conversation

@adamziel

@adamziel adamziel commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Reject OPFS source paths / and /sites in both startup mounts and later mountOpfs() calls. These mounts expose every saved site at once. Empty paths and alternate slash spellings are rejected too.

Individual site folders, custom integration folders, local-fs handles, and PHP destination paths stay unchanged. The site manager can still list saved sites directly.

This breaks callers that mount either source root. It does not block mounting a known site folder or change ZIP exports.

Testing

All 141 remote tests, lint, type checks, and the split-origin build pass. Five Chromium UI checks pass for saving, reopening, renaming, site switching, and local-folder saving.

To check manually, save a temporary Playground, reload it, switch away and back, and save another to a local folder. Try mounting / and /sites; both should reject, while a specific site folder still mounts.

Summary by CodeRabbit

  • Bug Fixes
    • OPFS mounts targeting the root directory or /sites are now rejected during startup, with a clear error message. This prevents invalid mount locations from proceeding to storage access or installation. Other supported OPFS paths and local-folder mounts continue to work as before.

@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Walkthrough

The endpoint now normalizes OPFS mount paths and rejects / and /sites. Tests cover direct mounts, both boot install modes, accepted OPFS subdirectories, and local-folder mount registration.

Changes: OPFS Mount Validation

Layer / File(s) Summary
Validate OPFS mount paths
packages/playground/remote/src/lib/playground-worker-endpoint.ts, packages/playground/remote/src/lib/playground-worker-endpoint.spec.ts
mountOpfsIntoPhp normalizes OPFS paths and rejects / and /sites. Tests cover rejected paths, accepted subdirectories with either initial sync direction, and local-folder mount registration at /wordpress and /.
Check mount paths during boot
packages/playground/remote/src/lib/playground-worker-endpoint-blueprints.spec.ts
Tests cover both rejected paths in both install modes. They verify the expected error and that OPFS directory access is not attempted.

Priority: Not assessed

Estimated code review effort: 2 (Simple) | ~15 minutes

Change: Bug fix

Suggested reviewers: akirk, brandonpayton

Merge Risk: Minimal · up to fe843

Forbidden OPFS roots are rejected before mounting. No merge-blocking issue was established.

Finishing Touches
📝 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.

@adamziel
adamziel merged commit 615c567 into trunk Oct 28, 2026
60 of 61 checks passed
@adamziel
adamziel deleted the reject-opfs-root-mounts branch October 28, 2026 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant