Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .cargo/audit.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ignore = [
# rsa 0.9.10 (Marvin timing sidechannel). Present in Cargo.lock because sqlx
# resolves sqlx-mysql unconditionally, and sqlx-mysql depends on rsa. cargo
# audit scans the lockfile, so it flags rsa even though it is NOT linked into
# our binary: sqlx is built postgres-only (crates/gitlawb-node/Cargo.toml),
# our binary: sqlx is built postgres-only (crates/twigpine-node/Cargo.toml),
# so the MySQL RSA auth path is never compiled and there is no RSA oracle to
# attack. No upstream fix exists regardless. REMOVE this ignore if sqlx is
# ever built with the `mysql` feature, or any other consumer of rsa enters
Expand Down Expand Up @@ -43,10 +43,10 @@ ignore = [
# crypto-bigint 0.5.5 (secret-dependent branches in operations meant
# to be constant-time). REACHABLE accepted risk, on two paths:
# - alloy-signer -> elliptic-curve 0.13 -> crypto-bigint 0.5: the k256
# PrivateKeySigner that signs transactions in `gl name`
# (crates/gl/src/name.rs) and the node operator
# (crates/gitlawb-node/src/operator.rs).
# - aws-sigv4 (`sigv4a` feature, crates/gitlawb-node/Cargo.toml) ->
# PrivateKeySigner that signs transactions in `twigpine name`
# (crates/twigpine-cli/src/name.rs) and the node operator
# (crates/twigpine-node/src/operator.rs).
# - aws-sigv4 (`sigv4a` feature, crates/twigpine-node/Cargo.toml) ->
# crypto-bigint 0.5 (directly and via p256 0.13): SigV4a key
# derivation, used only for requests to endpoints that require SigV4a
# (e.g. S3 Multi-Region Access Points).
Expand All @@ -62,7 +62,7 @@ ignore = [
# libsqlite3-sys 0.30.1 (bundled SQLite WAL uninitialized-memory disclosure,
# CVE-2026-119375). Present in Cargo.lock because sqlx resolves sqlx-sqlite
# unconditionally; sqlx is built postgres-only
# (crates/gitlawb-node/Cargo.toml), so sqlx-sqlite and its bundled SQLite C
# (crates/twigpine-node/Cargo.toml), so sqlx-sqlite and its bundled SQLite C
# source are never compiled or linked (`cargo tree -i sqlx-sqlite` prints
# nothing) and there is no reachable WAL open to attack. The fix requires
# libsqlite3-sys >= 0.39, but sqlx-sqlite 0.8.6 pins ^0.30.1; a compatible
Expand Down
8 changes: 4 additions & 4 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
# directory: a trailing slash, a final `.` or `..`, and `..` traversal are
# refused so the path cannot retarget a parent. A `~/` value must stay under
# home after expansion, and the path must be absolute: its parent is also
# the delegation store that `gl ucan import` writes and `git-remote-gitlawb`
# the delegation store that `twigpine ucan import` writes and `git-remote-twigpine`
# reads, and the two do not share a working directory, so a relative path
# sends them to different places. Bare `identity.pem` under the default
# config dir is still legal.
# Generate with: gl identity new
# Generate with: twigpine identity new
# Leaving it unset uses ~/.gitlawb/identity.pem, which is the shared default
# for both `gl` and `git-remote-gitlawb`. The bare-filename form is for the
# for both `twigpine` and `git-remote-twigpine`. The bare-filename form is for the
# node's own service config; client tooling should inherit the default or use
# an absolute path.
GITLAWB_KEY=/data/keys/identity.pem
Expand Down Expand Up @@ -47,7 +47,7 @@ GITLAWB_KEY=/data/keys/identity.pem
# Publicly reachable URL of this node (used in peer announcements)
GITLAWB_PUBLIC_URL=https://your-node.example.com

# Base URL for the web view of repos on this node (used by `gl` to print a
# Base URL for the web view of repos on this node (used by `twigpine` to print a
# working View: link after repo creation). Omit for nodes with no web front-end.
# Distinct from GITLAWB_PUBLIC_URL: that is API reachability for peers;
# this is browser reachability for humans.
Expand Down
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ body:
attributes:
label: Affected crate
options:
- gitlawb-node
- gl
- git-remote-gitlawb
- gitlawb-core
- twigpine-node
- twigpine-cli
- git-remote-twigpine
- twigpine-core
- not sure / other
validations:
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Closes #
## What changed

<!-- Bullet the concrete changes. Note the crate(s) touched:
gitlawb-core / gitlawb-node / gl / git-remote-gitlawb -->
twigpine-core / twigpine-node / twigpine-cli / git-remote-twigpine -->

-

Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ jobs:
- name: cargo test (real-node deny harness)
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/gitlawb_test
run: cargo test --locked -p gitlawb-node --features test-harness --lib --test deny_harness
run: cargo test --locked -p twigpine-node --features test-harness --lib --test deny_harness

build-release:
name: build --release
Expand Down Expand Up @@ -341,19 +341,19 @@ jobs:
persist-credentials: false

- name: Build image
run: docker build -t gitlawb-node:ci-test .
run: docker build -t twigpine-node:ci-test .

- name: Smoke test --version
run: docker run --rm gitlawb-node:ci-test --version
run: docker run --rm twigpine-node:ci-test --version

test-windows:
name: test (windows, non-blocking)
needs: changes
if: needs.changes.outputs.windows == 'true'
runs-on: windows-latest
timeout-minutes: 45
# Non-blocking, mirroring the informational `beta` lane above. We ship `gl`
# and `git-remote-gitlawb` to Windows users (release.yml) with zero Windows
# Non-blocking, mirroring the informational `beta` lane above. We ship `twigpine`
# and `git-remote-twigpine` to Windows users (release.yml) with zero Windows
# test coverage, so run their suites here to make Windows-only regressions
# VISIBLE on the PR without gating merge (#228). These two are the client
# CLIs and depend on no database, so no Postgres service is needed (service
Expand All @@ -379,20 +379,20 @@ jobs:
- name: cargo test (shipped Windows crates)
shell: bash
env:
# `-p gl -p git-remote-gitlawb`, or whichever of the two a PR affects.
# `-p twigpine-cli -p git-remote-twigpine`, or whichever of the two a PR affects.
PACKAGES: ${{ needs.changes.outputs.windows_packages }}
run: |
# shellcheck disable=SC2086 # PACKAGES is a word list by design
cargo test --locked $PACKAGES

# gitlawb-core is embedded by every consumer (gl, git-remote-gitlawb, the node
# daemon), so it must stay lean. This gate fails if gitlawb-core's normal
# twigpine-core is embedded by every consumer (twigpine, git-remote-twigpine, the node
# daemon), so it must stay lean. This gate fails if twigpine-core's normal
# (non-dev, non-build) dependency tree gains any crate not on the allowlist in
# ci/gitlawb-core-allowed-deps.txt. Exhaustive-by-construction: a new heavy
# ci/twigpine-core-allowed-deps.txt. Exhaustive-by-construction: a new heavy
# dependency reds CI whether or not anyone thought to ban it, which a denylist
# cannot do. Regen instructions live in the allowlist header.
core-deps-purity:
name: gitlawb-core dependency purity
name: twigpine-core dependency purity
needs: changes
if: needs.changes.outputs.core_deps == 'true'
runs-on: ubuntu-latest
Expand All @@ -413,8 +413,8 @@ jobs:
with:
key: core-deps-purity

- name: Check gitlawb-core dependency allowlist
run: bash scripts/check-gitlawb-core-deps.sh
- name: Check twigpine-core dependency allowlist
run: bash scripts/check-twigpine-core-deps.sh

# release-please only rewrites a crate's version when the line carries the
# `# x-release-please-version` annotation AND the manifest is listed under
Expand Down
73 changes: 39 additions & 34 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ on:
# Manual backfill: republish an already-cut release to a channel that
# missed it. Fill in only the channel(s) you want — an empty input leaves
# that channel's jobs skipped. npm reuses the existing release's binary
# assets; docker rebuilds the image from the tag and re-tags the manifest.
# assets, so it only works for releases cut after the Twigpine rename (their
# archives are named twigpine-node-*); docker rebuilds the image from the tag and re-tags the manifest.
workflow_dispatch:
inputs:
npm_backfill_tag:
Expand Down Expand Up @@ -270,7 +271,7 @@ jobs:
context: .
platforms: ${{ matrix.platform }}
load: true
tags: gitlawb-node:smoke
tags: twigpine-node:smoke
cache-from: type=gha,scope=docker-${{ matrix.arch }}

# Native runner on both arches, so the built image can always execute.
Expand All @@ -280,7 +281,7 @@ jobs:
VERSION: ${{ steps.rel.outputs.version }}
run: |
set -euo pipefail
out="$(docker run --rm gitlawb-node:smoke --version)"
out="$(docker run --rm twigpine-node:smoke --version)"
echo "$out"
grep -qF "$VERSION" <<<"$out" || {
echo "::error::image --version did not report expected version $VERSION (got: $out)"
Expand Down Expand Up @@ -524,22 +525,30 @@ jobs:
with:
key: ${{ matrix.target }}

# The gitlawb-node daemon is a Linux/macOS service; on Windows we ship only
# The twigpine-node daemon is a Linux/macOS service; on Windows we ship only
# the two CLI binaries. A Windows-only failure must not block the release.
- name: Determine binaries
shell: bash
run: |
BINS="gl git-remote-gitlawb gitlawb-node"
case "${{ matrix.target }}" in *windows*) BINS="gl git-remote-gitlawb" ;; esac
BINS="twigpine git-remote-twigpine twigpine-node"
PKGS="-p twigpine-cli -p git-remote-twigpine -p twigpine-node"
case "${{ matrix.target }}" in
*windows*)
BINS="twigpine git-remote-twigpine"
PKGS="-p twigpine-cli -p git-remote-twigpine"
;;
esac
echo "BINS=$BINS" >> "$GITHUB_ENV"
echo "PKGS=$PKGS" >> "$GITHUB_ENV"

- name: Build
shell: bash
run: |
set -euo pipefail
args=""
for b in $BINS; do args="$args -p $b"; done
cargo build --release --locked --target ${{ matrix.target }} $args
# Packages, not --bin: selecting by package keeps each build's feature
# set to what those crates ask for, so the Windows CLI build does not
# pull in the daemon's dependency features.
cargo build --release --locked --target ${{ matrix.target }} $PKGS

# Run each packaged binary's --version so a broken release artifact fails the
# build instead of shipping. Every target builds on a matching-arch runner,
Expand Down Expand Up @@ -568,7 +577,7 @@ jobs:
run: |
set -euo pipefail
TARGET="${{ matrix.target }}"
NAME="gitlawb-node-${{ steps.rel.outputs.version }}-${TARGET}"
NAME="twigpine-node-${{ steps.rel.outputs.version }}-${TARGET}"
BIN_DIR="target/${TARGET}/release"
EXE=""
case "$TARGET" in *windows*) EXE=".exe" ;; esac
Expand Down Expand Up @@ -702,7 +711,7 @@ jobs:
for entry in $MAP; do
pkg="${entry%%:*}"
target="${entry#*:}"
archive="gitlawb-node-${VERSION}-${target}.tar.gz"
archive="twigpine-node-${VERSION}-${target}.tar.gz"
echo "==> $pkg <- $archive"
# Download by the asset id the resolver captured and uploader-
# checked, not by name: release assets are mutable, and an id can
Expand All @@ -717,9 +726,9 @@ jobs:
gh api "repos/$GITHUB_REPOSITORY/releases/assets/$asset_id" \
-H 'Accept: application/octet-stream' > "_dl/$archive"
tar -xzf "_dl/$archive" -C _dl
src="_dl/gitlawb-node-${VERSION}-${target}"
cp "$src/gl" "npm/packages/$pkg/gl"
cp "$src/git-remote-gitlawb" "npm/packages/$pkg/git-remote-gitlawb"
src="_dl/twigpine-node-${VERSION}-${target}"
cp "$src/twigpine" "npm/packages/$pkg/gl"
cp "$src/git-remote-twigpine" "npm/packages/$pkg/git-remote-gitlawb"
chmod +x "npm/packages/$pkg/gl" "npm/packages/$pkg/git-remote-gitlawb"
done

Expand Down Expand Up @@ -850,7 +859,7 @@ jobs:
# captured and uploader-checked. The *.sha256 sidecars are mutable
# release assets too; trusting them would trust the same surface.
sha() {
archive="gitlawb-node-${VERSION}-$1.tar.gz"
archive="twigpine-node-${VERSION}-$1.tar.gz"
want="$(printf '%s' "$archive" | base64 -w0)"
asset_id="$(printf '%s\n' "$ASSETS" | awk -v n="$want" '$1 == n {print $2; exit}')"
if [ -z "$asset_id" ]; then
Expand Down Expand Up @@ -880,42 +889,38 @@ jobs:

on_macos do
on_arm do
url "${base}/gitlawb-node-${VERSION}-aarch64-apple-darwin.tar.gz"
url "${base}/twigpine-node-${VERSION}-aarch64-apple-darwin.tar.gz"
sha256 "${SHA_MAC_ARM}"
end
on_intel do
url "${base}/gitlawb-node-${VERSION}-x86_64-apple-darwin.tar.gz"
url "${base}/twigpine-node-${VERSION}-x86_64-apple-darwin.tar.gz"
sha256 "${SHA_MAC_X64}"
end
end

on_linux do
on_arm do
url "${base}/gitlawb-node-${VERSION}-aarch64-unknown-linux-musl.tar.gz"
url "${base}/twigpine-node-${VERSION}-aarch64-unknown-linux-musl.tar.gz"
sha256 "${SHA_LNX_ARM}"
end
on_intel do
url "${base}/gitlawb-node-${VERSION}-x86_64-unknown-linux-musl.tar.gz"
url "${base}/twigpine-node-${VERSION}-x86_64-unknown-linux-musl.tar.gz"
sha256 "${SHA_LNX_X64}"
end
end

def install
bin.install "gl"
bin.install "git-remote-gitlawb"
end

def caveats
<<~CAVEATS
oh-my-zsh's git plugin aliases gl='git pull', which shadows this
binary in interactive shells. If \`gl\` prints "fatal: not a git
repository", run:
echo 'unalias gl 2>/dev/null' >> ~/.zshrc && source ~/.zshrc
CAVEATS
bin.install "twigpine"
bin.install "git-remote-twigpine"
# The short form, and the names used before the rename: existing
# clones and scripts still call them.
bin.install_symlink bin/"twigpine" => "twig"
bin.install_symlink bin/"twigpine" => "gl"
bin.install_symlink bin/"git-remote-twigpine" => "git-remote-gitlawb"
end

test do
assert_match version.to_s, shell_output("#{bin}/gl --version")
assert_match version.to_s, shell_output("#{bin}/twigpine --version")
end
end
EOF
Expand All @@ -936,7 +941,7 @@ jobs:
echo "Formula already up to date."
exit 0
fi
git commit -m "gl ${VERSION}"
git commit -m "twigpine ${VERSION}"
# Credentials are not persisted in .git/config; supply the token only for the push.
git push "https://x-access-token:${HOMEBREW_TAP_PAT}@github.com/Twigpine/homebrew-tap.git" HEAD:main

Expand Down Expand Up @@ -1010,8 +1015,8 @@ jobs:
gh release view "$TAG" --repo "$GITHUB_REPOSITORY" --json assets \
--jq '.assets[].name' > /tmp/release-assets
for asset in \
"gitlawb-node-${VERSION}-x86_64-pc-windows-msvc.zip" \
"gitlawb-node-${VERSION}-x86_64-pc-windows-msvc.zip.sha256"; do
"twigpine-node-${VERSION}-x86_64-pc-windows-msvc.zip" \
"twigpine-node-${VERSION}-x86_64-pc-windows-msvc.zip.sha256"; do
grep -Fxq "$asset" /tmp/release-assets || {
echo "::error::release asset missing: $asset (Windows build likely failed); not syncing web"
exit 1
Expand Down
Loading
Loading