Repository navigation
Move PR preview builds and hosting into Web Simulator - #8
Open
schnuartz-ai wants to merge 46 commits into
Open
schnuartz-ai wants to merge 46 commits into
schnuartz-ai wants to merge 46 commits into
Conversation
Collaborator
|
[To Do]
|
Schnuartz
approved these changes
Oct 4, 2026
Collaborator
|
@al-munazzim could you review this? |
|
I reviewed this paired service PR alongside the Specter-side dispatcher PR. The important security shape looks right to me: the Web Simulator validates the live PR metadata before building, checks out the exact head SHA, keeps the untrusted build job read-only/no secrets, and does the Pages/status update in a separate trusted finalizer that treats artifacts as data. The additional provenance, stale-result, and preview cleanup tests are also the right coverage for this flow. I do not see a code-level blocker here. Before merging/deploying, the repo-level setup items still matter:
|
…e compact PR comment in place
…ad GitHub App token
…hip and eviction flow
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Move the complete Specter DIY pull-request preview service into this repository, paired with [Specter DIY PR #440](cryptoadvance/specter-diy#440).
The Web Simulator handles PR validation, firmware and browser builds, integration tests, artifact verification, GitHub Pages hosting, preview lifecycle management, and automated PR comments through a dedicated GitHub machine-user account.
The Specter DIY dispatcher does not poll for results or update PR comments. It validates the request, dispatches the build, and exits.
Architecture
workflow_dispatch.Failed or cancelled builds preserve the last successfully published preview.
Machine-user PR comment reporting
Instead of a GitHub App with broad PR write permissions, the service uses a dedicated GitHub account,
specter-preview-bot, without repository write access.The trusted reporter:
GET /user.<!-- specter-web-simulator-preview -->.Comment layout
The compact comment contains:
Security model
Untrusted build jobs:
contents: read.Trusted JavaScript runtime:
Trusted finalizer:
The machine user must not receive write, triage or admin access to
cryptoadvance/specter-diy.Its classic PAT uses
public_repo, which is broader than comment-only access, but cannot grant permissions beyond those of the account itself.The trusted Web Simulator default branch remains security-critical and requires branch protection and maintainer review.
Simulator footer improvement
The device footer now displays the actual firmware version and the exact Specter DIY source commit:
GitHub · v1.10.5 · abc1234The abbreviated SHA is shown even when optional PR metadata is unavailable. The footer links directly to the exact source commit rather than merely the repository homepage.
A browser regression test verifies the version, SHA, separator and hyperlink.
Preview lifecycle
/pr/<number>/<full-head-sha>/.Required production configuration
Before production deployment:
mainwith required maintainer reviews, passing CI, and restrictions on direct and force pushes.specter-preview-bot, withpublic_reposcope.SPECTER_PREVIEW_BOT_TOKEN.SPECTER_PREVIEW_BOT_LOGINwith valuespecter-preview-bot.WEB_SIMULATOR_DISPATCH_TOKENin Specter DIY, scoped to Actions access on the paired Web Simulator repository.pull_request_targetActions policy.Do not reuse the fork-test PAT in production.
No GitHub App installation or PR-write repository permission is required for the machine user.
See [the full setup and security guide](docs/browser-simulator.md).
Validation
Successfully tested:
Relevant successful runs:
Still pending: Production repository secret/variable configuration and a controlled upstream end-to-end test using the production bot credential.
Merge order