mirror of
https://github.com/jakeswenson/BitBetter.git
synced 2026-07-19 14:49:49 +00:00
Update URL with version information (#284)
* Update URL with version information The previous URL is no longer working. Instead of the site redirect, switching directly to the official GitHub repository of Bitwarden to download the latest version information. * Update update-bitwarden.sh * Add prerequisite checks and switch JSON parsing to jq The URL with the version of self-hosted Bitwarden is not working anymore. Now we're querying the official GitHub repository of Bitwarden and using jq to find the current released version. For simplification, we've moved to jq instead of sed/awk combinations and also added prerequisite checks for docker, openssl, and jq to avoid build failures. * Add prerequisite checks and switch JSON parsing to jq The URL with the version of self-hosted Bitwarden is not working anymore. Now we're querying the official GitHub repository of Bitwarden and using jq to find the current released version. For simplification, we've moved to jq instead of sed/awk combinations and also added prerequisite checks for docker, openssl, and jq to avoid build failures. The script was also changed to exit on failure (set -e). * Update build.sh Remove duplicate OpenSSL check * Update update-bitwarden.sh Remove duplicate OpenSSL check * Apply suggestions from code review Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: captainhook <16797541+captainhook@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
10
build.sh
10
build.sh
@@ -2,7 +2,15 @@
|
|||||||
set -e
|
set -e
|
||||||
DIR=`dirname "$0"`
|
DIR=`dirname "$0"`
|
||||||
DIR=`exec 2>/dev/null;(cd -- "$DIR") && cd -- "$DIR"|| cd "$DIR"; unset PWD; /usr/bin/pwd || /bin/pwd || pwd`
|
DIR=`exec 2>/dev/null;(cd -- "$DIR") && cd -- "$DIR"|| cd "$DIR"; unset PWD; /usr/bin/pwd || /bin/pwd || pwd`
|
||||||
BW_VERSION=$(curl -sL https://go.btwrdn.co/bw-sh-versions | grep '^ *"'coreVersion'":' | awk -F\: '{ print $2 }' | sed -e 's/,$//' -e 's/^"//' -e 's/"$//')
|
|
||||||
|
# Check prerequisite libraries and executables
|
||||||
|
for cmd in docker curl openssl jq; do
|
||||||
|
command -v "$cmd" >/dev/null 2>&1 || { echo "Error: '$cmd' is required but not installed." >&2; exit 1; }
|
||||||
|
done
|
||||||
|
if [ "${BITBETTER_BUILD_FROM_SOURCE:-0}" = "1" ]; then
|
||||||
|
command -v git >/dev/null 2>&1 || { echo "Error: 'git' is required for BITBETTER_BUILD_FROM_SOURCE=1 but not installed." >&2; exit 1; }
|
||||||
|
fi
|
||||||
|
BW_VERSION=$(curl -fsSL https://raw.githubusercontent.com/bitwarden/self-host/refs/heads/main/version.json | jq -er '.versions.coreVersion')
|
||||||
|
|
||||||
echo "Building BitBetter for BitWarden version $BW_VERSION"
|
echo "Building BitBetter for BitWarden version $BW_VERSION"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
ask () {
|
ask () {
|
||||||
local __resultVar=$1
|
local __resultVar=$1
|
||||||
local __result="$2"
|
local __result="$2"
|
||||||
@@ -9,7 +11,13 @@ ask () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SCRIPT_BASE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
SCRIPT_BASE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||||
BW_VERSION=$(curl -sL https://go.btwrdn.co/bw-sh-versions | grep '^ *"'coreVersion'":' | awk -F\: '{ print $2 }' | sed -e 's/,$//' -e 's/^"//' -e 's/"$//')
|
|
||||||
|
# Check prerequisite libraries and executables
|
||||||
|
for cmd in docker curl openssl jq; do
|
||||||
|
command -v "$cmd" >/dev/null 2>&1 || { echo "Error: '$cmd' is required but not installed." >&2; exit 1; }
|
||||||
|
done
|
||||||
|
|
||||||
|
BW_VERSION=$(curl -fsSL https://raw.githubusercontent.com/bitwarden/self-host/refs/heads/main/version.json | jq -er '.versions.coreVersion')
|
||||||
|
|
||||||
echo "Starting Bitwarden update, newest server version: $BW_VERSION"
|
echo "Starting Bitwarden update, newest server version: $BW_VERSION"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user