Update scripts for Debian 13 and improve update messages

Bump default OS version from Debian 12 to 13 across all container scripts. Standardize update messages to use explicit service names and success confirmations. Refactor update functions for consistency, improve error handling, and update package management commands to use 'apt' instead of 'apt-get'.
This commit is contained in:
CanbiZ
2025-11-12 11:14:37 +01:00
parent 66409ac1cf
commit e5c3c19106
36 changed files with 348 additions and 364 deletions

View File

@@ -11,7 +11,7 @@ var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-2048}"
var_disk="${var_disk:-6}"
var_os="${var_os:-debian}"
var_version="${var_version:-12}"
var_version="${var_version:-13}"
var_unprivileged="${var_unprivileged:-1}"
header_info "$APP"
@@ -47,10 +47,10 @@ function update_script() {
fi
if [[ ! -f /opt/gitea-mirror.env ]]; then
msg_info "Detected old Enviroment, updating files"
APP_SECRET=$(openssl rand -base64 32)
HOST_IP=$(hostname -I | awk '{print $1}')
cat <<EOF >/opt/gitea-mirror.env
msg_info "Detected old Enviroment, updating files"
APP_SECRET=$(openssl rand -base64 32)
HOST_IP=$(hostname -I | awk '{print $1}')
cat <<EOF >/opt/gitea-mirror.env
# See here for config options: https://github.com/RayLabsHQ/gitea-mirror/blob/main/docs/ENVIRONMENT_VARIABLES.md
NODE_ENV=production
HOST=0.0.0.0
@@ -77,7 +77,7 @@ WantedBy=multi-user.target
EOF
systemctl daemon-reload
msg_ok "Old Enviroment fixed"
fi
fi
if check_for_gh_release "gitea-mirror" "RayLabsHQ/gitea-mirror"; then
msg_info "Stopping Services"
@@ -96,17 +96,15 @@ fi
ln -sf /opt/bun/bin/bun /usr/local/bin/bunx
msg_ok "Installed Bun"
rm -rf /opt/gitea-mirror
fetch_and_deploy_gh_release "gitea-mirror" "RayLabsHQ/gitea-mirror"
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "gitea-mirror" "RayLabsHQ/gitea-mirror"
msg_info "Updating and rebuilding ${APP}"
msg_info "Updating Gitea-Mirror"
cd /opt/gitea-mirror
$STD bun run setup
$STD bun run build
APP_VERSION=$(grep -o '"version": *"[^"]*"' package.json | cut -d'"' -f4)
sudo sed -i.bak "s|^npm_package_version=.*|npm_package_version=${APP_VERSION}|" /opt/gitea-mirror.env
msg_ok "Updated and rebuilt ${APP}"
msg_ok "Updated Gitea-Mirror"
msg_info "Restoring Data"
cp /opt/gitea-mirror-backup/data/* /opt/gitea-mirror/data
@@ -114,8 +112,8 @@ fi
msg_info "Starting Service"
systemctl start gitea-mirror
msg_ok "Service Started"
msg_ok "Update Successfully"
msg_ok "Started Service"
msg_ok "Updated successfully"
fi
exit
}