update tinyauth

This commit is contained in:
tremor021 2025-04-24 16:07:31 +02:00
parent b77f38edf5
commit 39f6bc9477
2 changed files with 18 additions and 3 deletions

View File

@ -31,7 +31,16 @@ function update_script() {
msg_ok "Updated Alpine Packages" msg_ok "Updated Alpine Packages"
msg_info "Updating tinyauth" msg_info "Updating tinyauth"
$STD apk upgrade tinyauth RELEASE=$(curl -s https://api.github.com/repos/steveiliop56/tinyauth/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
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
cd /opt/tinyauth/frontend
$STD bun install
$STD bun run build
mv dist /opt/tinyauth/internal/assets/
cd /opt/tinyauth
$STD go mod download
CGO_ENABLED=0 go build -ldflags "-s -w"
msg_ok "Updated tinyauth" msg_ok "Updated tinyauth"
msg_info "Restarting tinyauth" msg_info "Restarting tinyauth"
@ -48,4 +57,4 @@ description
msg_ok "Completed Successfully!\n" msg_ok "Completed Successfully!\n"
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
echo -e "${INFO}${YW} Access it using the following URL:${CL}" echo -e "${INFO}${YW} Access it using the following URL:${CL}"
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:xxxx${CL}" echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}"

View File

@ -34,13 +34,19 @@ mv dist /opt/tinyauth/internal/assets/
cd /opt/tinyauth cd /opt/tinyauth
$STD go mod download $STD go mod download
CGO_ENABLED=0 go build -ldflags "-s -w" CGO_ENABLED=0 go build -ldflags "-s -w"
{
echo "tinyauth Credentials"
echo "Username: admin@example.com"
echo "Password: admin"
} >>~/tinyauth.creds
echo "${RELEASE}" >"/opt/${APP}_version.txt"
msg_ok "Installed tinyauth" msg_ok "Installed tinyauth"
msg_info "Enabling tinyauth Service" msg_info "Enabling tinyauth Service"
SECRET=$(head -c 16 /dev/urandom | xxd -p -c 16 | tr -d '\n') SECRET=$(head -c 16 /dev/urandom | xxd -p -c 16 | tr -d '\n')
{ {
echo "SECRET=${SECRET}" echo "SECRET=${SECRET}"
echo "USERS=admin@example.com:\$apr1\$n61ztxfk\$0f/uGQFxnB.FBa5cxgqNg." echo "USERS=admin@example.com:\$2a\$10\$CrTK.W7WXSClo3ZY1yJUFupg5UdV8WNcynEhZhJFNjhGQB.Ga0ZDm"
echo "APP_URL=http://localhost:3000" echo "APP_URL=http://localhost:3000"
} >>/opt/tinyauth/.env } >>/opt/tinyauth/.env