Update tinyauth

This commit is contained in:
tremor021 2025-04-24 13:21:48 +02:00
parent 780dc4c967
commit bc9827a008
2 changed files with 20 additions and 23 deletions

View File

@ -20,28 +20,25 @@ color
catch_errors catch_errors
function update_script() { function update_script() {
header_info header_info
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
msg_ok "Updated Alpine Packages" msg_ok "Updated Alpine Packages"
echo "DEBUG: CT_TYPE before update_script=${CT_TYPE:-UNDEFINED}" msg_info "Updating tinyauth"
echo "DEBUG: var_unprivileged=${var_unprivileged:-UNDEFINED}" $STD apk upgrade tinyauth
msg_ok "Updated tinyauth"
msg_info "Updating tinyauth" msg_info "Restarting tinyauth"
$STD apk upgrade tinyauth $STD rc-service tinyauth restart
msg_ok "Updated tinyauth" msg_ok "Restarted tinyauth"
msg_info "Restarting tinyauth" exit 0
$STD rc-service tinyauth restart
msg_ok "Restarted tinyauth"
exit 0
} }
start start

View File

@ -26,7 +26,7 @@ $STD npm install -g bun
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, 2, length($2)-3) }') RELEASE=$(curl -s https://api.github.com/repos/steveiliop56/tinyauth/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
curl -fsSL https://github.com/steveiliop56/tinyauth/archive/refs/tags/v3.1.0.tar.gz -o $temp_file curl -fsSL https://github.com/steveiliop56/tinyauth/archive/refs/tags/v3.1.0.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/site cd /opt/tinyauth/site
$STD bun install $STD bun install
$STD bun run build $STD bun run build
@ -40,17 +40,17 @@ msg_ok "Installed tinyauth"
msg_info "Enabling tinyauth Service" msg_info "Enabling tinyauth Service"
service_path="/etc/init.d/tinyauth" service_path="/etc/init.d/tinyauth"
echo '#!/sbin/openrc-run echo "#!/sbin/openrc-run
description="tinyauth Service" description="tinyauth Service"
command="/opt/tinyauth/tinyauth" command="/opt/tinyauth/tinyauth"
command_args="--secret=$SECRET --users=admin@example.com:$apr1$n61ztxfk$0f/uGQFxnB.FBa5cxgqNg." command_args="--secret=$SECRET --users=admin@example.com:\$apr1\$n61ztxfk\$0f/uGQFxnB.FBa5cxgqNg."
command_user="root" command_user="root"
pidfile="/var/run/tinyauth.pid" pidfile="/var/run/tinyauth.pid"
depend() { depend() {
use net use net
}' >$service_path }" >$service_path
chmod +x $service_path chmod +x $service_path
$STD rc-update add tinyauth default $STD rc-update add tinyauth default