diff --git a/.version b/.version index 7ec1d6db4..8249aefcc 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -2.1.0 +2.1.1-beta.1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d583eb2c..e2b4ee005 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased](https://github.com/hyperion-project/hyperion.ng/compare/2.1.0...HEAD) +### ⚠️ Breaking Changes + +--- + +### ✨ Added + +--- + +### 🔧 Changed + +- **Fixes:** + - WebUI unreachable via IPv6 (#1871) + - Align install_pr script working with default Qt6 builds & show authentication failures (#1871) + +--- + +### 🗑️ Removed + ## [2.1.0](https://github.com/hyperion-project/hyperion.ng/releases/tag/2.1.0) - 2025-06-12 ### ⚠️ Breaking Changes diff --git a/bin/scripts/install_pr.sh b/bin/scripts/install_pr.sh index 947130469..07cc8cf3e 100755 --- a/bin/scripts/install_pr.sh +++ b/bin/scripts/install_pr.sh @@ -15,7 +15,6 @@ hasPython2=$? DISTRIBUTION="debian" CODENAME="bullseye" ARCHITECTURE="" -WITH_QT5=false BASE_PATH='.' @@ -35,21 +34,57 @@ else exit 1 fi -function request_call() { +request_call() { + local url="$1" + local response body status_code + if [ $hasWget -eq 0 ]; then - echo $(wget --quiet --header="Authorization: token ${PR_TOKEN}" -O - $1) + # Use a temp file to store headers + local headers_file=$(mktemp) + body=$(wget --quiet --server-response --header="Authorization: token ${PR_TOKEN}" -O - "$url" 2> "$headers_file") + status_code=$(awk '/^ HTTP/{code=$2} END{print code}' "$headers_file") + rm -f "$headers_file" + elif [ $hasCurl -eq 0 ]; then - echo $(curl -skH "Authorization: token ${PR_TOKEN}" $1) + # Append status code at the end of the response + response=$(curl -sk -w "\n%{http_code}" -H "Authorization: token ${PR_TOKEN}" "$url") + body=$(echo "$response" | sed '$d') # All but last line + status_code=$(echo "$response" | tail -n1) # Last line = status code + else + echo "---> Neither wget nor curl is available." >&2 + exit 1 fi + + # Handle common HTTP errors + case "$status_code" in + 401) + echo "---> Error: 401 Unauthorized. Check your token." >&2 + exit 1 + ;; + 403) + echo "---> Error: 403 Forbidden. You might be rate-limited or lack permissions." >&2 + exit 1 + ;; + 404) + echo "---> Error: 404 Not Found. URL is incorrect or resource doesn't exist." >&2 + exit 1 + ;; + 5*) + echo "---> Error: Server error ($status_code). Try again later." >&2 + exit 1 + ;; + esac + + # Success: print response body + echo "$body" } -while getopts ":a:c:r:t:5" opt; do +while getopts ":a:c:r:t:" opt; do case "$opt" in a) ARCHITECTURE=$OPTARG ;; c) CONFIGDIR=$OPTARG ;; r) run_id=$OPTARG ;; t) PR_TOKEN=$OPTARG ;; - 5) WITH_QT5=true ;; esac done shift $((OPTIND - 1)) @@ -103,19 +138,7 @@ if [ $? -ne 0 ]; then exit 1 else PACKAGE="${ARCHITECTURE}" - - # armv6 has no Qt6 support yet - if [[ "${PACKAGE}" == "armv6" ]]; then - WITH_QT5=true - fi - - QTVERSION="5" - if [ ${WITH_QT5} == false ]; then - QTVERSION="6" - PACKAGE="${PACKAGE}_qt6" - fi - - echo "---> Download package for identified runtime architecture: $ARCHITECTURE and Qt$QTVERSION" + echo "---> Download package for identified runtime architecture: $ARCHITECTURE" fi # Determine if PR number exists diff --git a/libsrc/utils/NetOrigin.cpp b/libsrc/utils/NetOrigin.cpp index 42693491b..f85589bd3 100644 --- a/libsrc/utils/NetOrigin.cpp +++ b/libsrc/utils/NetOrigin.cpp @@ -58,31 +58,34 @@ bool NetOrigin::isLocalAddress(const QHostAddress& ipAddress, const QHostAddress return true; } - //Convert to IPv4 to check, if an IPv6 address is an IPv4 mapped address - QHostAddress ipv4Address(address.toIPv4Address()); - if (ipv4Address != QHostAddress::AnyIPv4) // ipv4Address is not "0.0.0.0" + // Convert IPv4-mapped IPv6 to pure IPv4 + QHostAddress const ipv4Address(address.toIPv4Address()); + if (ipv4Address != QHostAddress::AnyIPv4) { address = ipv4Address; } - QList allInterfaces = QNetworkInterface::allInterfaces(); - for (const QNetworkInterface &networkInterface : allInterfaces) { - QList addressEntries = networkInterface.addressEntries(); - for (const QNetworkAddressEntry &localNetworkAddressEntry : addressEntries) { - QHostAddress localIP = localNetworkAddressEntry.ip(); + QList const allInterfaces = QNetworkInterface::allInterfaces(); + for (const QNetworkInterface &networkInterface : allInterfaces) + { + QList const addressEntries = networkInterface.addressEntries(); + for (const QNetworkAddressEntry &localNetworkAddressEntry : addressEntries) + { + QHostAddress const localIP = localNetworkAddressEntry.ip(); - if(localIP.protocol() != QAbstractSocket::NetworkLayerProtocol::IPv4Protocol) + // Skip protocol mismatch + if (localIP.protocol() != address.protocol()) { continue; } - bool isInSubnet = address.isInSubnet(localIP, localNetworkAddressEntry.prefixLength()); - if (isInSubnet) + if (address.isInSubnet(localIP, localNetworkAddressEntry.prefixLength())) { return true; } } } + return false; }