uptime-kuma: Add ability to select version

This commit is contained in:
tschettervictor
2025-01-27 14:39:54 -07:00
committed by GitHub
parent b05141c17f
commit 11f626524f

View File

@@ -2,6 +2,7 @@
# Install Uptime-Kuma
APP_NAME="Uptime-Kuma"
APP_VERSION="latest"
DATA_PATH="/mnt/data"
NODE_VERSION="18"
@@ -25,7 +26,11 @@ mkdir -p /var/run/uptimekuma
pw user add uptimekuma -c uptimekuma -u 3001 -d /nonexistent -s /usr/bin/nologin
npm install npm -g
cd /usr/local/ && git clone https://github.com/louislam/uptime-kuma.git
cd /usr/local/uptime-kuma && npm run setup
if [ "{APP_VERSION}" = "latest" ]; then
cd /usr/local/uptime-kuma && npm run setup
else
git checkout "${APP_VERSION}" && npm ci --production && npm run download-dist
fi
sed -i '' "s|console.log(\"Welcome to Uptime Kuma\");|process.chdir('/usr/local/uptime-kuma');\n&|" /usr/local/uptime-kuma/server/server.js
fetch -o /usr/local/etc/rc.d/ https://raw.githubusercontent.com/tschettervictor/bsd-apps/main/uptime-kuma/includes/uptimekuma
chmod +x /usr/local/etc/rc.d/uptimekuma