Update tinyauth update procedure

This commit is contained in:
tremor021 2025-04-24 18:21:41 +02:00
parent ee0c9421da
commit d0320473f1

View File

@ -21,10 +21,14 @@ catch_errors
function update_script() { function update_script() {
header_info header_info
check_container_storage
check_container_resources
if [ ! -d /opt/tinyauth ]; then if [ ! -d /opt/tinyauth ]; then
msg_error "No ${APP} Installation Found!" msg_error "No ${APP} Installation Found!"
exit 1 exit 1
fi fi
msg_info "Updating Alpine Packages" msg_info "Updating Alpine Packages"
$STD apk update $STD apk update
$STD apk upgrade $STD apk upgrade
@ -37,6 +41,7 @@ function update_script() {
rm -rf /opt/tinyauth rm -rf /opt/tinyauth
mkdir -p /opt/tinyauth mkdir -p /opt/tinyauth
RELEASE=$(curl -s https://api.github.com/repos/steveiliop56/tinyauth/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') RELEASE=$(curl -s https://api.github.com/repos/steveiliop56/tinyauth/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
if [ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ] || [ ! -f /opt/${APP}_version.txt ]; then
curl -fsSL "https://github.com/steveiliop56/tinyauth/archive/refs/tags/v${RELEASE}.tar.gz" -o "$temp_file" curl -fsSL "https://github.com/steveiliop56/tinyauth/archive/refs/tags/v${RELEASE}.tar.gz" -o "$temp_file"
tar -xzf "$temp_file" -C /opt/tinyauth --strip-components=1 tar -xzf "$temp_file" -C /opt/tinyauth --strip-components=1
cd /opt/tinyauth/frontend cd /opt/tinyauth/frontend
@ -49,6 +54,9 @@ function update_script() {
cp /opt/.env /opt/tinyauth cp /opt/.env /opt/tinyauth
rm -f "$temp_file" rm -f "$temp_file"
msg_ok "Updated tinyauth" msg_ok "Updated tinyauth"
else
msg_ok "No update required. ${APP} is already at ${RELEASE}"
fi
msg_info "Restarting tinyauth" msg_info "Restarting tinyauth"
$STD service tinyauth start $STD service tinyauth start