detached 26e5ecf

Merge pull request #24 from bnema/fix/installer-checksum-verification

fix(security): add SHA256 checksum verification to installer
commit
26e5ecfba1089746d152f98f9fed84dfca7ae4c2
author
bnema · · 2026-01-17 07:58 UTC
committer
GitHub · · 2026-01-17 07:58 UTC
merge of
79b3461 + c284de4 · diff against the first parent
signature
GPG UnverifiedB5690EEEBB952194 The key is unknown
1 file · +45 -1
M install.sh +45 -1
@@ -49,8 +49,52 @@ DOWNLOAD_URL="https://github.com/${REPO}/releases/latest/download/${TARBALL}"
4949 TMP_DIR=$(mktemp -d)
5050 trap 'rm -rf "$TMP_DIR"' EXIT
5151
52+# Download checksums file
53+CHECKSUMS_URL="https://github.com/${REPO}/releases/latest/download/checksums.txt"
54+echo "Downloading checksums..."
55+if ! curl -fsSL "$CHECKSUMS_URL" -o "$TMP_DIR/checksums.txt"; then
56+ echo "Error: Failed to download checksums file"
57+ exit 1
58+fi
59+
5260 echo "Downloading ${TARBALL}..."
53-curl -fsSL "$DOWNLOAD_URL" -o "$TMP_DIR/$TARBALL"
61+if ! curl -fsSL "$DOWNLOAD_URL" -o "$TMP_DIR/$TARBALL"; then
62+ echo "Error: Failed to download ${TARBALL}"
63+ exit 1
64+fi
65+
66+# Verify checksum
67+echo "Verifying checksum..."
68+EXPECTED_CHECKSUM=$(grep -E "[[:space:]]${TARBALL}\$" "$TMP_DIR/checksums.txt" | awk '{print $1}')
69+if [ -z "$EXPECTED_CHECKSUM" ]; then
70+ echo "Error: Could not find checksum for ${TARBALL} in checksums.txt"
71+ exit 1
72+fi
73+
74+# Calculate actual checksum (works on both Linux and macOS)
75+if command -v sha256sum >/dev/null 2>&1; then
76+ ACTUAL_CHECKSUM=$(sha256sum "$TMP_DIR/$TARBALL" | awk '{print $1}')
77+elif command -v shasum >/dev/null 2>&1; then
78+ ACTUAL_CHECKSUM=$(shasum -a 256 "$TMP_DIR/$TARBALL" | awk '{print $1}')
79+else
80+ echo "Error: Neither 'sha256sum' nor 'shasum' was found. Cannot verify checksum."
81+ echo ""
82+ echo "Please install one of these tools:"
83+ echo " Debian/Ubuntu: sudo apt-get install coreutils"
84+ echo " Fedora/RHEL: sudo dnf install coreutils"
85+ echo " Alpine: apk add coreutils"
86+ echo " macOS: shasum should be pre-installed"
87+ exit 1
88+fi
89+
90+if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]; then
91+ echo "Error: Checksum verification failed!"
92+ echo "Expected: $EXPECTED_CHECKSUM"
93+ echo "Actual: $ACTUAL_CHECKSUM"
94+ echo "The downloaded file may be corrupted or tampered with."
95+ exit 1
96+fi
97+echo "Checksum verified successfully."
5498
5599 echo "Extracting..."
56100 tar -xzf "$TMP_DIR/$TARBALL" -C "$TMP_DIR"
@@ -49,8 +49,52 @@ DOWNLOAD_URL="https://github.com/${REPO}/releases/latest/download/${TARBALL}"
49 TMP_DIR=$(mktemp -d)49 TMP_DIR=$(mktemp -d)
50 trap 'rm -rf "$TMP_DIR"' EXIT50 trap 'rm -rf "$TMP_DIR"' EXIT
51 51
52+# Download checksums file
53+CHECKSUMS_URL="https://github.com/${REPO}/releases/latest/download/checksums.txt"
54+echo "Downloading checksums..."
55+if ! curl -fsSL "$CHECKSUMS_URL" -o "$TMP_DIR/checksums.txt"; then
56+ echo "Error: Failed to download checksums file"
57+ exit 1
58+fi
59+
52 echo "Downloading ${TARBALL}..."60 echo "Downloading ${TARBALL}..."
53-curl -fsSL "$DOWNLOAD_URL" -o "$TMP_DIR/$TARBALL"61+if ! curl -fsSL "$DOWNLOAD_URL" -o "$TMP_DIR/$TARBALL"; then
62+ echo "Error: Failed to download ${TARBALL}"
63+ exit 1
64+fi
65+
66+# Verify checksum
67+echo "Verifying checksum..."
68+EXPECTED_CHECKSUM=$(grep -E "[[:space:]]${TARBALL}\$" "$TMP_DIR/checksums.txt" | awk '{print $1}')
69+if [ -z "$EXPECTED_CHECKSUM" ]; then
70+ echo "Error: Could not find checksum for ${TARBALL} in checksums.txt"
71+ exit 1
72+fi
73+
74+# Calculate actual checksum (works on both Linux and macOS)
75+if command -v sha256sum >/dev/null 2>&1; then
76+ ACTUAL_CHECKSUM=$(sha256sum "$TMP_DIR/$TARBALL" | awk '{print $1}')
77+elif command -v shasum >/dev/null 2>&1; then
78+ ACTUAL_CHECKSUM=$(shasum -a 256 "$TMP_DIR/$TARBALL" | awk '{print $1}')
79+else
80+ echo "Error: Neither 'sha256sum' nor 'shasum' was found. Cannot verify checksum."
81+ echo ""
82+ echo "Please install one of these tools:"
83+ echo " Debian/Ubuntu: sudo apt-get install coreutils"
84+ echo " Fedora/RHEL: sudo dnf install coreutils"
85+ echo " Alpine: apk add coreutils"
86+ echo " macOS: shasum should be pre-installed"
87+ exit 1
88+fi
89+
90+if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]; then
91+ echo "Error: Checksum verification failed!"
92+ echo "Expected: $EXPECTED_CHECKSUM"
93+ echo "Actual: $ACTUAL_CHECKSUM"
94+ echo "The downloaded file may be corrupted or tampered with."
95+ exit 1
96+fi
97+echo "Checksum verified successfully."
54 98
55 echo "Extracting..."99 echo "Extracting..."
56 tar -xzf "$TMP_DIR/$TARBALL" -C "$TMP_DIR"100 tar -xzf "$TMP_DIR/$TARBALL" -C "$TMP_DIR"

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 7

Tags 106

↑↓ moveenter openesc close