Compare commits

..
Author SHA1 Message Date
MickLesk d3f122816d Umami: pin pnpm from engines.pnpm on install, set APP_SECRET
The install took pnpm@latest before the release was fetched, but Umami
pins an exact engines.pnpm, so pnpm install refused to run. setup_nodejs
now runs after the fetch and reads that version, as the update does.

3.5 also requires APP_SECRET and no longer falls back to DATABASE_URL,
so a fresh install and every container updated to 3.5 answered 500. New
installs get a random secret. An existing .env gets APP_SECRET set to
its DATABASE_URL, which is the value 3.4 derived its secret from, so
logins, share links and session IDs stay valid. It runs before the
release check, so containers already on 3.5 are fixed by the next
update.

Fixes #19055
2026-11-26 12:38:00 +01:00
2 changed files with 13 additions and 1 deletions

No files matched your search

+9
View File
@@ -30,6 +30,15 @@ function update_script() {
exit
fi
if ! grep -q '^APP_SECRET=' /opt/umami/.env 2>/dev/null; then
msg_info "Setting APP_SECRET"
# 3.5 dropped the DATABASE_URL fallback; the same value keeps logins and session IDs valid
DB_URL=$(sed -n 's/^DATABASE_URL=//p' /opt/umami/.env 2>/dev/null | head -n1)
echo "APP_SECRET=${DB_URL:-$(openssl rand -hex 32)}" >>/opt/umami/.env
systemctl restart umami
msg_ok "Set APP_SECRET"
fi
if check_for_gh_release "umami" "umami-software/umami"; then
msg_info "Stopping Service"
systemctl stop umami
+4 -1
View File
@@ -13,15 +13,18 @@ setting_up_container
network_check
update_os
NODE_VERSION="22" NODE_MODULE="pnpm@latest" setup_nodejs
PG_VERSION="17" setup_postgresql
PG_DB_NAME="umamidb" PG_DB_USER="umami" setup_postgresql_db
fetch_and_deploy_gh_release "umami" "umami-software/umami" "tarball"
PNPM_VERSION=$(jq -r '.engines.pnpm // "latest"' /opt/umami/package.json)
NODE_VERSION="22" NODE_MODULE="pnpm@${PNPM_VERSION}" setup_nodejs
msg_info "Configuring Umami"
cd /opt/umami
$STD pnpm install
echo -e "DATABASE_URL=postgresql://$PG_DB_USER:$PG_DB_PASS@localhost:5432/$PG_DB_NAME" >>/opt/umami/.env
echo "APP_SECRET=$(openssl rand -hex 32)" >>/opt/umami/.env
$STD pnpm run build
msg_ok "Configured Umami"