mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-11-08 14:30:25 +01:00
fix(planka): run the service with node instead of nodemon
npm 12 rejects --prod, and --production still starts PLANKA through nodemon. Starting node app.js directly needs HOME: Sails 1.5.18 only looks for the project's .sailsrc when HOME is set, and systemd sets none without User=, so the app lifted with the wrong paths and returned 503. The unit now sets NODE_ENV and HOME, and an update repairs existing units even without a new release. Follow-up to #18477.
This commit is contained in:
+9
-2
@@ -30,6 +30,15 @@ function update_script() {
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
if ! grep -q "^Environment=HOME=" /etc/systemd/system/planka.service; then
|
||||
msg_info "Updating Service"
|
||||
sed -i -e '/^Environment=NODE_ENV=/d' -e 's|^ExecStart=.*|Environment=NODE_ENV=production\nEnvironment=HOME=/root\nExecStart=/usr/bin/node app.js --prod|' /etc/systemd/system/planka.service
|
||||
systemctl daemon-reload
|
||||
systemctl restart planka
|
||||
msg_ok "Updated Service"
|
||||
fi
|
||||
|
||||
if check_for_gh_release "planka" "plankanban/planka"; then
|
||||
msg_info "Stopping Service"
|
||||
systemctl stop planka
|
||||
@@ -80,8 +89,6 @@ function update_script() {
|
||||
msg_ok "Migrated Database"
|
||||
|
||||
msg_info "Starting Service"
|
||||
sed -i 's|ExecStart=/usr/bin/npm start --prod$|ExecStart=/usr/bin/npm start --production|' /etc/systemd/system/planka.service
|
||||
systemctl daemon-reload
|
||||
systemctl start planka
|
||||
msg_ok "Started Service"
|
||||
msg_ok "Updated successfully!"
|
||||
|
||||
@@ -70,7 +70,9 @@ After=network.target
|
||||
|
||||
[Service]
|
||||
WorkingDirectory=/opt/planka
|
||||
ExecStart=/usr/bin/npm start --production
|
||||
Environment=NODE_ENV=production
|
||||
Environment=HOME=/root
|
||||
ExecStart=/usr/bin/node app.js --prod
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
|
||||
Reference in New Issue
Block a user