mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-11-09 12:53:13 +01:00
fix(planka): run the service with node instead of nodemon (#18503)
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:
1 parent
5720358d1b
commit
bc348949c4
2 files changed
+12
-3
No files matched your search
+9
-2
@@ -30,6 +30,15 @@ function update_script() {
|
|||||||
msg_error "No ${APP} Installation Found!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
exit
|
exit
|
||||||
fi
|
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
|
if check_for_gh_release "planka" "plankanban/planka"; then
|
||||||
msg_info "Stopping Service"
|
msg_info "Stopping Service"
|
||||||
systemctl stop planka
|
systemctl stop planka
|
||||||
@@ -80,8 +89,6 @@ function update_script() {
|
|||||||
msg_ok "Migrated Database"
|
msg_ok "Migrated Database"
|
||||||
|
|
||||||
msg_info "Starting Service"
|
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
|
systemctl start planka
|
||||||
msg_ok "Started Service"
|
msg_ok "Started Service"
|
||||||
msg_ok "Updated successfully!"
|
msg_ok "Updated successfully!"
|
||||||
|
|||||||
@@ -70,7 +70,9 @@ After=network.target
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
WorkingDirectory=/opt/planka
|
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
|
Restart=always
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
|||||||
Reference in new issue
Block a user