Commit Graph

11 Commits

Author SHA1 Message Date
1387ca262b fix(migration): update systemd service file during v3→v4 migration
All checks were successful
CI / Type Check & Lint (push) Successful in 6s
CI / Build Test (Current Platform) (push) Successful in 5s
CI / Build All Platforms (push) Successful in 47s
Critical fixes for v3→v4 migration:

1. install.sh: Auto-update systemd service file during migration
   - Calls 'nupst service enable' before restarting service
   - Only when migrating from v3 (OLD_NODE_INSTALL=1)
   - Ensures service file has correct v4 paths

2. ts/systemd.ts: Fix hardcoded v3 paths in service template
   - ExecStart: /opt/nupst/bin/nupst daemon-start (v3, broken)
              → /usr/local/bin/nupst service start-daemon (v4, correct)
   - Description: Updated to 'Deno-powered UPS Monitoring Tool'
   - Added RestartSec=10 (prevent rapid restart loops)
   - Removed NODE_ENV=production (not needed for Deno)
   - WorkingDirectory: /tmp → /opt/nupst

Without these fixes:
- Service fails to start after migration
- Service file points to non-existent /opt/nupst/bin/nupst
- Users must manually run 'nupst service enable'

Discovered via Docker migration testing in test/manualdocker/
2025-10-19 14:37:32 +00:00
e1383097b2 fix: update migration references in installer and README 2025-10-19 13:05:51 +00:00
4faa10c494 feat(install): add proper update/migration support for existing installations
Some checks failed
CI / Build All Platforms (Tag/Main only) (push) Has been skipped
CI / Type Check & Lint (push) Failing after 41s
CI / Build Test (Current Platform) (push) Successful in 40s
Enhanced install.sh to properly handle updates and migrations:

**Update Detection & Service Management:**
- Detect old Node.js-based installations (v3.x) via package.json/node_modules
- Stop running service before updating binary
- Restart service after successful update if it was running
- Preserve /etc/nupst/config.json during updates

**Migration from v3.x to v4.0:**
- Clean up old Node.js installation files:
  - node_modules/, vendor/, dist_ts/ directories
  - package.json, package-lock.json, pnpm-lock.yaml
  - tsconfig.json, setup.sh, bin/ directory
- Inform user about migration with helpful feedback
- Link to migration guide documentation

**User Experience Improvements:**
- Show different messages for new installs vs updates
- Inform about v3.x → v4.0 migration when detected
- Display migration guide link for old installations
- Show service restart status
- Provide context-aware next steps based on config presence

**Safety Features:**
- Ask for confirmation before replacing existing installation (interactive mode)
- Preserve user configuration in /etc/nupst/
- Handle service state properly (stop → update → restart)
- Graceful cleanup with error suppression (|| true)

This ensures seamless updates from any version (including v3.x Node.js installs)
to v4.0+ Deno-based binaries without manual intervention or data loss.
2025-10-19 10:23:14 +00:00
df6a44d5d9 feat: complete migration to Deno with automated releases
- Remove old Node.js infrastructure (package.json, tsconfig.json, bin/nupst launcher, setup.sh)
- Update install.sh to download pre-compiled binaries from Gitea releases
- Add Gitea Actions CI/CD workflows:
  - ci.yml: Type checking, linting, and build verification
  - release.yml: Automated binary compilation and release on tags
- Update .gitignore for Deno-focused project structure
- Binary-based distribution requires no dependencies or build steps
2025-10-18 13:20:23 +00:00
65a9d1c798 fix(installer): Improve Git dependency handling and repository cloning in install.sh 2025-03-25 13:20:36 +00:00
623b7ee51f fix(installer): Improve installation instructions for interactive and non-interactive setups 2025-03-25 13:15:48 +00:00
ed78db20e2 fix(install): Improve interactive terminal detection and update installation instructions 2025-03-25 13:12:38 +00:00
55c040df82 fix(install): Improve interactive mode detection and non-interactive installation handling in install.sh 2025-03-25 13:08:28 +00:00
9b9e009523 feat(installer): Add auto-yes flag to installer and update installation documentation 2025-03-25 11:31:24 +00:00
bd5b85f6b0 feat(installer/cli): Add OS detection and git auto-installation support to install.sh and improve service setup prompt in CLI 2025-03-25 11:25:03 +00:00
1e74fbe367 initial 2025-03-25 09:06:23 +00:00