DroppedNeedle: pass release version to the app via COMMIT_TAG (#18042)

The app reads its version from COMMIT_TAG and falls back to "dev".
Set it in the systemd unit on install, migration and update.

Fixes #18040

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
CanbiZ (MickLesk)
2026-10-21 08:29:57 +02:00
committed by GitHub
parent 8104d2ba1f
commit dc87974c5d
2 changed files with 7 additions and 0 deletions
+6
View File
@@ -91,6 +91,7 @@ User=root
WorkingDirectory=/opt/droppedneedle/backend
Environment=ROOT_APP_DIR=/opt/droppedneedle/backend
Environment=PORT=8688
Environment=COMMIT_TAG=v$(<~/.droppedneedle)
# Environment=SLSKD_DOWNLOADS_PATH=<path-to-slskd-downloads>
ExecStart=/opt/droppedneedle/venv/bin/python -m maintenance.automatic_upgrade --start-target
Restart=on-failure
@@ -106,6 +107,11 @@ EOF
sed -i '\|=8688$|a# Environment=SLSKD_DOWNLOADS_PATH=<path-to-slskd-downloads>' /etc/systemd/system/droppedneedle.service
fi
sed -i 's|^ExecStart=.*|ExecStart=/opt/droppedneedle/venv/bin/python -m maintenance.automatic_upgrade --start-target|' /etc/systemd/system/droppedneedle.service
if grep -q '^Environment=COMMIT_TAG=' /etc/systemd/system/droppedneedle.service; then
sed -i "s|^Environment=COMMIT_TAG=.*|Environment=COMMIT_TAG=v$(<~/.droppedneedle)|" /etc/systemd/system/droppedneedle.service
else
sed -i "\|=8688$|a Environment=COMMIT_TAG=v$(<~/.droppedneedle)" /etc/systemd/system/droppedneedle.service
fi
fi
systemctl daemon-reload
+1
View File
@@ -44,6 +44,7 @@ User=root
WorkingDirectory=/opt/droppedneedle/backend
Environment=ROOT_APP_DIR=/opt/droppedneedle/backend
Environment=PORT=8688
Environment=COMMIT_TAG=v$(<~/.droppedneedle)
# Environment=SLSKD_DOWNLOADS_PATH=<path-to-slskd-downloads>
ExecStart=/opt/droppedneedle/venv/bin/python -m maintenance.automatic_upgrade --start-target
Restart=on-failure