-
Notifications
You must be signed in to change notification settings - Fork 0
feat: bootstrapper i18n and latest OpenCode default #200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
43f2f30
fix: harden native host security (message cap, CORS validation, port …
MihalyToth20 c29b34e
chore: add extension public key to release flow
MihalyToth20 3a81f5e
feat: add bootstrapper installer flow and strict OpenCode version pin…
MihalyToth20 6e2118e
chore: style for mac os and extension installer flow docs
MihalyToth20 e09087e
feat: localize bootstrapper prompts and expand language support
MihalyToth20 b6415c6
feat: default opencode channel to latest
MihalyToth20 c49af1f
chore: add changeset
MihalyToth20 c9ba73e
chore: stop tracking native host hardening plan
MihalyToth20 ee96589
fix: address bootstrapper and native host review issues
MihalyToth20 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@calycode/cli": minor | ||
| --- | ||
|
|
||
| refactor: fixed several inconsistencies with the native host implementation |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@calycode/cli": patch | ||
| --- | ||
|
|
||
| refactor: adjusted extension id discovery |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@calycode/cli": minor | ||
| --- | ||
|
|
||
| feat: downloadable bootstrapper for the cli for windows and mac os |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| # .github/workflows/build-bootstrapper.yml | ||
| name: Build Bootstrapper | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - "bootstrapper/**" | ||
| - ".github/workflows/build-bootstrapper.yml" | ||
| workflow_dispatch: | ||
| release: | ||
| types: [published] | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build all targets | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 | ||
|
|
||
| - name: Setup Go | ||
| uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff | ||
| with: | ||
| go-version: "1.21" | ||
|
|
||
| - name: Build Windows x64 | ||
| working-directory: bootstrapper | ||
| run: | | ||
| mkdir -p dist | ||
| GOOS=windows GOARCH=amd64 CGO_ENABLED=0 \ | ||
| go build -ldflags "-s -w -H=windowsgui" \ | ||
| -o dist/calycode-installer-windows-x64.exe \ | ||
| . | ||
|
|
||
| - name: Build macOS x64 | ||
| working-directory: bootstrapper | ||
| run: | | ||
| GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 \ | ||
| go build -ldflags "-s -w" \ | ||
| -o dist/calycode-installer-darwin-x64 \ | ||
| . | ||
| cd dist | ||
| zip -9 calycode-installer-darwin-x64.zip calycode-installer-darwin-x64 | ||
|
|
||
| - name: Build macOS arm64 | ||
| working-directory: bootstrapper | ||
| run: | | ||
| GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 \ | ||
| go build -ldflags "-s -w" \ | ||
| -o dist/calycode-installer-darwin-arm64 \ | ||
| . | ||
| cd dist | ||
| zip -9 calycode-installer-darwin-arm64.zip calycode-installer-darwin-arm64 | ||
|
|
||
| - name: Generate checksums | ||
| working-directory: bootstrapper/dist | ||
| run: sha256sum * > SHA256SUMS | ||
|
|
||
| # --- Release attachment --- | ||
| # Triggered by changesets creating a GitHub Release after npm publish. | ||
| # `gh release upload` attaches to the release that fired this workflow. | ||
| - name: Attach binaries to GitHub Release | ||
| if: github.event_name == 'release' | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| RELEASE_TAG: ${{ github.event.release.tag_name }} | ||
| run: | | ||
| gh release upload "$RELEASE_TAG" \ | ||
| bootstrapper/dist/calycode-installer-windows-x64.exe \ | ||
| bootstrapper/dist/calycode-installer-darwin-x64.zip \ | ||
| bootstrapper/dist/calycode-installer-darwin-arm64.zip \ | ||
| bootstrapper/dist/SHA256SUMS \ | ||
| --clobber | ||
|
|
||
| # --- Floating tag --- | ||
| # Keeps `bootstrapper-latest` pointing at HEAD so | ||
| # dev builds are always downloadable at a stable URL. | ||
| - name: Update bootstrapper-latest tag | ||
| if: github.event_name == 'push' | ||
| run: | | ||
| git tag -f bootstrapper-latest | ||
| git push -f origin bootstrapper-latest | ||
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| # CalyCode Bootstrapper Build | ||
| # Produces standalone installers for Windows (exe) and macOS (macho binary). | ||
| # | ||
| # Prerequisites: Go 1.21+ | ||
| # | ||
| # Usage: | ||
| # make all Build all targets | ||
| # make windows Build Windows .exe (from any OS) | ||
| # make darwin-amd64 Build macOS Intel binary | ||
| # make darwin-arm64 Build macOS Apple Silicon binary | ||
| # make clean Remove build artifacts | ||
|
|
||
| OUT_DIR := dist | ||
| BINARY := calycode-installer | ||
| MODULE := github.com/calycode/xano-tools/bootstrapper | ||
|
|
||
| .PHONY: all windows darwin-amd64 darwin-arm64 clean | ||
|
|
||
| all: windows darwin-amd64 darwin-arm64 | ||
|
|
||
| $(OUT_DIR): | ||
| mkdir -p $(OUT_DIR) | ||
|
|
||
| windows: $(OUT_DIR) | ||
| @echo "Building Windows x64..." | ||
| GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build \ | ||
| -ldflags "-s -w -H=windowsgui" \ | ||
| -o $(OUT_DIR)/$(BINARY)-windows-x64.exe \ | ||
| $(MODULE) | ||
|
|
||
| darwin-amd64: $(OUT_DIR) | ||
| @echo "Building macOS Intel x64..." | ||
| GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build \ | ||
| -ldflags "-s -w" \ | ||
| -o $(OUT_DIR)/$(BINARY)-darwin-x64 \ | ||
| $(MODULE) | ||
| cd $(OUT_DIR) && zip -9 $(BINARY)-darwin-x64.zip $(BINARY)-darwin-x64 | ||
|
|
||
| darwin-arm64: $(OUT_DIR) | ||
| @echo "Building macOS Apple Silicon..." | ||
| GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build \ | ||
| -ldflags "-s -w" \ | ||
| -o $(OUT_DIR)/$(BINARY)-darwin-arm64 \ | ||
| $(MODULE) | ||
| cd $(OUT_DIR) && zip -9 $(BINARY)-darwin-arm64.zip $(BINARY)-darwin-arm64 | ||
|
|
||
| clean: | ||
| rm -rf $(OUT_DIR) |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| module github.com/calycode/xano-tools/bootstrapper | ||
|
|
||
| go 1.21 |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: calycode/xano-tools
Length of output: 180
🏁 Script executed:
Repository: calycode/xano-tools
Length of output: 3447
🌐 Web query:
actions/checkout persist-credentials default true behavior git push💡 Result:
The
persist-credentialsinput for theactions/checkoutGitHub Action has a default value oftrue[1][2]. Whenpersist-credentialsis set totrue(the default), the action configures the runner's local Git environment with the authentication token provided to the workflow (typically theGITHUB_TOKEN) [1][3]. This allows subsequent steps in your job to execute authenticated Git commands—such asgit fetchorgit push—without requiring additional authentication setup [1][2][3]. Recent updates toactions/checkouthave improved the security of this feature by storing these credentials in a separate file within the runner's temporary directory ($RUNNER_TEMP) rather than directly inside the repository's.git/config[2][3][4]. The action still performs cleanup by removing these credentials during the post-job phase [1][3]. If you setpersist-credentials: false, the action will not persist these credentials into the Git configuration [1][5]. While this is considered a recommended security best practice to reduce potential credential exposure [5][6][7], it means you must handle Git authentication manually in any subsequent steps where you need to perform authorized operations likegit push(e.g., by using an alternative authentication method or configuring credentials explicitly) [8][9][7].Citations:
persist-credentials: falsewith actions/checkout github/gh-aw#2641🌐 Web query:
actions/checkout release.published event which ref it checks out github.sha tag commit💡 Result:
For a workflow triggered by the GitHub release event types (e.g., on: release: types: [published]), actions/checkout checks out the ref or SHA for the workflow trigger event; by default it uses “the reference or SHA for that event” (unless you set inputs.ref explicitly) [1]. So, if you configure actions/checkout without specifying ref, the commit it checks out corresponds to the commit SHA that GitHub Actions associates with that release event (i.e., the event’s ref/SHA), rather than a branch name [1]. If you want to be explicit in the release.published workflow, set the checkout ref to the commit SHA you intend to build (commonly derived from the event payload via the github.* context), using actions/checkout’s ref input which accepts a branch, tag, or SHA [1]. Note: This is consistent with actions/checkout’s documented behavior that the default checkout for the “repository that triggered a workflow” is the reference or SHA for that event, and it only fetches a single commit by default for that ref/SHA [1].
Citations:
🌐 Web query:
GitHub tag name allowed characters restrictions for shell injection💡 Result:
Git/GitHub tag names aren’t “specially restricted” to prevent shell injection; instead, Git allows a fairly wide character set, and shell-injection risk comes from how tag strings are interpolated into shell commands by downstream tooling. 1) What characters are allowed for Git tag names (the practical restrictions) - Git is very permissive about what characters may appear in branch and tag names; you may need to escape/quote special characters when using the names in a command-line shell. GitHub’s docs note that Git has “very few restrictions” and only calls out exceptions like slash placement/duplication. [1] - For the underlying ref-name rules, Git’s check-ref-format documentation specifies key constraints for reference names: - A ref component cannot begin with “.” and cannot end with “.lock”. [2] - A ref cannot begin or end with “/” and cannot contain multiple consecutive “/”. [2] - A ref must contain at least one “/” in general (because refs are in hierarchies like heads/ or tags/); for one-level refs this rule can be waived with an option, but normal refnames (like refs/tags/…) do include “/”. [2] - A refname cannot contain the sequence “@{”. [2] (These are the main “format” restrictions Git enforces; they’re about ref parsing/semantics, not about preventing shell meta-characters like; or |.) - GitHub also adds a small additional push-time restriction on names that look like Git object IDs and on names beginning with “refs/” to avoid confusion. [1] 2) Why this relates to shell injection (what the “allowed characters restrictions” really mean) - The relevant security issue is not “GitHub’s tag character policy”; it’s whether a tag string (often from GITHUB_REF / user input) is inserted into a shell command string and executed with a shell. - A concrete example: an action had a bug where attacker-controlled “tag” input could run arbitrary shell commands; the fix was to properly quote/escape the tag string before passing it to exec. [3] 3) Safe guidance for preventing shell injection with tag values - Treat tag strings as untrusted input and do not concatenate them into shell command strings. - Prefer APIs that avoid a shell (e.g., spawn/execFile-style parameter passing rather than exec with a single command line). - If you must use a shell command string, you must quote/escape arguments so shell metacharacters are not interpreted. The referenced fix escapes the tag argument and wraps it in single quotes. [3] - Even with quoting, ensure your quoting context matches how the command is executed; security guidance emphasizes that quoting/escaping alone can be unreliable if you pass untrusted input into a shell without controlling the interpreter behavior. [4] 4) Practical “safe allowlist” approach (what to use instead of relying on GitHub/Git rules) - GitHub suggests using a safe default set of characters for branch/tag names to avoid needing escapes when working in shells: English letters (A–Z, a–z), digits (0–9), and punctuation. - _ /. [1] Answer in one line: There isn’t a GitHub-specific “shell-injection-safe” character restriction for tag names; Git allows many characters, and shell injection is prevented by handling tag strings as untrusted and avoiding/quoting shell interpretation when building commands. [1][2][3]
Citations:
Harden the workflow: pin actions and fix checkout-credentials handling for the tag push.
actions/checkout@v4andactions/setup-go@v5to commit SHAs (supply-chain hardening).Checkoutcurrently keeps persisted Git credentials (nopersist-credentials: false). The workflow later runsgit pushin Update bootstrapper-latest tag, so settingpersist-credentials: falsewithout adding explicit git auth would break the job—either keep persisted credentials or update the workflow to authenticategit pushexplicitly before that step.gh release uploaduses${{ github.event.release.tag_name }}directly in therun:shell line; move it to an environment variable (e.g.,env: RELEASE_TAG: ...and use"$RELEASE_TAG") to avoid shell interpretation risks from tag names.release.published, default checkout is the event’s ref/SHA, sobootstrapper-latestwill track the release-tag commit (not necessarily themainHEAD), matching the job’s actual behavior.Suggested hardening patch (pin actions; checkout auth needs follow-up)
🧰 Tools
🪛 zizmor (1.25.2)
[warning] 23-24: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
[error] 24-24: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
[error] 27-27: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
[error] 27-27: runtime artifacts potentially vulnerable to a cache poisoning attack (cache-poisoning): enables caching by default
(cache-poisoning)
🤖 Prompt for AI Agents