@astrofoundry/astrogate 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -0
- package/cli/astrogate.sh +521 -0
- package/cli/astrogate.test.ts +186 -0
- package/cli/verify-release.sh +77 -0
- package/cli/verify-release.test.ts +140 -0
- package/package.json +4 -2
- package/release.sha256 +7 -2
- package/release.sha256.sig +2 -2
- package/tools.lock +12 -0
package/README.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
1
|
# Astrogate
|
|
2
2
|
|
|
3
3
|
Isolated agent workspaces on one host, each with its own specialists, a foreman, and a chat bridge, for the pi coding agent and Claude Code. See `CLAUDE.md` for the layout and `specialists/README.md` for the security model.
|
|
4
|
+
|
|
5
|
+
## First install on a host
|
|
6
|
+
|
|
7
|
+
The owner runs this once per host, in a terminal on that host. The trust anchor is this repo's `allowed_signers` with `cli/verify-release.sh`: run it in a checkout, or in a folder holding copies of both. It checks the npm tarball before anything from it runs as root.
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
v=0.1.3
|
|
11
|
+
d=$(mktemp -d) && curl -fsSL -o "$d/core.tgz" "https://registry.npmjs.org/@astrofoundry/astrogate/-/astrogate-$v.tgz" && mkdir "$d/check" && sh cli/verify-release.sh "$d/core.tgz" allowed_signers "$v" "$d/check" && sudo sh "$d/check/package/cli/astrogate.sh" core update "$v" --signers allowed_signers
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
After that, `sudo astrogate core update` installs the newest release with the tools it pins in `tools.lock`, `sudo astrogate core rollback` goes back one version, `astrogate tools` lists the tools, and `astrogate doctor` checks the core against its signature and runs each tool.
|
package/cli/astrogate.sh
ADDED
|
@@ -0,0 +1,521 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# astrogate: the host command for the Astrogate core and the tools it pins. Workspaces follow.
|
|
3
|
+
#
|
|
4
|
+
# astrogate core [status] the current core, the kept previous one, and the newest on npm
|
|
5
|
+
# sudo astrogate core update [<x.y.z>] the newest core on npm, or that version, and the tools it pins;
|
|
6
|
+
# the running core's verify-release.sh checks the core first, and
|
|
7
|
+
# each tool download must match the sha256 in the core's tools.lock
|
|
8
|
+
# sudo astrogate core rollback swaps the current core and the previous one, with their tools
|
|
9
|
+
# astrogate tools each tool's installed version and the version the core pins
|
|
10
|
+
# astrogate doctor read-only checks; exits 1 when one fails
|
|
11
|
+
#
|
|
12
|
+
# The first install runs this script from a tarball the owner checked with the repo's
|
|
13
|
+
# verify-release.sh, and adds `--signers <the repo's allowed_signers>`; root keeps that file
|
|
14
|
+
# in /usr/local/etc/astrogate. Root runs only system programs and files in root-owned folders;
|
|
15
|
+
# it runs a new tool only as nobody. macOS on Apple silicon only for now.
|
|
16
|
+
set -eu
|
|
17
|
+
PATH=/usr/bin:/bin:/usr/sbin:/sbin
|
|
18
|
+
export PATH
|
|
19
|
+
umask 022
|
|
20
|
+
|
|
21
|
+
BASE=/usr/local/libexec/astrogate
|
|
22
|
+
TOOLS=$BASE/tools
|
|
23
|
+
SIGNERS_DIR=/usr/local/etc/astrogate
|
|
24
|
+
SIGNERS=$SIGNERS_DIR/allowed_signers
|
|
25
|
+
COMMAND=/usr/local/bin/astrogate
|
|
26
|
+
REGISTRY=https://registry.npmjs.org
|
|
27
|
+
# Installed in this order: gcloud's check runs with the pinned Python.
|
|
28
|
+
TOOL_NAMES="node jq bw python gcloud"
|
|
29
|
+
|
|
30
|
+
usage() {
|
|
31
|
+
echo "usage: astrogate core [status] | core update [<x.y.z>] [--signers <allowed_signers>] | core rollback | tools | doctor" >&2
|
|
32
|
+
exit 2
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
fail() {
|
|
36
|
+
echo "astrogate: $*" >&2
|
|
37
|
+
exit 1
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
# x.y.z with plain decimal parts; the character check also rules out newlines.
|
|
41
|
+
valid_version() {
|
|
42
|
+
case "$1" in '' | *[!0-9.]*) return 1 ;; esac
|
|
43
|
+
printf '%s\n' "$1" | /usr/bin/grep -Eq '^(0|[1-9][0-9]{0,5})\.(0|[1-9][0-9]{0,5})\.(0|[1-9][0-9]{0,5})$'
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
# A python-build-standalone release: CPython x.y.z and the build date that names the release.
|
|
47
|
+
valid_python_version() {
|
|
48
|
+
case "$1" in '' | *[!0-9.+]*) return 1 ;; esac
|
|
49
|
+
printf '%s\n' "$1" | /usr/bin/grep -Eq '^(0|[1-9][0-9]{0,5})\.(0|[1-9][0-9]{0,5})\.(0|[1-9][0-9]{0,5})\+[0-9]{8}$'
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
# True when version $1 is older than version $2.
|
|
53
|
+
version_lt() {
|
|
54
|
+
old_ifs=$IFS
|
|
55
|
+
IFS=.
|
|
56
|
+
set -- $1 $2
|
|
57
|
+
IFS=$old_ifs
|
|
58
|
+
[ "$1" -lt "$4" ] && return 0
|
|
59
|
+
[ "$1" -gt "$4" ] && return 1
|
|
60
|
+
[ "$2" -lt "$5" ] && return 0
|
|
61
|
+
[ "$2" -gt "$5" ] && return 1
|
|
62
|
+
[ "$3" -lt "$6" ]
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
action=""
|
|
66
|
+
version=""
|
|
67
|
+
signers_arg=""
|
|
68
|
+
case "${1:-}" in
|
|
69
|
+
core)
|
|
70
|
+
action=${2:-status}
|
|
71
|
+
case "$action" in
|
|
72
|
+
status) [ $# -le 2 ] || usage ;;
|
|
73
|
+
update)
|
|
74
|
+
shift 2
|
|
75
|
+
while [ $# -gt 0 ]; do
|
|
76
|
+
case "$1" in
|
|
77
|
+
--signers)
|
|
78
|
+
[ $# -ge 2 ] && [ -z "$signers_arg" ] && [ -n "$2" ] || usage
|
|
79
|
+
signers_arg=$2
|
|
80
|
+
shift 2
|
|
81
|
+
;;
|
|
82
|
+
*)
|
|
83
|
+
[ -z "$version" ] && valid_version "$1" || usage
|
|
84
|
+
version=$1
|
|
85
|
+
shift
|
|
86
|
+
;;
|
|
87
|
+
esac
|
|
88
|
+
done
|
|
89
|
+
;;
|
|
90
|
+
rollback) [ $# -eq 2 ] || usage ;;
|
|
91
|
+
*) usage ;;
|
|
92
|
+
esac
|
|
93
|
+
;;
|
|
94
|
+
tools | doctor)
|
|
95
|
+
[ $# -eq 1 ] || usage
|
|
96
|
+
action=$1
|
|
97
|
+
;;
|
|
98
|
+
*) usage ;;
|
|
99
|
+
esac
|
|
100
|
+
|
|
101
|
+
[ "$(/usr/bin/uname -s)" = Darwin ] || fail "only macOS is supported yet"
|
|
102
|
+
|
|
103
|
+
# This script's folder, after the /usr/local/bin/astrogate link.
|
|
104
|
+
self=$0
|
|
105
|
+
while [ -L "$self" ]; do
|
|
106
|
+
target=$(/usr/bin/readlink "$self")
|
|
107
|
+
case "$target" in /*) self=$target ;; *) self=$(/usr/bin/dirname "$self")/$target ;; esac
|
|
108
|
+
done
|
|
109
|
+
HERE=$(cd "$(/usr/bin/dirname "$self")" && /bin/pwd -P)
|
|
110
|
+
|
|
111
|
+
# The version a link in $BASE names (current or previous), or nothing.
|
|
112
|
+
link_version() {
|
|
113
|
+
link_target=$(/usr/bin/readlink "$BASE/$1" 2>/dev/null || true)
|
|
114
|
+
case "$link_target" in
|
|
115
|
+
versions/*) valid_version "${link_target#versions/}" && printf '%s' "${link_target#versions/}" || true ;;
|
|
116
|
+
esac
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
# The newest version from npm's dist-tags answer on stdin, or nothing.
|
|
120
|
+
parse_latest() {
|
|
121
|
+
/usr/bin/sed -n 's/.*"latest":"\([0-9][0-9.]*\)".*/\1/p' | /usr/bin/head -n 1
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
latest_version() {
|
|
125
|
+
latest=$(/usr/bin/curl --proto '=https' --tlsv1.2 -fsS --max-time 20 "$REGISTRY/-/package/@astrofoundry%2fastrogate/dist-tags" 2>/dev/null | parse_latest || true)
|
|
126
|
+
valid_version "$latest" && printf '%s' "$latest" || true
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
fetch() {
|
|
130
|
+
/usr/bin/curl --proto '=https' --proto-redir '=https' --tlsv1.2 -fsSL --retry 2 --max-time 900 -o "$2" "$1" || fail "download failed: $1"
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
# A directory only root can change: owned by uid 0, not a link, writable by nobody else.
|
|
134
|
+
root_dir_problem() {
|
|
135
|
+
[ -d "$1" ] && [ ! -L "$1" ] || {
|
|
136
|
+
echo "$1 is not a directory"
|
|
137
|
+
return
|
|
138
|
+
}
|
|
139
|
+
set -- "$1" $(/usr/bin/stat -f '%u %Lp' "$1")
|
|
140
|
+
[ "$2" = 0 ] || {
|
|
141
|
+
echo "$1 is not owned by root"
|
|
142
|
+
return
|
|
143
|
+
}
|
|
144
|
+
case "$3" in *[2367] | *[2367]?) echo "$1 is writable by group or others" ;; esac
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
check_root_dir() {
|
|
148
|
+
problem=$(root_dir_problem "$1")
|
|
149
|
+
[ -z "$problem" ] || fail "$problem"
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
ensure_root_dir() {
|
|
153
|
+
[ -e "$1" ] || { /bin/mkdir -m 0755 "$1" && /usr/sbin/chown root:wheel "$1"; }
|
|
154
|
+
check_root_dir "$1"
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
# Files in folder $1 that are not root's or that group or others can write, at most three.
|
|
158
|
+
unsafe_files() {
|
|
159
|
+
/usr/bin/find "$1" \( ! -user root -o -perm -0002 -o -perm -0020 \) -print 2>/dev/null | /usr/bin/head -n 3 | /usr/bin/tr '\n' ' '
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
# Points current at versions/$1, and previous at the version current named before.
|
|
163
|
+
switch_to() {
|
|
164
|
+
before=$(link_version current)
|
|
165
|
+
if [ -n "$before" ]; then
|
|
166
|
+
/bin/rm -f "$BASE/previous.new"
|
|
167
|
+
/bin/ln -s "versions/$before" "$BASE/previous.new"
|
|
168
|
+
/bin/mv -h "$BASE/previous.new" "$BASE/previous"
|
|
169
|
+
fi
|
|
170
|
+
/bin/rm -f "$BASE/current.new"
|
|
171
|
+
/bin/ln -s "versions/$1" "$BASE/current.new"
|
|
172
|
+
/bin/mv -h "$BASE/current.new" "$BASE/current"
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
# Removes every version that neither current nor previous names.
|
|
176
|
+
prune() {
|
|
177
|
+
keep_current=$(link_version current)
|
|
178
|
+
keep_previous=$(link_version previous)
|
|
179
|
+
for dir in "$BASE"/versions/*; do
|
|
180
|
+
[ -e "$dir" ] || continue
|
|
181
|
+
name=${dir##*/}
|
|
182
|
+
[ "$name" = "$keep_current" ] || [ "$name" = "$keep_previous" ] || /bin/rm -rf "$dir"
|
|
183
|
+
done
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
require_root() {
|
|
187
|
+
[ "$(/usr/bin/id -u)" = 0 ] || fail "run it as root: sudo astrogate core $action"
|
|
188
|
+
[ "$(/usr/bin/uname -m)" = arm64 ] || fail "only Apple silicon is supported yet"
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
# Root's work folder: only root can list it; nobody gets its own folder inside for tool checks.
|
|
192
|
+
make_work() {
|
|
193
|
+
work=$(/usr/bin/mktemp -d /private/var/tmp/astrogate.XXXXXX)
|
|
194
|
+
trap '/bin/rm -rf "$work"' EXIT
|
|
195
|
+
trap 'exit 1' HUP INT TERM
|
|
196
|
+
/bin/chmod 0711 "$work"
|
|
197
|
+
/bin/mkdir -m 0700 "$work/nobody"
|
|
198
|
+
/usr/sbin/chown nobody "$work/nobody"
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
# --- tools ------------------------------------------------------------------
|
|
202
|
+
|
|
203
|
+
tool_version_ok() {
|
|
204
|
+
case "$1" in python) valid_python_version "$2" ;; *) valid_version "$2" ;; esac
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
# The version core folder $1 pins for tool $2, or nothing.
|
|
208
|
+
pinned_version() {
|
|
209
|
+
[ -f "$1/tools.lock" ] || return 0
|
|
210
|
+
/usr/bin/awk -v t="$2" '$1 == t && NF == 4 { print $2; exit }' "$1/tools.lock"
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
# Fails unless core folder $1 has no tools.lock, or one whose lines are all
|
|
214
|
+
# "<tool> <version> <sha256> <https url>" with one valid version per tool.
|
|
215
|
+
check_lock() {
|
|
216
|
+
[ -f "$1/tools.lock" ] || return 0
|
|
217
|
+
bad_line=$(/usr/bin/awk -v names=" $TOOL_NAMES " '
|
|
218
|
+
/^#/ || NF == 0 { next }
|
|
219
|
+
NF != 4 || index(names, " " $1 " ") == 0 || length($3) != 64 || $3 !~ /^[0-9a-f]+$/ { print NR; exit }
|
|
220
|
+
$4 !~ /^https:\/\/(nodejs\.org|github\.com|dl\.google\.com)\/[A-Za-z0-9.\/_+-]+$/ { print NR; exit }
|
|
221
|
+
($1 in seen) && seen[$1] != $2 { print NR; exit }
|
|
222
|
+
{ seen[$1] = $2 }' "$1/tools.lock")
|
|
223
|
+
[ -z "$bad_line" ] || fail "$1/tools.lock line $bad_line is no <tool> <version> <sha256> <https url>, or pins a second version"
|
|
224
|
+
for tool in $TOOL_NAMES; do
|
|
225
|
+
pin=$(pinned_version "$1" "$tool")
|
|
226
|
+
[ -z "$pin" ] || tool_version_ok "$tool" "$pin" || fail "$1/tools.lock pins $tool $pin, which is no valid version"
|
|
227
|
+
done
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
# Runs a tool from / with a clean environment; as nobody when root runs this script, so root never runs a download.
|
|
231
|
+
run_tool() {
|
|
232
|
+
if [ "$(/usr/bin/id -u)" = 0 ]; then
|
|
233
|
+
(cd / && exec /usr/bin/sudo -n -u nobody /usr/bin/env -i PATH=/usr/bin:/bin:/usr/sbin:/sbin HOME=/var/empty "$@")
|
|
234
|
+
else
|
|
235
|
+
(cd / && exec /usr/bin/env -i PATH=/usr/bin:/bin:/usr/sbin:/sbin HOME="$HOME" "$@")
|
|
236
|
+
fi
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
# True when tool $1 in folder $3 answers with version $2. $4 is a folder the runner can write;
|
|
240
|
+
# gcloud runs with the Python folder $5.
|
|
241
|
+
tool_answers() {
|
|
242
|
+
case "$1" in
|
|
243
|
+
node) [ "$(run_tool "$3/bin/node" --version 2>/dev/null)" = "v$2" ] ;;
|
|
244
|
+
jq) [ "$(run_tool "$3/jq" --version 2>/dev/null)" = "jq-$2" ] ;;
|
|
245
|
+
bw) [ "$(run_tool BITWARDENCLI_APPDATA_DIR="$4" "$3/bw" --version 2>/dev/null)" = "$2" ] ;;
|
|
246
|
+
python) [ "$(run_tool "$3/bin/python3" -c 'import ssl, sqlite3, sys; print("%d.%d.%d" % sys.version_info[:3])' 2>/dev/null)" = "${2%+*}" ] ;;
|
|
247
|
+
gcloud) [ "$(run_tool CLOUDSDK_PYTHON="$5/bin/python3" CLOUDSDK_CONFIG="$4" CLOUDSDK_CORE_DISABLE_PROMPTS=1 "$3/bin/gcloud" version 2>/dev/null | /usr/bin/head -n 1)" = "Google Cloud SDK $2" ] ;;
|
|
248
|
+
*) return 1 ;;
|
|
249
|
+
esac
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
unpack_tool() {
|
|
253
|
+
case "$1" in
|
|
254
|
+
node | python) /usr/bin/tar -xzf "$2" --no-same-owner --strip-components 1 -C "$3" ;;
|
|
255
|
+
gcloud) /usr/bin/tar -xzf "$2" --no-same-owner -C "$3" ;;
|
|
256
|
+
bw) /usr/bin/unzip -q "$2" bw -d "$3" && /bin/chmod 0755 "$3/bw" ;;
|
|
257
|
+
jq) /usr/bin/install -m 0755 "$2" "$3/jq" ;;
|
|
258
|
+
esac
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
# Installs tool $2 at the version core folder $1 pins: every download must match its sha256,
|
|
262
|
+
# and the tool must answer with its version, run as nobody, before it moves into place.
|
|
263
|
+
install_tool() {
|
|
264
|
+
core=$1 tool=$2
|
|
265
|
+
pin=$(pinned_version "$core" "$tool")
|
|
266
|
+
dest=$TOOLS/$tool/$pin
|
|
267
|
+
/bin/rm -rf "$work/$tool" "$dest.partial"
|
|
268
|
+
/bin/mkdir "$work/$tool"
|
|
269
|
+
/bin/mkdir -m 0755 "$dest.partial"
|
|
270
|
+
downloads=$(/usr/bin/awk -v t="$tool" '$1 == t && NF == 4 { print $3, $4 }' "$core/tools.lock")
|
|
271
|
+
while read -r sum url; do
|
|
272
|
+
file=$work/$tool/${url##*/}
|
|
273
|
+
fetch "$url" "$file"
|
|
274
|
+
[ "$(/usr/bin/shasum -a 256 "$file" | /usr/bin/cut -d' ' -f1)" = "$sum" ] || fail "checksum mismatch for $url"
|
|
275
|
+
unpack_tool "$tool" "$file" "$dest.partial" || fail "cannot unpack $url"
|
|
276
|
+
done <<EOF
|
|
277
|
+
$downloads
|
|
278
|
+
EOF
|
|
279
|
+
/usr/sbin/chown -R root:wheel "$dest.partial"
|
|
280
|
+
/bin/chmod -R u=rwX,go=rX "$dest.partial"
|
|
281
|
+
tool_answers "$tool" "$pin" "$dest.partial" "$work/nobody" "$TOOLS/python/$(pinned_version "$core" python)" ||
|
|
282
|
+
fail "$tool $pin does not answer with its version; nothing changed"
|
|
283
|
+
/bin/mv "$dest.partial" "$dest"
|
|
284
|
+
echo "installed $tool $pin"
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
# Installs every tool version core folder $1 pins that is not there yet; switches nothing.
|
|
288
|
+
stage_tools() {
|
|
289
|
+
check_lock "$1"
|
|
290
|
+
[ -f "$1/tools.lock" ] || return 0
|
|
291
|
+
ensure_root_dir "$TOOLS"
|
|
292
|
+
for tool in $TOOL_NAMES; do
|
|
293
|
+
pin=$(pinned_version "$1" "$tool")
|
|
294
|
+
[ -n "$pin" ] || continue
|
|
295
|
+
ensure_root_dir "$TOOLS/$tool"
|
|
296
|
+
[ -d "$TOOLS/$tool/$pin" ] || install_tool "$1" "$tool"
|
|
297
|
+
done
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
# Points each tool's current link at the version core folder $1 pins.
|
|
301
|
+
link_tools() {
|
|
302
|
+
[ -f "$1/tools.lock" ] || return 0
|
|
303
|
+
for tool in $TOOL_NAMES; do
|
|
304
|
+
pin=$(pinned_version "$1" "$tool")
|
|
305
|
+
[ -n "$pin" ] && [ -d "$TOOLS/$tool/$pin" ] || continue
|
|
306
|
+
[ "$(/usr/bin/readlink "$TOOLS/$tool/current" 2>/dev/null || true)" != "$pin" ] || continue
|
|
307
|
+
/bin/rm -f "$TOOLS/$tool/current.new"
|
|
308
|
+
/bin/ln -s "$pin" "$TOOLS/$tool/current.new"
|
|
309
|
+
/bin/mv -h "$TOOLS/$tool/current.new" "$TOOLS/$tool/current"
|
|
310
|
+
echo "$tool $pin is current"
|
|
311
|
+
done
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
# Removes the tool versions, and the tools, that neither the current nor the previous core pins.
|
|
315
|
+
prune_tools() {
|
|
316
|
+
for tool_dir in "$TOOLS"/*; do
|
|
317
|
+
[ -d "$tool_dir" ] && [ ! -L "$tool_dir" ] || continue
|
|
318
|
+
tool=${tool_dir##*/}
|
|
319
|
+
keep_current=$(pinned_version "$BASE/current" "$tool")
|
|
320
|
+
keep_previous=$(pinned_version "$BASE/previous" "$tool")
|
|
321
|
+
if [ -z "$keep_current" ] && [ -z "$keep_previous" ]; then
|
|
322
|
+
/bin/rm -rf "$tool_dir"
|
|
323
|
+
continue
|
|
324
|
+
fi
|
|
325
|
+
for dir in "$tool_dir"/*; do
|
|
326
|
+
[ -e "$dir" ] || [ -L "$dir" ] || continue
|
|
327
|
+
name=${dir##*/}
|
|
328
|
+
[ "$name" = current ] || [ "$name" = "$keep_current" ] || [ "$name" = "$keep_previous" ] || /bin/rm -rf "$dir"
|
|
329
|
+
done
|
|
330
|
+
done
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
tools_status() {
|
|
334
|
+
current=$(link_version current)
|
|
335
|
+
[ -n "$current" ] || fail "no core is installed"
|
|
336
|
+
if [ ! -f "$BASE/current/tools.lock" ]; then
|
|
337
|
+
echo "core $current pins no tools"
|
|
338
|
+
return 0
|
|
339
|
+
fi
|
|
340
|
+
for tool in $TOOL_NAMES; do
|
|
341
|
+
pin=$(pinned_version "$BASE/current" "$tool")
|
|
342
|
+
[ -n "$pin" ] || continue
|
|
343
|
+
have=$(/usr/bin/readlink "$TOOLS/$tool/current" 2>/dev/null || true)
|
|
344
|
+
if [ "$have" = "$pin" ]; then echo "$tool $pin"; else echo "$tool ${have:-missing}; core $current pins $pin (sudo astrogate core update)"; fi
|
|
345
|
+
done
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
# --- core -------------------------------------------------------------------
|
|
349
|
+
|
|
350
|
+
core_status() {
|
|
351
|
+
current=$(link_version current)
|
|
352
|
+
previous=$(link_version previous)
|
|
353
|
+
latest=$(latest_version)
|
|
354
|
+
echo "core ${current:-not installed}${previous:+, previous $previous}, newest on npm ${latest:-unknown}"
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
core_update() {
|
|
358
|
+
require_root
|
|
359
|
+
check_root_dir /
|
|
360
|
+
check_root_dir /usr
|
|
361
|
+
check_root_dir /usr/local
|
|
362
|
+
ensure_root_dir /usr/local/libexec
|
|
363
|
+
ensure_root_dir "$BASE"
|
|
364
|
+
ensure_root_dir "$BASE/versions"
|
|
365
|
+
if [ -f "$SIGNERS" ]; then
|
|
366
|
+
[ -z "$signers_arg" ] || /usr/bin/cmp -s "$signers_arg" "$SIGNERS" || fail "$SIGNERS exists and differs from $signers_arg; replace it by hand when the signing key changes"
|
|
367
|
+
signers=$SIGNERS
|
|
368
|
+
else
|
|
369
|
+
[ -n "$signers_arg" ] && [ -f "$signers_arg" ] || fail "no $SIGNERS yet: the first install needs --signers <the repo's allowed_signers>"
|
|
370
|
+
signers=$signers_arg
|
|
371
|
+
fi
|
|
372
|
+
current=$(link_version current)
|
|
373
|
+
if [ -z "$version" ]; then
|
|
374
|
+
version=$(latest_version)
|
|
375
|
+
[ -n "$version" ] || fail "cannot read the newest version from $REGISTRY"
|
|
376
|
+
if [ -n "$current" ] && version_lt "$version" "$current"; then
|
|
377
|
+
fail "npm names $version as newest, older than the installed $current; name a version to go back"
|
|
378
|
+
fi
|
|
379
|
+
fi
|
|
380
|
+
make_work
|
|
381
|
+
if [ "$version" = "$current" ]; then
|
|
382
|
+
stage_tools "$BASE/current"
|
|
383
|
+
link_tools "$BASE/current"
|
|
384
|
+
echo "core $current is installed, with the tools it pins"
|
|
385
|
+
return 0
|
|
386
|
+
fi
|
|
387
|
+
# The installed core checks a new one; only the first install uses the copy next to this script.
|
|
388
|
+
if [ -n "$current" ]; then verifier=$BASE/current/cli/verify-release.sh; else verifier=$HERE/verify-release.sh; fi
|
|
389
|
+
[ -f "$verifier" ] || fail "$verifier is missing"
|
|
390
|
+
|
|
391
|
+
fetch "$REGISTRY/@astrofoundry/astrogate/-/astrogate-$version.tgz" "$work/core.tgz"
|
|
392
|
+
/bin/mkdir "$work/check"
|
|
393
|
+
/bin/sh "$verifier" "$work/core.tgz" "$signers" "$version" "$work/check" >/dev/null
|
|
394
|
+
|
|
395
|
+
target=$BASE/versions/$version
|
|
396
|
+
/bin/rm -rf "$target.new"
|
|
397
|
+
/bin/mv "$work/check/package" "$target.new"
|
|
398
|
+
/usr/sbin/chown -R root:wheel "$target.new"
|
|
399
|
+
/bin/chmod -R u+rwX,go+rX,go-w "$target.new"
|
|
400
|
+
/bin/chmod 0755 "$target.new/cli/astrogate.sh" "$target.new/cli/verify-release.sh"
|
|
401
|
+
/bin/rm -rf "$target"
|
|
402
|
+
/bin/mv "$target.new" "$target"
|
|
403
|
+
# Every tool the new core pins is in place before anything switches.
|
|
404
|
+
stage_tools "$target"
|
|
405
|
+
switch_to "$version"
|
|
406
|
+
link_tools "$BASE/current"
|
|
407
|
+
prune
|
|
408
|
+
prune_tools
|
|
409
|
+
|
|
410
|
+
if [ ! -f "$SIGNERS" ]; then
|
|
411
|
+
ensure_root_dir /usr/local/etc
|
|
412
|
+
ensure_root_dir "$SIGNERS_DIR"
|
|
413
|
+
/usr/bin/install -m 0644 -o root -g wheel "$signers" "$SIGNERS"
|
|
414
|
+
echo "installed $SIGNERS"
|
|
415
|
+
fi
|
|
416
|
+
ensure_root_dir /usr/local/bin
|
|
417
|
+
if [ "$(/usr/bin/readlink "$COMMAND" 2>/dev/null || true)" != "$BASE/current/cli/astrogate.sh" ]; then
|
|
418
|
+
/bin/ln -shf "$BASE/current/cli/astrogate.sh" "$COMMAND"
|
|
419
|
+
echo "linked $COMMAND"
|
|
420
|
+
fi
|
|
421
|
+
echo "core ${current:-none} -> $version${current:+; astrogate core rollback goes back to $current}"
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
core_rollback() {
|
|
425
|
+
require_root
|
|
426
|
+
current=$(link_version current)
|
|
427
|
+
previous=$(link_version previous)
|
|
428
|
+
[ -n "$previous" ] && [ -d "$BASE/versions/$previous" ] || fail "no previous core to roll back to"
|
|
429
|
+
make_work
|
|
430
|
+
stage_tools "$BASE/versions/$previous"
|
|
431
|
+
switch_to "$previous"
|
|
432
|
+
link_tools "$BASE/current"
|
|
433
|
+
echo "core $current -> $previous; astrogate core rollback again goes forward"
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
# --- doctor ---------------------------------------------------------------
|
|
437
|
+
|
|
438
|
+
failed=0
|
|
439
|
+
ok() { printf 'ok %s\n' "$*"; }
|
|
440
|
+
warn() { printf 'warn %s\n' "$*"; }
|
|
441
|
+
bad() {
|
|
442
|
+
printf 'FAIL %s\n' "$*"
|
|
443
|
+
failed=1
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
doctor_tools() {
|
|
447
|
+
if [ ! -f "$BASE/current/tools.lock" ]; then
|
|
448
|
+
warn "core $current pins no tools"
|
|
449
|
+
return 0
|
|
450
|
+
fi
|
|
451
|
+
scratch=$(/usr/bin/mktemp -d)
|
|
452
|
+
for tool in $TOOL_NAMES; do
|
|
453
|
+
pin=$(pinned_version "$BASE/current" "$tool")
|
|
454
|
+
[ -n "$pin" ] || continue
|
|
455
|
+
have=$(/usr/bin/readlink "$TOOLS/$tool/current" 2>/dev/null || true)
|
|
456
|
+
if [ "$have" != "$pin" ]; then
|
|
457
|
+
bad "$tool is ${have:-missing}; core $current pins $pin (sudo astrogate core update)"
|
|
458
|
+
continue
|
|
459
|
+
fi
|
|
460
|
+
problem=$(root_dir_problem "$TOOLS/$tool/$pin")
|
|
461
|
+
[ -n "$problem" ] || problem=$(unsafe_files "$TOOLS/$tool/$pin")
|
|
462
|
+
if [ -n "$problem" ]; then
|
|
463
|
+
bad "$tool $pin is not root-only: $problem"
|
|
464
|
+
elif tool_answers "$tool" "$pin" "$TOOLS/$tool/current" "$scratch" "$TOOLS/python/current"; then
|
|
465
|
+
ok "$tool $pin"
|
|
466
|
+
else
|
|
467
|
+
bad "$tool $pin does not answer with its version"
|
|
468
|
+
fi
|
|
469
|
+
done
|
|
470
|
+
/bin/rm -rf "$scratch"
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
doctor() {
|
|
474
|
+
printf 'astrogate doctor on %s, macOS %s on %s\n' "$(/bin/hostname -s)" "$(/usr/bin/sw_vers -productVersion)" "$(/usr/bin/uname -m)"
|
|
475
|
+
current=$(link_version current)
|
|
476
|
+
if [ -z "$current" ] || [ ! -d "$BASE/versions/$current" ]; then
|
|
477
|
+
bad "no core in $BASE/current: install it (README, First install)"
|
|
478
|
+
exit 1
|
|
479
|
+
fi
|
|
480
|
+
problems=""
|
|
481
|
+
for dir in / /usr /usr/local /usr/local/libexec "$BASE" "$BASE/versions" "$BASE/versions/$current"; do
|
|
482
|
+
problem=$(root_dir_problem "$dir")
|
|
483
|
+
[ -z "$problem" ] || problems="$problems; $problem"
|
|
484
|
+
done
|
|
485
|
+
unsafe=$(unsafe_files "$BASE/versions/$current")
|
|
486
|
+
[ -z "$unsafe" ] || problems="$problems; not root-only: $unsafe"
|
|
487
|
+
if [ -z "$problems" ]; then ok "core folders are root-only"; else bad "core folders${problems}"; fi
|
|
488
|
+
|
|
489
|
+
if [ -f "$SIGNERS" ] && [ "$(/usr/bin/stat -f '%u %Lp' "$SIGNERS")" = "0 644" ]; then
|
|
490
|
+
ok "$SIGNERS"
|
|
491
|
+
if result=$(/bin/sh "$BASE/current/cli/verify-release.sh" --tree "$BASE/versions/$current" "$SIGNERS" "$current" 2>&1); then
|
|
492
|
+
ok "core $current matches its signed release.sha256"
|
|
493
|
+
else
|
|
494
|
+
bad "core $current: $result"
|
|
495
|
+
fi
|
|
496
|
+
else
|
|
497
|
+
bad "$SIGNERS is missing or not root with mode 644"
|
|
498
|
+
fi
|
|
499
|
+
|
|
500
|
+
latest=$(latest_version)
|
|
501
|
+
if [ -z "$latest" ]; then
|
|
502
|
+
warn "cannot read the newest core from $REGISTRY"
|
|
503
|
+
elif version_lt "$current" "$latest"; then
|
|
504
|
+
warn "core $current; $latest is published (sudo astrogate core update)"
|
|
505
|
+
else
|
|
506
|
+
ok "core $current is the newest"
|
|
507
|
+
fi
|
|
508
|
+
previous=$(link_version previous)
|
|
509
|
+
if [ -n "$previous" ] && [ -d "$BASE/versions/$previous" ]; then ok "previous core $previous kept for rollback"; else warn "no previous core to roll back to"; fi
|
|
510
|
+
if [ "$(/usr/bin/readlink "$COMMAND" 2>/dev/null || true)" = "$BASE/current/cli/astrogate.sh" ]; then ok "$COMMAND"; else bad "$COMMAND does not link to $BASE/current/cli/astrogate.sh"; fi
|
|
511
|
+
doctor_tools
|
|
512
|
+
[ "$failed" = 0 ] || exit 1
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
case "$action" in
|
|
516
|
+
status) core_status ;;
|
|
517
|
+
update) core_update ;;
|
|
518
|
+
rollback) core_rollback ;;
|
|
519
|
+
tools) tools_status ;;
|
|
520
|
+
doctor) doctor ;;
|
|
521
|
+
esac
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
import { existsSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, readlinkSync, rmSync, symlinkSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { tmpdir } from "node:os";
|
|
4
|
+
import { join } from "node:path";
|
|
5
|
+
import { describe, expect, it } from "vitest";
|
|
6
|
+
|
|
7
|
+
const SCRIPT = join(import.meta.dirname, "astrogate.sh");
|
|
8
|
+
const isRoot = process.getuid?.() === 0;
|
|
9
|
+
const isMac = process.platform === "darwin";
|
|
10
|
+
const REPO = join(import.meta.dirname, "..");
|
|
11
|
+
const SHA = "a".repeat(64);
|
|
12
|
+
const TOOL_FUNCTIONS = ["fail", "valid_version", "valid_python_version", "tool_version_ok", "pinned_version", "check_lock"];
|
|
13
|
+
|
|
14
|
+
function astrogate(...args: string[]) {
|
|
15
|
+
return spawnSync("/bin/sh", [SCRIPT, ...args], { encoding: "utf-8" });
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** Runs the named shell functions of the script on their own, followed by `call`. */
|
|
19
|
+
function shellFunctions(names: string[], call: string) {
|
|
20
|
+
const source = readFileSync(SCRIPT, "utf-8");
|
|
21
|
+
const bodies = names.map((name) => {
|
|
22
|
+
const match = new RegExp(`^${name}\\(\\) \\{\\n[\\s\\S]*?^\\}`, "m").exec(source);
|
|
23
|
+
if (!match) throw new Error(`${name} not found in the script`);
|
|
24
|
+
return match[0];
|
|
25
|
+
});
|
|
26
|
+
return spawnSync("/bin/sh", ["-c", `set -eu\n${bodies.join("\n")}\n${call}`], { encoding: "utf-8" });
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
describe("astrogate", () => {
|
|
30
|
+
it("parses as POSIX sh", () => {
|
|
31
|
+
expect(spawnSync("/bin/sh", ["-n", SCRIPT]).status).toBe(0);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it.each([
|
|
35
|
+
[[]],
|
|
36
|
+
[["core", "status", "now"]],
|
|
37
|
+
[["core", "bogus"]],
|
|
38
|
+
[["core", "update", "1.2"]],
|
|
39
|
+
[["core", "update", "v1.2.3"]],
|
|
40
|
+
[["core", "update", "01.2.3"]],
|
|
41
|
+
[["core", "update", "1.2.3\nrm"]],
|
|
42
|
+
[["core", "update", "1.2.3", "1.2.4"]],
|
|
43
|
+
[["core", "update", "--signers"]],
|
|
44
|
+
[["core", "update", "--signers", ""]],
|
|
45
|
+
[["core", "update", "--signers", "a", "--signers", "b"]],
|
|
46
|
+
[["core", "rollback", "1.2.3"]],
|
|
47
|
+
[["doctor", "now"]],
|
|
48
|
+
[["tools", "now"]],
|
|
49
|
+
[["update"]],
|
|
50
|
+
])("refuses %j with a usage error before anything else", (args) => {
|
|
51
|
+
const result = astrogate(...args);
|
|
52
|
+
expect(result.status).toBe(2);
|
|
53
|
+
expect(result.stderr).toMatch(/^usage: astrogate/);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it.runIf(isMac && !isRoot).each([["update"], ["update", "1.2.3", "--signers", "x"], ["rollback"]])("refuses core %s without root", (...args) => {
|
|
57
|
+
const result = astrogate("core", ...args);
|
|
58
|
+
expect(result.status).toBe(1);
|
|
59
|
+
expect(result.stderr).toContain("run it as root: sudo astrogate core");
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it.each([
|
|
63
|
+
["0.1.9", "0.1.10", 0],
|
|
64
|
+
["0.1.10", "0.1.10", 1],
|
|
65
|
+
["0.2.0", "0.1.10", 1],
|
|
66
|
+
["0.9.200", "0.10.0", 0],
|
|
67
|
+
["1.0.0", "0.99.99", 1],
|
|
68
|
+
])("version_lt %s %s exits %i", (a, b, code) => {
|
|
69
|
+
expect(shellFunctions(["version_lt"], `version_lt ${a} ${b}`).status).toBe(code);
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
it.each([
|
|
73
|
+
['{"legacy-node20":"0.74.2","latest":"1.8.0"}', "1.8.0"],
|
|
74
|
+
['{"latest":"0.1.1"}', "0.1.1"],
|
|
75
|
+
['{"next":"2.0.0"}', ""],
|
|
76
|
+
["<html>error</html>", ""],
|
|
77
|
+
])("parse_latest reads %s", (answer, expected) => {
|
|
78
|
+
const result = shellFunctions(["parse_latest"], `printf '%s' '${answer}' | parse_latest`);
|
|
79
|
+
expect(result.status).toBe(0);
|
|
80
|
+
expect(result.stdout.trim()).toBe(expected);
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
it.runIf(isMac)("switches current and previous, prunes the rest, and rolls back by swapping", () => {
|
|
84
|
+
const base = mkdtempSync(join(tmpdir(), "astrogate-core-"));
|
|
85
|
+
try {
|
|
86
|
+
for (const v of ["1.0.0", "1.1.0", "1.2.0"]) mkdirSync(join(base, "versions", v), { recursive: true });
|
|
87
|
+
const run = (call: string) => shellFunctions(["valid_version", "link_version", "switch_to", "prune"], `BASE='${base}'\n${call}`);
|
|
88
|
+
const links = () => ({ current: readlinkSync(join(base, "current")), previous: readlinkSync(join(base, "previous")) });
|
|
89
|
+
|
|
90
|
+
expect(run("switch_to 1.0.0").status).toBe(0);
|
|
91
|
+
expect(readlinkSync(join(base, "current"))).toBe("versions/1.0.0");
|
|
92
|
+
expect(run("switch_to 1.1.0 && switch_to 1.2.0 && prune").status).toBe(0);
|
|
93
|
+
expect(links()).toEqual({ current: "versions/1.2.0", previous: "versions/1.1.0" });
|
|
94
|
+
expect(readdirSync(join(base, "versions")).sort()).toEqual(["1.1.0", "1.2.0"]);
|
|
95
|
+
|
|
96
|
+
expect(run('switch_to "$(link_version previous)"').status).toBe(0);
|
|
97
|
+
expect(links()).toEqual({ current: "versions/1.1.0", previous: "versions/1.2.0" });
|
|
98
|
+
expect(run("link_version current").stdout).toBe("1.1.0");
|
|
99
|
+
expect(readdirSync(base).sort()).toEqual(["current", "previous", "versions"]);
|
|
100
|
+
} finally {
|
|
101
|
+
rmSync(base, { recursive: true, force: true });
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
it("link_version ignores a link outside versions/ or with a bad version", () => {
|
|
106
|
+
const base = mkdtempSync(join(tmpdir(), "astrogate-core-"));
|
|
107
|
+
try {
|
|
108
|
+
const read = (target: string) => shellFunctions(["valid_version", "link_version"], `BASE='${base}'\nrm -f '${base}/current'\nln -s '${target}' '${base}/current'\nlink_version current`).stdout;
|
|
109
|
+
expect(read("versions/1.2.3")).toBe("1.2.3");
|
|
110
|
+
expect(read("/etc")).toBe("");
|
|
111
|
+
expect(read("versions/1.2")).toBe("");
|
|
112
|
+
expect(shellFunctions(["valid_version", "link_version"], `BASE='${base}'\nlink_version previous`).stdout).toBe("");
|
|
113
|
+
} finally {
|
|
114
|
+
rmSync(base, { recursive: true, force: true });
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
describe("tools.lock", () => {
|
|
119
|
+
const withLock = (lock: string, call: (dir: string) => string) => {
|
|
120
|
+
const dir = mkdtempSync(join(tmpdir(), "astrogate-lock-"));
|
|
121
|
+
try {
|
|
122
|
+
writeFileSync(join(dir, "tools.lock"), lock);
|
|
123
|
+
return shellFunctions(TOOL_FUNCTIONS, `TOOL_NAMES="node jq bw python gcloud"\n${call(dir)}`);
|
|
124
|
+
} finally {
|
|
125
|
+
rmSync(dir, { recursive: true, force: true });
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
it("accepts the committed tools.lock and reads its pins", () => {
|
|
130
|
+
const result = shellFunctions(TOOL_FUNCTIONS, `TOOL_NAMES="node jq bw python gcloud"\ncheck_lock '${REPO}'\nfor t in $TOOL_NAMES; do printf '%s=%s\\n' "$t" "$(pinned_version '${REPO}' "$t")"; done`);
|
|
131
|
+
expect(result.stderr).toBe("");
|
|
132
|
+
expect(result.stdout).toMatch(/^node=\d+\.\d+\.\d+\njq=\d+\.\d+\.\d+\nbw=\d+\.\d+\.\d+\npython=\d+\.\d+\.\d+\+\d{8}\ngcloud=\d+\.\d+\.\d+\n$/);
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
it("accepts a core without tools.lock", () => {
|
|
136
|
+
expect(shellFunctions(TOOL_FUNCTIONS, `TOOL_NAMES=node\ncheck_lock '${tmpdir()}/astrogate-no-such-core'`).status).toBe(0);
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
it.each([
|
|
140
|
+
["three fields", `jq 1.8.2 ${SHA}\n`],
|
|
141
|
+
["an unknown tool", `curl 8.0.0 ${SHA} https://github.com/x/curl\n`],
|
|
142
|
+
["a short sha256", `jq 1.8.2 ${SHA.slice(1)} https://github.com/x/jq\n`],
|
|
143
|
+
["an upper-case sha256", `jq 1.8.2 ${SHA.toUpperCase()} https://github.com/x/jq\n`],
|
|
144
|
+
["plain http", `jq 1.8.2 ${SHA} http://github.com/x/jq\n`],
|
|
145
|
+
["another host", `jq 1.8.2 ${SHA} https://example.com/x/jq\n`],
|
|
146
|
+
["a host that only starts like an allowed one", `jq 1.8.2 ${SHA} https://github.com.example.com/x/jq\n`],
|
|
147
|
+
["a query string", `jq 1.8.2 ${SHA} https://github.com/x/jq?y=1\n`],
|
|
148
|
+
["two versions of one tool", `gcloud 1.0.0 ${SHA} https://dl.google.com/a.tgz\ngcloud 1.0.1 ${SHA} https://dl.google.com/b.tgz\n`],
|
|
149
|
+
["a bad version", `node 26.14 ${SHA} https://nodejs.org/x.tgz\n`],
|
|
150
|
+
["a python version without its build date", `python 3.14.10 ${SHA} https://github.com/x/py.tgz\n`],
|
|
151
|
+
])("refuses %s", (_, lock) => {
|
|
152
|
+
const result = withLock(lock, (dir) => `check_lock '${dir}'`);
|
|
153
|
+
expect(result.status).toBe(1);
|
|
154
|
+
expect(result.stderr).toMatch(/^astrogate: .*tools\.lock (line \d+|pins)/);
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
it.runIf(isMac)("links the pinned tool versions and prunes the ones no kept core pins", () => {
|
|
159
|
+
const base = mkdtempSync(join(tmpdir(), "astrogate-tools-"));
|
|
160
|
+
try {
|
|
161
|
+
const tools = join(base, "tools");
|
|
162
|
+
const core = (v: string, lock: string) => {
|
|
163
|
+
mkdirSync(join(base, "versions", v), { recursive: true });
|
|
164
|
+
writeFileSync(join(base, "versions", v, "tools.lock"), lock);
|
|
165
|
+
};
|
|
166
|
+
core("1.0.0", `jq 1.8.1 ${SHA} https://github.com/x/jq\nbw 2026.1.0 ${SHA} https://github.com/x/bw\n`);
|
|
167
|
+
core("1.1.0", `jq 1.8.2 ${SHA} https://github.com/x/jq\n`);
|
|
168
|
+
for (const d of ["jq/1.8.0", "jq/1.8.1", "jq/1.8.2", "jq/1.8.2.partial", "bw/2026.1.0", "node/26.0.0"]) mkdirSync(join(tools, d), { recursive: true });
|
|
169
|
+
symlinkSync("1.8.0", join(tools, "jq", "current"));
|
|
170
|
+
const run = (call: string) =>
|
|
171
|
+
shellFunctions([...TOOL_FUNCTIONS, "link_version", "switch_to", "link_tools", "prune_tools"], `BASE='${base}'\nTOOLS='${tools}'\nTOOL_NAMES="node jq bw python gcloud"\n${call}`);
|
|
172
|
+
|
|
173
|
+
expect(run("switch_to 1.0.0 && switch_to 1.1.0 && link_tools \"$BASE/current\"").stdout).toBe("jq 1.8.2 is current\n");
|
|
174
|
+
expect(readlinkSync(join(tools, "jq", "current"))).toBe("1.8.2");
|
|
175
|
+
expect(run("prune_tools").status).toBe(0);
|
|
176
|
+
expect(readdirSync(join(tools, "jq")).sort()).toEqual(["1.8.1", "1.8.2", "current"]);
|
|
177
|
+
expect(readdirSync(join(tools, "bw"))).toEqual(["2026.1.0"]);
|
|
178
|
+
expect(existsSync(join(tools, "node"))).toBe(false);
|
|
179
|
+
|
|
180
|
+
expect(run('switch_to 1.0.0 && link_tools "$BASE/current"').stdout).toBe("jq 1.8.1 is current\nbw 2026.1.0 is current\n");
|
|
181
|
+
expect(readlinkSync(join(tools, "jq", "current"))).toBe("1.8.1");
|
|
182
|
+
} finally {
|
|
183
|
+
rmSync(base, { recursive: true, force: true });
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
});
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# Checks a core release before anything from it runs: a valid astrogate-core
|
|
3
|
+
# signature on release.sha256, every file listed with its hash, nothing unlisted,
|
|
4
|
+
# no links, and the expected version. CI runs it on the tarball it publishes; a
|
|
5
|
+
# host runs the installed core's copy on a downloaded tarball, and `astrogate
|
|
6
|
+
# doctor` runs it on the installed tree. It uses only system programs, so root
|
|
7
|
+
# can run it.
|
|
8
|
+
#
|
|
9
|
+
# verify-release.sh <tarball> <allowed_signers> <version> <empty folder>
|
|
10
|
+
# also refuses a tarball with anything but regular files under package/;
|
|
11
|
+
# the package lands in <folder>/package
|
|
12
|
+
# verify-release.sh --tree <package folder> <allowed_signers> <version>
|
|
13
|
+
set -eu
|
|
14
|
+
PATH=/usr/bin:/bin:/usr/sbin:/sbin
|
|
15
|
+
export PATH
|
|
16
|
+
|
|
17
|
+
usage() {
|
|
18
|
+
echo "usage: verify-release.sh <tarball> <allowed_signers> <version> <empty folder> | --tree <package folder> <allowed_signers> <version>" >&2
|
|
19
|
+
exit 2
|
|
20
|
+
}
|
|
21
|
+
fail() {
|
|
22
|
+
echo "verify-release: $*" >&2
|
|
23
|
+
exit 1
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
# x.y.z with plain decimal parts; the character check also rules out newlines.
|
|
27
|
+
valid_version() {
|
|
28
|
+
case "$1" in '' | *[!0-9.]*) return 1 ;; esac
|
|
29
|
+
printf '%s\n' "$1" | grep -Eq '^(0|[1-9][0-9]{0,5})\.(0|[1-9][0-9]{0,5})\.(0|[1-9][0-9]{0,5})$'
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
# Signature, hashes, listing, and version of an unpacked package folder.
|
|
33
|
+
check_tree() {
|
|
34
|
+
pkg=$1
|
|
35
|
+
[ -z "$(cd "$pkg" && find . ! -type f ! -type d)" ] || fail "$pkg holds links or other entries that are not files"
|
|
36
|
+
[ -f "$pkg/release.sha256" ] && [ -f "$pkg/release.sha256.sig" ] || fail "the package has no release.sha256 and signature"
|
|
37
|
+
ssh-keygen -Y verify -f "$signers" -I astrogate -n astrogate-core -s "$pkg/release.sha256.sig" <"$pkg/release.sha256" >/dev/null 2>&1 ||
|
|
38
|
+
fail "the signature on release.sha256 does not verify against $signers"
|
|
39
|
+
(cd "$pkg" && shasum -a 256 -c --quiet release.sha256 >/dev/null 2>&1) || fail "a file differs from release.sha256"
|
|
40
|
+
listed=$(cut -c67- "$pkg/release.sha256" | sort)
|
|
41
|
+
actual=$(cd "$pkg" && find . -type f ! -path ./release.sha256 ! -path ./release.sha256.sig | sed 's|^\./||' | sort)
|
|
42
|
+
[ "$listed" = "$actual" ] || fail "the package holds files release.sha256 does not list, or misses listed ones"
|
|
43
|
+
# The signed package.json keeps npm's two-space layout, so its one top-level version line is exact.
|
|
44
|
+
found=$(sed -n 's/^ "version": "\([0-9][0-9.]*\)",\{0,1\}$/\1/p' "$pkg/package.json")
|
|
45
|
+
[ "$found" = "$version" ] || fail "the package is version ${found:-unknown}, not $version"
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if [ "${1:-}" = --tree ]; then
|
|
49
|
+
[ $# -eq 4 ] || usage
|
|
50
|
+
pkg=$2 signers=$3 version=$4
|
|
51
|
+
valid_version "$version" || fail "$version is not a version like 1.2.3"
|
|
52
|
+
[ -d "$pkg" ] || fail "$pkg is not a folder"
|
|
53
|
+
[ -f "$signers" ] || fail "$signers is missing"
|
|
54
|
+
check_tree "$pkg"
|
|
55
|
+
echo "verify-release: @astrofoundry/astrogate $version in $pkg is signed and complete"
|
|
56
|
+
exit 0
|
|
57
|
+
fi
|
|
58
|
+
|
|
59
|
+
[ $# -eq 4 ] || usage
|
|
60
|
+
tarball=$1 signers=$2 version=$3 out=$4
|
|
61
|
+
valid_version "$version" || fail "$version is not a version like 1.2.3"
|
|
62
|
+
[ -f "$tarball" ] || fail "$tarball is missing"
|
|
63
|
+
[ -f "$signers" ] || fail "$signers is missing"
|
|
64
|
+
[ -d "$out" ] && [ -z "$(ls -A "$out")" ] || fail "$out must be an empty folder"
|
|
65
|
+
|
|
66
|
+
types=$(tar -tvzf "$tarball" | cut -c1 | sort -u)
|
|
67
|
+
[ "$types" = "-" ] || fail "$tarball holds entries other than regular files"
|
|
68
|
+
tar -tzf "$tarball" | while IFS= read -r name; do
|
|
69
|
+
case "$name" in
|
|
70
|
+
package/*) ;;
|
|
71
|
+
*) fail "$tarball has $name outside package/" ;;
|
|
72
|
+
esac
|
|
73
|
+
case "/$name/" in */../*) fail "$tarball has $name with .." ;; esac
|
|
74
|
+
done
|
|
75
|
+
tar -xzf "$tarball" --no-same-owner -C "$out"
|
|
76
|
+
check_tree "$out/package"
|
|
77
|
+
echo "verify-release: @astrofoundry/astrogate $version is signed and complete"
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { execFileSync, spawnSync } from "node:child_process";
|
|
2
|
+
import { mkdirSync, mkdtempSync, readFileSync, rmSync, symlinkSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { tmpdir } from "node:os";
|
|
4
|
+
import { join } from "node:path";
|
|
5
|
+
import { afterAll, beforeAll, describe, expect, it } from "vitest";
|
|
6
|
+
import { MANIFEST, manifestText, NAMESPACE, SIGNATURE } from "../scripts/manifest.ts";
|
|
7
|
+
|
|
8
|
+
const VERIFY = join(import.meta.dirname, "verify-release.sh");
|
|
9
|
+
let home: string;
|
|
10
|
+
let signers: string;
|
|
11
|
+
let n = 0;
|
|
12
|
+
|
|
13
|
+
function keygen(name: string): string {
|
|
14
|
+
const key = join(home, name);
|
|
15
|
+
execFileSync("ssh-keygen", ["-q", "-t", "ed25519", "-N", "", "-C", name, "-f", key]);
|
|
16
|
+
return key;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface Options {
|
|
20
|
+
version?: string;
|
|
21
|
+
key?: string;
|
|
22
|
+
namespace?: string;
|
|
23
|
+
afterSigning?: (pkg: string) => void;
|
|
24
|
+
extraEntries?: string[];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** A package/ tarball like `npm pack` makes, signed with the trusted key unless told otherwise. */
|
|
28
|
+
function tarball(options: Options = {}): string {
|
|
29
|
+
const pkg = signedPackage(options);
|
|
30
|
+
const dir = join(pkg, "..");
|
|
31
|
+
const entries = [...FILES, MANIFEST, SIGNATURE, ...(options.extraEntries ?? [])].map((f) => `package/${f}`);
|
|
32
|
+
const out = join(dir, "pkg.tgz");
|
|
33
|
+
execFileSync("tar", ["-czf", out, "-C", dir, ...entries], { env: { ...process.env, COPYFILE_DISABLE: "1" } });
|
|
34
|
+
return out;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const FILES = ["dist/bridge.js", "package.json"];
|
|
38
|
+
|
|
39
|
+
/** An unpacked package folder, signed with the trusted key unless told otherwise. */
|
|
40
|
+
function signedPackage(options: Options = {}): string {
|
|
41
|
+
const pkg = join(home, `pkg-${n++}`, "package");
|
|
42
|
+
mkdirSync(join(pkg, "dist"), { recursive: true });
|
|
43
|
+
writeFileSync(join(pkg, "package.json"), `${JSON.stringify({ name: "@astrofoundry/astrogate", version: "1.2.3" }, null, 2)}\n`);
|
|
44
|
+
writeFileSync(join(pkg, "dist", "bridge.js"), "console.log('bridge');\n");
|
|
45
|
+
writeFileSync(join(pkg, MANIFEST), manifestText(pkg, FILES));
|
|
46
|
+
execFileSync("ssh-keygen", ["-Y", "sign", "-q", "-f", options.key ?? join(home, "trusted"), "-n", options.namespace ?? NAMESPACE, join(pkg, MANIFEST)]);
|
|
47
|
+
options.afterSigning?.(pkg);
|
|
48
|
+
return pkg;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function verify(file: string, version = "1.2.3") {
|
|
52
|
+
const out = join(home, `out-${n++}`);
|
|
53
|
+
mkdirSync(out);
|
|
54
|
+
return spawnSync("sh", [VERIFY, file, signers, version, out], { encoding: "utf-8" });
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function verifyTree(pkg: string, version = "1.2.3") {
|
|
58
|
+
return spawnSync("sh", [VERIFY, "--tree", pkg, signers, version], { encoding: "utf-8" });
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
beforeAll(() => {
|
|
62
|
+
home = mkdtempSync(join(tmpdir(), "astrogate-verify-"));
|
|
63
|
+
const trusted = keygen("trusted");
|
|
64
|
+
keygen("stranger");
|
|
65
|
+
signers = join(home, "allowed_signers");
|
|
66
|
+
writeFileSync(signers, `astrogate namespaces="${NAMESPACE}" ${readFileSync(`${trusted}.pub`, "utf-8").split(" ").slice(0, 2).join(" ")}\n`);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
afterAll(() => rmSync(home, { recursive: true, force: true }));
|
|
70
|
+
|
|
71
|
+
describe("verify-release.sh", () => {
|
|
72
|
+
it("accepts a signed, complete package of the expected version", () => {
|
|
73
|
+
const result = verify(tarball());
|
|
74
|
+
expect(result.stderr).toBe("");
|
|
75
|
+
expect(result.status).toBe(0);
|
|
76
|
+
expect(result.stdout).toContain("1.2.3 is signed and complete");
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it("refuses a file changed after signing", () => {
|
|
80
|
+
const result = verify(tarball({ afterSigning: (pkg) => writeFileSync(join(pkg, "dist", "bridge.js"), "evil();\n") }));
|
|
81
|
+
expect(result.status).toBe(1);
|
|
82
|
+
expect(result.stderr).toContain("a file differs");
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it("refuses a file the manifest does not list", () => {
|
|
86
|
+
const result = verify(tarball({ afterSigning: (pkg) => writeFileSync(join(pkg, "dist", "extra.js"), "evil();\n"), extraEntries: ["dist/extra.js"] }));
|
|
87
|
+
expect(result.status).toBe(1);
|
|
88
|
+
expect(result.stderr).toContain("does not list");
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
it("refuses another version", () => {
|
|
92
|
+
const result = verify(tarball(), "1.2.4");
|
|
93
|
+
expect(result.status).toBe(1);
|
|
94
|
+
expect(result.stderr).toContain("version 1.2.3, not 1.2.4");
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
it("refuses a signature from another key or for another namespace", () => {
|
|
98
|
+
expect(verify(tarball({ key: join(home, "stranger") })).stderr).toContain("does not verify");
|
|
99
|
+
expect(verify(tarball({ namespace: "astro-pack" })).stderr).toContain("does not verify");
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
it("refuses a link inside the tarball", () => {
|
|
103
|
+
const result = verify(tarball({ afterSigning: (pkg) => symlinkSync("/etc/hosts", join(pkg, "dist", "link")), extraEntries: ["dist/link"] }));
|
|
104
|
+
expect(result.status).toBe(1);
|
|
105
|
+
expect(result.stderr).toContain("other than regular files");
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
describe("verify-release.sh --tree", () => {
|
|
110
|
+
it("accepts an unpacked, signed, complete package", () => {
|
|
111
|
+
const result = verifyTree(signedPackage());
|
|
112
|
+
expect(result.stderr).toBe("");
|
|
113
|
+
expect(result.status).toBe(0);
|
|
114
|
+
expect(result.stdout).toContain("1.2.3 in");
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
it("refuses a file changed after install", () => {
|
|
118
|
+
const result = verifyTree(signedPackage({ afterSigning: (pkg) => writeFileSync(join(pkg, "dist", "bridge.js"), "evil();\n") }));
|
|
119
|
+
expect(result.status).toBe(1);
|
|
120
|
+
expect(result.stderr).toContain("a file differs");
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
it("refuses a file added after install", () => {
|
|
124
|
+
const result = verifyTree(signedPackage({ afterSigning: (pkg) => writeFileSync(join(pkg, "dist", "extra.js"), "evil();\n") }));
|
|
125
|
+
expect(result.status).toBe(1);
|
|
126
|
+
expect(result.stderr).toContain("does not list");
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
it("refuses a link, even to a listed file", () => {
|
|
130
|
+
const result = verifyTree(signedPackage({ afterSigning: (pkg) => symlinkSync("bridge.js", join(pkg, "dist", "link.js")) }));
|
|
131
|
+
expect(result.status).toBe(1);
|
|
132
|
+
expect(result.stderr).toContain("not files");
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
it("refuses another version and bad arguments", () => {
|
|
136
|
+
expect(verifyTree(signedPackage(), "1.2.4").stderr).toContain("version 1.2.3, not 1.2.4");
|
|
137
|
+
expect(verifyTree(signedPackage(), "1.2.3\nx").stderr).toContain("not a version");
|
|
138
|
+
expect(spawnSync("sh", [VERIFY, "--tree", "x"], { encoding: "utf-8" }).status).toBe(2);
|
|
139
|
+
});
|
|
140
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astrofoundry/astrogate",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Astrogate core: isolated agent workspaces with specialists, a foreman, and chat bridges, for the pi coding agent and Claude Code.",
|
|
5
5
|
"packageManager": "pnpm@12.23.0",
|
|
6
6
|
"scripts": {
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"lint": "eslint .",
|
|
9
9
|
"build": "node scripts/build.ts",
|
|
10
10
|
"prepack": "node scripts/build.ts",
|
|
11
|
+
"pin-tools": "node scripts/pin-tools.ts",
|
|
11
12
|
"typecheck": "tsc --noEmit",
|
|
12
13
|
"check": "tsc --noEmit && eslint . && node scripts/build.ts && vitest run --coverage",
|
|
13
14
|
"release:patch": "node scripts/release.ts patch",
|
|
@@ -36,7 +37,8 @@
|
|
|
36
37
|
"harness",
|
|
37
38
|
"release.sha256",
|
|
38
39
|
"release.sha256.sig",
|
|
39
|
-
"specialists"
|
|
40
|
+
"specialists",
|
|
41
|
+
"tools.lock"
|
|
40
42
|
],
|
|
41
43
|
"repository": {
|
|
42
44
|
"type": "git",
|
package/release.sha256
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
aa08819cc3d490adab1ed75efd822e30d808b029935a2ecb24ee8d37c9e21d8f README.md
|
|
2
2
|
b9b0f9fa90b9a230157de1fefef1aa5a624bfd7b50527b67ad86ecc62414aadb agents/foreman.md
|
|
3
3
|
4091f50a5a9ff72e2f1571c6de054d9c891dbe294aa58e6a55ad9a1bff2f766a cli/astro-install.sh
|
|
4
4
|
9f371247fdaea09e1551f940fd91eacb7d242baea343fce66f12fc8e22ba064b cli/astro.sh
|
|
5
5
|
8e054f8286876b77e0887d0b0e2a62d4a048fd41bfa0048d126e0c9171869cf6 cli/astro.test.ts
|
|
6
|
+
cc09e939b079cea163f5a88e5e3d67ff98e3c5e617cdb7cb40ae2bfc10c240da cli/astrogate.sh
|
|
7
|
+
f32adea3492890fbb5c03a1b4a1bf1e55d37978141d3f7c684d77b3aa705914c cli/astrogate.test.ts
|
|
8
|
+
07b9aef7e5d0ee43959e0c16e00ec3a202769c94faea4167257513bf15b9383c cli/verify-release.sh
|
|
9
|
+
29614fd0eb1ad08215baf827b00ee2b98ccb73ca0ccf770bc5a0084c71da5926 cli/verify-release.test.ts
|
|
6
10
|
369bc39629e3997f35ea22a4ba4d37f84da52c60ca3bf6fa5c623861a1a58329 dist/bridge.js
|
|
7
11
|
720dd00d15a39fca7b869896d7e79e2b2265497ce03f69bda2aa87522b95635d dist/claude.js
|
|
8
12
|
28270cc310f685e03ca53449030571a85fab3f9e41c57839f85f58c36ff92543 dist/extensions/bridge/index.js
|
|
@@ -65,7 +69,7 @@ e76423d9c09263e064e48e6608c6eb07f70bc350841153f7c251376b8b424dc6 extensions/sub
|
|
|
65
69
|
484c52d2e9d93dbe4aec878b5afc494f0076f5b79b5f4d24423933b39913bc3b harness/claude/main.ts
|
|
66
70
|
e1d07bd981bd4ff6385246b6c1ad41349718c1e490b2bff675291dc7b568cd69 harness/claude/mcp.ts
|
|
67
71
|
194b623038d56a2565ad42d30d1db72ca453e654bfc84996800362e8a972282b harness/claude/settings.ts
|
|
68
|
-
|
|
72
|
+
df7a19e52965cab6b1f2d8b61087ca082efd7273e145206c5f9e85409e3fba89 package.json
|
|
69
73
|
642383b14db5dbfb7caa6a185591263e4294a73323bf4c78606f7b85f0817fd0 specialists/AGENTS.md
|
|
70
74
|
a385cf5e3b59de30b5ed9b0840d6cf6198b577668f18dfd5de13a714fb047c3e specialists/README.md
|
|
71
75
|
729f8c29d7cf716be5b01d5df869eeda6d4683f86a4915a52fb8adfdebe1f9d2 specialists/entry/specialist-cli.sh
|
|
@@ -93,3 +97,4 @@ c1abde1e550c0f4703fd0b2536cc4002c7edf6468c18a03ebaa516fd1ce093c3 specialists/li
|
|
|
93
97
|
31959f525a0b0aff070b4a19a9677d446d3425481e936dcd9ca2d957f4e51142 specialists/lib/tunnel.test.ts
|
|
94
98
|
ed93bfcef355a0a3aa7d679395b2f6ce9ce4c5709253fda7f63c1f3927f5d324 specialists/lib/tunnel.ts
|
|
95
99
|
7a36850a90c3a5e8c2a02fe386f93a0b6e664431799154f548e7ac9f33e84a90 specialists/provision/provision.sh
|
|
100
|
+
d182f87697c383c29075dc8b5415fc6fa3832ab33ccf14d5df8a941d9435b5c9 tools.lock
|
package/release.sha256.sig
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
-----BEGIN SSH SIGNATURE-----
|
|
2
2
|
U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgUteIwPdKqPwfNc4vHQPUE+JWMC
|
|
3
3
|
nmuMUwttLeX5wtyIoAAAAOYXN0cm9nYXRlLWNvcmUAAAAAAAAABnNoYTUxMgAAAFMAAAAL
|
|
4
|
-
|
|
5
|
-
+
|
|
4
|
+
c3NoLWVkMjU1MTkAAABAT9XJeDq5pjTkKw2BsXczy1z+M0gF/+I8QF8BZgYM7+8j7IAtqJ
|
|
5
|
+
bosolZ798rX+LPeMbMe1q2DCngFQOdExI9Dw==
|
|
6
6
|
-----END SSH SIGNATURE-----
|
package/tools.lock
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Tools the core installs on every host, pinned by version and sha256.
|
|
2
|
+
# Written by `pnpm pin-tools <tool> <version>`; `astrogate core update` installs exactly these.
|
|
3
|
+
# tool version sha256 url
|
|
4
|
+
node 26.14.0 1c65aaa7d4f1a86e3448f09c536ea45f6e23e2ef472390eee080e9a8deb9a1fe https://nodejs.org/dist/v26.14.0/node-v26.14.0-darwin-arm64.tar.gz
|
|
5
|
+
jq 1.8.2 2d75340ba57a4b4b4c8708a21c2dc8e958a48aaa8bba13b27f77f6e4c0eca07e https://github.com/jqlang/jq/releases/download/jq-1.8.2/jq-macos-arm64
|
|
6
|
+
bw 2026.11.1 0447a5c94b5893deb3fbe4f4ac02e8d811e2f9815c27d567d08b4fc70486cff1 https://github.com/bitwarden/clients/releases/download/cli-v2026.11.1/bw-bit-macos-arm64-2026.11.1.zip
|
|
7
|
+
python 3.14.10+20261201 3106ec6408d5b9ebbb759ca09a1206e5191223d571af57de5fb34fe8c30fa703 https://github.com/astral-sh/python-build-standalone/releases/download/20261201/cpython-3.14.10+20261201-aarch64-apple-darwin-install_only_stripped.tar.gz
|
|
8
|
+
gcloud 594.0.1 f3d680f1d2bcf89b575bbba309305f2d897236d19b82e7d78462cf632ee2252d https://dl.google.com/dl/cloudsdk/channels/rapid/components/google-cloud-sdk-core-20261121205138.tar.gz
|
|
9
|
+
gcloud 594.0.1 0e7d184def218336a3850e51d64b3f4d680fcbd8e075e63205ae78296d6884cc https://dl.google.com/dl/cloudsdk/channels/rapid/components/google-cloud-sdk-core-nix-20261022194556.tar.gz
|
|
10
|
+
gcloud 594.0.1 da085036b39328aedcf43423e29676f40a7743c593f7165d1e5d7bc0e56d2b69 https://dl.google.com/dl/cloudsdk/channels/rapid/components/google-cloud-sdk-gcloud-deps-20261106082013.tar.gz
|
|
11
|
+
gcloud 594.0.1 3bbd67e1be71d5c67c78561c00cb5694668cab238161ff6a6092c0fab1c3068b https://dl.google.com/dl/cloudsdk/channels/rapid/components/google-cloud-sdk-gcloud-deps-darwin-arm-20260622153051.tar.gz
|
|
12
|
+
gcloud 594.0.1 e26abbb067a73858fd55d2d04fd961663118ddf07d849cd86aefea9a0844025a https://dl.google.com/dl/cloudsdk/channels/rapid/components/google-cloud-sdk-gcloud-crc32c-darwin-arm-20261016073856.tar.gz
|