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
1 change: 0 additions & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

The preferred channel is GitHub private vulnerability reporting: open a private report at <https://github.com/simtabi/ssh-manager/security/advisories/new>. The report stays attached to the repository, with a draft advisory and a CVE request path. Email **security@simtabi.com** if you do not use GitHub.

Please report security vulnerabilities privately to **security@simtabi.com**.
Do **not** open a public issue for a security report.

Include, where possible: a description of the issue, affected version(s),
Expand Down
10 changes: 9 additions & 1 deletion src/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,16 @@ if [ -z "$VERSION" ]; then
# into a failed install - intermittently, depending on whether curl had
# finished writing. awk reads a here-string, so there is no pipeline left for
# an early exit to break.
body="$(curl -fsSL ${auth[@]+"${auth[@]}"} -H 'Accept: application/vnd.github+json' "$api")"
body="$(curl -fsSL ${auth[@]+"${auth[@]}"} -H 'Accept: application/vnd.github+json' "$api" || true)"
VERSION="$(awk -F'"' '/"tag_name"/{print $4; exit}' <<<"$body")"
# The API allows 60 unauthenticated requests an hour per IP, and anyone behind
# a shared NAT - or on a CI runner - can find that spent and get a 403. The
# releases/latest web redirect is not counted against it and names the same
# tag, so fall back to it rather than failing the install.
if [ -z "$VERSION" ]; then
latest="$(curl -fsSLI -o /dev/null -w '%{url_effective}' "https://github.com/${OWNER}/${REPO}/releases/latest" || true)"
case "$latest" in */tag/*) VERSION="${latest##*/tag/}" ;; esac
fi
fi
[ -n "$VERSION" ] || err "could not determine the version to install."
case "$VERSION" in v*) ;; *) VERSION="v$VERSION" ;; esac
Expand Down
Loading