Add setup script for Parcel installation - #151
Draft
erayd wants to merge 65 commits into
Draft
Conversation
Adds a self-contained bash setup script (src/parcel-setup.sh) with declarative browser config (src/parcel-setup.json) that handles bootstrap host installation, native messaging manifest generation, parcelrc customisation, interactive .parcel.json config building, and uninstall. Includes a build helper (scripts/generate-setup.sh) that embeds the bootstrap host and config as heredocs to produce the distributable parcel-setup.sh. Adds `make setup` target and integrates it into `make release`.
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.
NOTE: This script has been tested and key functionality confirmed to work, but has not yet been source-reviewed. Trust it at your own risk ;-)
Summary
Adds a self-contained bash setup script that handles the parts of Parcel
installation that the webstore extension install cannot: installing the
bootstrap host, generating native messaging manifests for detected browsers,
generating a tailored parcelrc, and optionally building an interactive
.parcel.jsonruleset.Files added
src/parcel-setup.sh— Main setup script source. Implements athree-phase install flow (detect → preview → apply), interactive
.parcel.jsonconfig builder, and uninstall mode. Compatible with bash 3.2and BSD utilities (macOS out-of-the-box). References
$BOOTSTRAP_HOST,$SETUP_CONFIG, and$SIGNED_HOST_SHA256as normal variables; indevelopment these are loaded from source files.
src/parcel-setup.json— Declarative browser/platform/flatpak config.Defines 12 browsers (Chrome, Brave, Vivaldi, Edge, Chromium, Arc, Iridium,
Slimjet, Yandex, LibreWolf, Waterfox, Firefox) with detection paths and
manifest directories per OS and install level. Parsed with jq at runtime.
scripts/generate-setup.sh— Build helper that generates thedistributable
parcel-setup.shby prepending a heredoc preamble embeddingthe bootstrap host, setup config, and signed host SHA256 hash.
Files modified
Makefile— Newmake setuptarget generates the distributable script.make releasenow depends on it and includes the setup script indist/(GPG-signed alongside other release artifacts).
make cleanremoves thegenerated file.
.gitignore— Added/parcel-setup.sh(generated build artifact).Key design decisions
Single-file distribution: The bootstrap host and setup config are
embedded as heredocs in the generated
parcel-setup.sh. The GPG signatureon the setup script transitively covers the embedded content.
Three-phase install: All detection happens first, proposed changes are
summarised for user confirmation (default: no), then filesystem
modifications are made. Partial changes on interrupt are reported, not
rolled back.
Browser detection: Checks both binary paths and existing Parcel
manifests (not just any
NativeMessagingHostsdirectory — avoids falsepositives from other tools like Browserpass).
HOST_HASH pinning: Opt-in via user prompt. The user is asked whether to
pin the signed host hash in their parcelrc (requiring explicit review of
future host updates). Never overwrites an existing hash. Not auto-applied
with
--yes.parcelrc customisation: Only nudges settings toward stricter values
(e.g. custom gpg/jq paths on macOS, HOST_HASH). Never loosens user-set
values. Inserts below the commented-out default line to keep documentation
visible.
Config builder: Scans the password store, auto-detects rules from
directory structure (sorted by specificity — more-specific patterns first),
excludes dotfile directories. Only writes settings that deviate from
schema defaults or were already present. Never writes internal fields
(
passdir,modified). Existing rules preserved if user declinessuggestions.
--verboseflag: Gates verbose output (e.g. full password-store treelisting) for large stores.
CLI flags
--system--user--prefix <path>--passdir <path>--browser <name>--flatpak-only--yes/-y--create-config.parcel.jsonconfig builder only--uninstall--remove-config--uninstall: also remove config files--verboseTesting
make setupgenerates a valid, syntactically-correct distributableallowed_origins, firefox:allowed_extensions)make prettierpassesmake test— all 450 existing tests pass, 0 failuresenvironments are too varied to automate meaningfully (manual UAT across
representative environments required)