From e5542e393ac06984abec05e81403985a44c576bc Mon Sep 17 00:00:00 2001 From: James Polley Date: Sat, 17 May 2025 13:42:22 +1000 Subject: [PATCH 1/5] Ensure lsb-release is installed Fixes 4548 --- ct/kimai.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ct/kimai.sh b/ct/kimai.sh index cfc0f01a7a3..d4d5aa35332 100644 --- a/ct/kimai.sh +++ b/ct/kimai.sh @@ -23,6 +23,9 @@ function update_script() { header_info check_container_storage check_container_resources + if [[ ! -x /bin/lsb_release]]; then + apt install -y lsb-release + fi if [[ ! -d /opt/kimai ]]; then msg_error "No ${APP} Installation Found!" exit From 22ce55a1a02294519a04bd32ce360b8b7e5bcf5c Mon Sep 17 00:00:00 2001 From: James Polley Date: Sat, 17 May 2025 13:53:19 +1000 Subject: [PATCH 2/5] Change to use same syntax as check for composer There's a proposed solution to #4247 (which doesn't seem to have been committed - I'll fix that in a moment). I've changed the test I'm using to match that suggestion. --- ct/kimai.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ct/kimai.sh b/ct/kimai.sh index d4d5aa35332..d0ff6bc8f5f 100644 --- a/ct/kimai.sh +++ b/ct/kimai.sh @@ -23,7 +23,7 @@ function update_script() { header_info check_container_storage check_container_resources - if [[ ! -x /bin/lsb_release]]; then + if ! command -v lsb_release; then apt install -y lsb-release fi if [[ ! -d /opt/kimai ]]; then From 36b3a429b1e7fb54d13f9bc58ea970a1f37a3839 Mon Sep 17 00:00:00 2001 From: James Polley Date: Sat, 17 May 2025 15:13:00 +1000 Subject: [PATCH 3/5] Re-install composer See #4550 --- ct/kimai.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ct/kimai.sh b/ct/kimai.sh index d0ff6bc8f5f..8cc348f9798 100644 --- a/ct/kimai.sh +++ b/ct/kimai.sh @@ -39,7 +39,7 @@ function update_script() { $STD apt-get update $STD apt-get remove -y php"${CURRENT_PHP//./}"* $STD apt-get install -y \ - php8.4 \ + php8.4 composer \ php8.4-{gd,mysql,mbstring,bcmath,xml,curl,zip,intl} \ libapache2-mod-php8.4 msg_ok "Migrated PHP $CURRENT_PHP to 8.4" From 2f6891f2dd25294e96ddff34a33587ce64c29bd5 Mon Sep 17 00:00:00 2001 From: James Polley Date: Sat, 17 May 2025 15:33:49 +1000 Subject: [PATCH 4/5] Try to catch download errors During troubleshooting of another error, I ran into a condition where downloading the new version failed. It seems that this is because the earlier call to get the $RELEASE had failed. This change is an attempt to catch download errors, and alert the user, and to not rm the existing install until we know the download worked. --- ct/kimai.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ct/kimai.sh b/ct/kimai.sh index 8cc348f9798..0d7c5d44585 100644 --- a/ct/kimai.sh +++ b/ct/kimai.sh @@ -61,9 +61,13 @@ function update_script() { msg_ok "Backup completed" msg_info "Updating ${APP} to ${RELEASE}" - rm -rf /opt/kimai + trap "echo Unable to download release file for version ${RELEASE}; try again later" ERR + set -e curl -fsSL "https://github.com/kimai/kimai/archive/refs/tags/${RELEASE}.zip" -o $(basename "https://github.com/kimai/kimai/archive/refs/tags/${RELEASE}.zip") unzip -q "${RELEASE}".zip + set +e + trap - ERR + rm -rf /opt/kimai mv kimai-"${RELEASE}" /opt/kimai [ -d "$BACKUP_DIR/var" ] && cp -r "$BACKUP_DIR/var" /opt/kimai/ [ -f "$BACKUP_DIR/.env" ] && cp "$BACKUP_DIR/.env" /opt/kimai/ From f6000baff37a1e043db83b65d2f7581fab076eb3 Mon Sep 17 00:00:00 2001 From: James Polley Date: Sat, 17 May 2025 15:57:50 +1000 Subject: [PATCH 5/5] Re-install php-fpm I missed in the earlier commit that this wasn't getting reinstalled --- ct/kimai.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ct/kimai.sh b/ct/kimai.sh index 0d7c5d44585..41ec61eee40 100644 --- a/ct/kimai.sh +++ b/ct/kimai.sh @@ -40,7 +40,7 @@ function update_script() { $STD apt-get remove -y php"${CURRENT_PHP//./}"* $STD apt-get install -y \ php8.4 composer \ - php8.4-{gd,mysql,mbstring,bcmath,xml,curl,zip,intl} \ + php8.4-{gd,mysql,mbstring,bcmath,xml,curl,zip,intl,fpm} \ libapache2-mod-php8.4 msg_ok "Migrated PHP $CURRENT_PHP to 8.4" fi