Files
webstudio/fixtures
Oleg Isonen 410fedbe83 fix: Allow self-hosted Node forms to reach sibling APIs (#6627)
Docker and Coolify exports still reject a Form Resource on a sibling API
host. The Node generator denies the entire registrable domain, so
`webstudio-demo-john.stauferth.de` cannot submit to `cms.stauferth.de`.

This follow-up will allow public sibling API hosts while keeping DNS
address validation and stopping Resource requests that return to the
same project through an alias.

Ref #6623

## Plan
- [x] Reproduce the Node export rejection and add a failing regression
test.
- [x] Restrict the Node hostname deny rule to the site's known hosts.
- [x] Mark outbound Node Resource requests and reject same-project
reentry before page data loads.
- [x] Verify public DNS pinning, redirects, other-project requests, and
existing Cloudflare behavior.
- [x] Review the Builder product docs for Node self-hosting and update
them if needed.
- [x] Run targeted tests, typechecks, lint, fixture generation, and
required CI. All checks on `fb283ea4b6` passed, including the main
workflow, visual regression, lint, submodules, and staging deploy.

Expected production change: roughly 30–50 net lines across the
generator, Node transport, and route templates. No new package, service,
or user-facing error text. A CLI release and republish will be required
to update existing exports.

## Verification
- Reproduced the Node rejection for `cms.stauferth.de` from
`webstudio-demo-john.stauferth.de`; the new generator test failed before
the fix and passed after it.
- SDK marker test failed without the marker assignment, then passed.
Focused SDK tests: 27 passed. CLI prebuild: 144 passed.
- SDK and CLI typechecks, SDK published types, root lint and package
boundaries, fixture generation, Docker fixture typecheck and production
build passed.
- The built Docker fixture returned 508 for marked same-project GET and
Form POST requests and 200 for another project's GET.
- The Node connector still vets and pins public DNS answers on each hop.
A reverse proxy must preserve the marker header for unknown-alias
reentry detection. No live customer deployment was tested.
- Actual source change: 59 net non-test lines, plus 268 generated
fixture lines. Both legacy and React Router route templates need entry
checks because Node exports lack a Worker entrypoint.
2026-11-01 12:54:07 +01:00
..

Webstudio Fixtures

Fixtures are test projects that ensure the CLI and build process work correctly across different deployment targets.

Updating Fixtures After Changes

# From repository root - updates all fixtures
pnpm fixtures

This command will:

  1. Link all fixtures to their respective projects
  2. Sync the latest data from the development environment
  3. Build all fixtures with the latest code

Working with Individual Fixtures

# Go to fixture folder
cd fixtures/webstudio-features

# Link to project
pnpm fixtures:link

# Sync latest data
pnpm fixtures:sync

# Build fixture
pnpm fixtures:build

# Start it
pnpm run dev

Adding Assets to Fixtures

To add a new asset (image, video, audio, etc.) to a fixture:

  1. Publish to staging

    • Make your changes in the builder
    • Publish to the staging environment
  2. Get the build ID from CI

    • After publishing, check the CI logs
    • Find the build ID that was created
  3. Update the fixture's build ID

    • Edit fixtures/[fixture-name]/package.json
    • Update the --buildId parameter in the fixtures:sync script
    "fixtures:sync": "pnpm cli sync --buildId NEW_BUILD_ID_HERE && pnpm oxfmt ./.webstudio/"
    
  4. Sync with the correct environment

    # Go to fixture folder
    cd fixtures/webstudio-features
    
    # Sync from staging environment (replace with your branch)
    BUILDER_HOST=fix-assets.staging.webstudio.is pnpm run fixtures
    
  5. Fix the origin URL

    • After syncing, edit .webstudio/data.json
    • Change the origin back to:
    "origin": "https://main.development.webstudio.is"
    
    • This is necessary because sync changes it to the current branch
  6. Commit the changes

    git add fixtures/
    git commit -m "chore: update fixtures with new assets"
    git push