From 718aed27eedf5f907d54953b5b79f6b5bd61c173 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Wed, 9 Sep 2026 01:34:00 +0200 Subject: [PATCH] Switch installer source; fix package install (#12824) (#12829) * switch installer to new distri * re-generate script * fix change capitaisation behaviour * fix installer (cherry picked from commit 04b5b69b69ed34c134c375e5fea2525aa3e954e6) --- .github/workflows/release.yaml | 2 ++ contrib/install.sh | 38 ++++++++++++++++++++------- contrib/installer/src/root_command.sh | 9 ++++--- contrib/packager.io/functions.sh | 14 +++++----- 4 files changed, 42 insertions(+), 21 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index b3ef25c96c..a5f083bbc0 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -225,6 +225,7 @@ jobs: uses: pkgr/action/package@c5666febcd31750da6428042193fc5b2fb765435 # main id: package with: + name: inventree target: ${{ matrix.target }} version: ${{ steps.setup.outputs.version }} debug: true @@ -258,6 +259,7 @@ jobs: uses: pkgr/action/package@c5666febcd31750da6428042193fc5b2fb765435 # main id: package-stable with: + name: inventree target: ${{ matrix.target }} version: ${{ steps.setup.outputs.version }} debug: true diff --git a/contrib/install.sh b/contrib/install.sh index 6c56feccc3..ec8ee085e5 100755 --- a/contrib/install.sh +++ b/contrib/install.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# This script was generated by bashly 1.3.3 (https://bashly.dev) +# This script was generated by bashly 1.4.0 (https://bashly.dev) # Modifying it manually is not recommended if ((BASH_VERSINFO[0] < 4 || (BASH_VERSINFO[0] == 4 && BASH_VERSINFO[1] < 2))); then @@ -15,7 +15,7 @@ root_command() { no_call=${args[--no-call]} dry_run=${args[--dry-run]} - REQS="wget apt-transport-https curl gpg" + REQS="curl" function do_call() { if [[ $dry_run ]]; then @@ -56,6 +56,7 @@ root_command() { get_distribution echo "### Detected distribution: $OS $VER" SUPPORTED=true # is this OS supported? + OLD_VERSION=false # is this an old OS that is no longer supported? DIST_OS=${OS,,} DIST_VER=$VER @@ -64,21 +65,30 @@ root_command() { Ubuntu) if [[ $VER == "24.04" ]]; then SUPPORTED=true - elif [[ $VER == "22.04" ]]; then + elif [[ $VER == "26.04" ]]; then SUPPORTED=true elif [[ $VER == "20.04" ]]; then - SUPPORTED=true + SUPPORTED=false + OLD_VERSION=true + elif [[ $VER == "22.04" ]]; then + SUPPORTED=false + OLD_VERSION=true else SUPPORTED=false fi ;; "Debian GNU/Linux" | "debian gnu/linux" | Raspbian) - if [[ $VER == "12" ]]; then + if [[ $VER == "13" ]]; then SUPPORTED=true + elif [[ $VER == "12" ]]; then + SUPPORTED=false + OLD_VERSION=true elif [[ $VER == "11" ]]; then - SUPPORTED=true + SUPPORTED=false + OLD_VERSION=true elif [[ $VER == "10" ]]; then - SUPPORTED=true + SUPPORTED=false + OLD_VERSION=true else SUPPORTED=false fi @@ -92,6 +102,11 @@ root_command() { if [[ $SUPPORTED != "true" ]]; then echo "This OS is currently not supported." + + if [[ $OLD_VERSION == "true" ]]; then + echo "The detected version ($OS $VER) is no longer supported but a newer version is." + fi + echo "Please install manually using https://docs.inventree.org/en/stable/start/install/" echo "or check https://github.com/inventree/InvenTree/issues/3836 for packaging for your OS." echo "If you think this is a bug please file an issue at" @@ -110,10 +125,11 @@ root_command() { done echo "### Getting and adding key" - curl -fsSL https://dl.packager.io/srv/$publisher/InvenTree/key | gpg --dearmor | tee /etc/apt/trusted.gpg.d/pkgr-inventree.gpg > /dev/null + sudo curl -fsSL "https://go.packager.io/srv/deb/$publisher/InvenTree/gpg-key.gpg" -o /usr/share/keyrings/InvenTree.gpg echo "### Adding package source" - SOURCE_URL="deb [signed-by=/etc/apt/trusted.gpg.d/pkgr-inventree.gpg] https://dl.packager.io/srv/deb/$publisher/InvenTree/$source_url/$DIST_OS $DIST_VER main" - echo "$SOURCE_URL" | tee /etc/apt/sources.list.d/inventree.list > /dev/null + SOURCE_URL="https://go.packager.io/srv/$publisher/InvenTree/$source_url/installer/$DIST_OS/$DIST_VER.list" + sudo curl -fsSL "$SOURCE_URL" > /etc/apt/sources.list.d/inventree.list + echo "### Updating package lists" do_call "sudo apt-get update" @@ -144,6 +160,7 @@ install.sh_usage() { echo if [[ -n "$long_usage" ]]; then + printf "%s\n" "Options:" printf " %s\n" "--no-call, -n" @@ -214,6 +231,7 @@ normalize_input() { } parse_requirements() { + local key while [[ $# -gt 0 ]]; do key="$1" diff --git a/contrib/installer/src/root_command.sh b/contrib/installer/src/root_command.sh index 7a894b7f8b..c10ff60be1 100644 --- a/contrib/installer/src/root_command.sh +++ b/contrib/installer/src/root_command.sh @@ -5,7 +5,7 @@ publisher=${args[publisher]} no_call=${args[--no-call]} dry_run=${args[--dry-run]} -REQS="wget apt-transport-https curl gpg" +REQS="curl" function do_call() { if [[ $dry_run ]]; then @@ -115,10 +115,11 @@ for pkg in $REQS; do done echo "### Getting and adding key" -curl -fsSL https://dl.packager.io/srv/$publisher/InvenTree/key | gpg --dearmor | tee /etc/apt/trusted.gpg.d/pkgr-inventree.gpg > /dev/null +sudo curl -fsSL "https://go.packager.io/srv/deb/$publisher/InvenTree/gpg-key.gpg" -o /usr/share/keyrings/InvenTree.gpg echo "### Adding package source" -SOURCE_URL="deb [signed-by=/etc/apt/trusted.gpg.d/pkgr-inventree.gpg] https://dl.packager.io/srv/deb/$publisher/InvenTree/$source_url/$DIST_OS $DIST_VER main" -echo "$SOURCE_URL" | tee /etc/apt/sources.list.d/inventree.list > /dev/null +SOURCE_URL="https://go.packager.io/srv/$publisher/InvenTree/$source_url/installer/$DIST_OS/$DIST_VER.list" +sudo curl -fsSL "$SOURCE_URL" > /etc/apt/sources.list.d/inventree.list + echo "### Updating package lists" do_call "sudo apt-get update" diff --git a/contrib/packager.io/functions.sh b/contrib/packager.io/functions.sh index 2705a369e8..0bb9a21961 100755 --- a/contrib/packager.io/functions.sh +++ b/contrib/packager.io/functions.sh @@ -356,22 +356,22 @@ function set_env() { # Secret key file sed -i s=#secret_key_file:\ \'/etc/inventree/secret_key.txt\'=secret_key_file:\ \'${INVENTREE_SECRET_KEY_FILE}\'=g ${INVENTREE_CONFIG_FILE} # OIDC private key file - sed -i s=#oidc_private_key_file:\ \'/etc/inventree/oidc.pem\'=oidc_private_key_file:\ \'${INVENTREE_OIDC_PRIVATE_KEY_FILE}\'=g ${INVENTREE_CONFIG_FILE} + sed -i s=#oidc_private_key_file:\ \'/etc/inventree/oidc.key\'=oidc_private_key_file:\ \'${INVENTREE_OIDC_PRIVATE_KEY_FILE}\'=g ${INVENTREE_CONFIG_FILE} # Debug mode sed -i s=debug:\ True=debug:\ False=g ${INVENTREE_CONFIG_FILE} # Database engine - sed -i s=#\ ENGINE:\ Database\ engine.\ Selection\ from:=ENGINE:\ ${INVENTREE_DB_ENGINE}=g ${INVENTREE_CONFIG_FILE} + sed -i s=#\ engine:\ Database\ engine.\ Selection\ from:=engine:\ ${INVENTREE_DB_ENGINE}=g ${INVENTREE_CONFIG_FILE} # Database name - sed -i s=#\ NAME:\ Database\ name=NAME:\ \'${INVENTREE_DB_NAME}\'=g ${INVENTREE_CONFIG_FILE} + sed -i s=#\ name:\ Database\ name=name:\ \'${INVENTREE_DB_NAME}\'=g ${INVENTREE_CONFIG_FILE} # Database user - sed -i s=#\ USER:\ Database\ username\ \(if\ required\)=USER:\ ${INVENTREE_DB_USER}=g ${INVENTREE_CONFIG_FILE} + sed -i s=#\ user:\ Database\ username\ \(if\ required\)=user:\ ${INVENTREE_DB_USER}=g ${INVENTREE_CONFIG_FILE} # Database password - sed -i s=#\ PASSWORD:\ Database\ password\ \(if\ required\)=PASSWORD:\ ${INVENTREE_DB_PASSWORD}=g ${INVENTREE_CONFIG_FILE} + sed -i s=#\ password:\ Database\ password\ \(if\ required\)=password:\ ${INVENTREE_DB_PASSWORD}=g ${INVENTREE_CONFIG_FILE} # Database host - sed -i s=#\ HOST:\ Database\ host\ address\ \(if\ required\)=HOST:\ ${INVENTREE_DB_HOST}=g ${INVENTREE_CONFIG_FILE} + sed -i s=#\ host:\ Database\ host\ address\ \(if\ required\)=host:\ ${INVENTREE_DB_HOST}=g ${INVENTREE_CONFIG_FILE} # Database port - sed -i s=#\ PORT:\ Database\ host\ port\ \(if\ required\)=PORT:\ ${INVENTREE_DB_PORT}=g ${INVENTREE_CONFIG_FILE} + sed -i s=#\ port:\ Database\ host\ port\ \(if\ required\)=port:\ ${INVENTREE_DB_PORT}=g ${INVENTREE_CONFIG_FILE} # Fixing the permissions chown ${APP_USER}:${APP_GROUP} ${DATA_DIR} ${INVENTREE_CONFIG_FILE}