Skip to content

fix: stop installing the systemd service from postinstall - #78

Merged
Shinrai merged 2 commits into
nextfrom
fix/no-sudo-postinstall
Nov 29, 2026
Merged

Shinrai merged 2 commits into
nextfrom
fix/no-sudo-postinstall

Conversation

@cldmv-bot

@cldmv-bot cldmv-bot Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

🚀 What's Changed

💥 Breaking Changes

No breaking changes

✨ Features

No new features

🐛 Bug Fixes

📦 Dependencies

No dependency updates

🔧 Other Changes

👥 Contributors

Remove the postinstall hook, which ran sudo on every npm install and built a bad destination path when only /bin/systemctl existed. Add an explicit `wol-proxy install-service` command that prints the commands, refuses without systemd, reports failures, and always copies to /etc/systemd/system/wol-proxy.service. README documents per-platform setup.

Resolves #3
@cldmv-bot cldmv-bot Bot added the ! fix → next v4 flow: fix contributor PR targeting the next integration branch label Nov 29, 2026
@cldmv-bot cldmv-bot Bot changed the title test: cover the install-service command and the absence of install hooks fix: stop installing the systemd service from postinstall Nov 29, 2026
@cldmv-bot

cldmv-bot Bot commented Nov 29, 2026

Copy link
Copy Markdown
Contributor Author

Auto-normalized PR title: rewrote PR title to match the highest-priority commit type (fix).

  • Before: test: cover the install-service command and the absence of install hooks
  • After: fix: stop installing the systemd service from postinstall

If this isn't what you want, edit the title — the normalizer won't re-fire as long as the title stays conventional.

@cldmv-bot cldmv-bot Bot added area: tests Touches test files, fixtures, or test infrastructure type: dependencies Relates to dependency updates, version bumps, or package management type: documentation Relates to docs, README updates, guides, or inline code comments labels Nov 29, 2026
@Shinrai
Shinrai merged commit f7cc204 into next Nov 29, 2026
37 checks passed
@cldmv-bot
cldmv-bot Bot deleted the fix/no-sudo-postinstall branch November 29, 2026 06:32
cldmv-bot Bot added a commit that referenced this pull request Nov 30, 2026
# wol-proxy v1.0.12 Changelog

**Release Date**: November 2026
**Release Type**: Patch
**Branch**: `release/1.0.12`

---

## Overview

Installing wol-proxy no longer sets up a system service. The `postinstall` hook that ran `sudo` on every `npm install` is gone, and the systemd setup is now an explicit `wol-proxy install-service` command. `package.json` also declares the Node.js floor wol-proxy has always needed, and express moves to 5.3.0.

The rest is development tooling: the CLDMV dev tools, Vitest 5.1, file headers restamped with fix-headers 2.6.2, and CI workflow syncs. The HTTP server and its Wake-on-LAN behavior are unchanged.

---

## 🐛 Bug Fixes

### No more system changes during `npm install` ([#78](#78))

`postinstall.js` ran on every install, including `npm install` in a checkout or as a dependency. It tried to install the systemd unit with `sudo`, so an install could stop at a password prompt. When only `/bin/systemctl` existed, it also built a bad destination path. The hook and `postinstall.js` are removed, and fixes [#3](#3).

Setting up the service is now a step you run yourself:

```bash
wol-proxy install-service           # copies the unit and runs daemon-reload, with sudo when not root
wol-proxy install-service --print   # only prints the commands
```

It always copies the unit to `/etc/systemd/system/wol-proxy.service`. It exits with an error and changes nothing when systemd isn't running, and it reports a step that fails. Then run `sudo systemctl enable --now wol-proxy` as before. The README now covers each platform. macOS, Windows and other init systems have no automatic setup, and `wol-proxy.service` stays in the package as a reference.

### The Node.js floor is declared ([#67](#67))

`package.json` had no `engines`. It now says `"node": ">=18.0.0"`, which is express 5's own floor, so nothing that worked before stops working. The development toolchain's floor (Node.js 22.22.0, for Vitest 5) goes in `devEngines`, which only applies when you work on this repository, and it is also the CI minimum.

---

## 🔧 CI & tooling

- `ci.yml` is synced with the CLDMV/.github v4.43.0 template, so the release PR stops rerunning the test matrix on a commit its push run already tested ([#76](#76)).
- Superseded CI runs on `next` and `hotfixes` are cancelled, so they stop filling the org's hosted runner pool ([#79](#79)). Fixes [#77](#77).
- The `sync-release-notes` companion workflow keeps GitHub Release bodies and tags in step with these changelog files ([#71](#71)).
- Every file header is restamped with fix-headers 2.6.2, which writes `@Filename` without a leading slash. This accounts for most of the files touched in this release and changes no behavior ([#80](#80)).
- `tmp/` is gitignored ([#64](#64)).

## 📚 Documentation

- README: the service section is rewritten around `wol-proxy install-service`, with notes for macOS, Windows and other init systems ([#78](#78)).
- README: the install command names the real package, `npm install -g @cldmv/wol-proxy`. The unscoped `wol-proxy` name is no longer on npm.
- **NEW:** [docs/changelog/v1/v1.0.12.md](https://github.com/CLDMV/wol-proxy/blob/v1.0.12/docs/changelog/v1/v1.0.12.md), this changelog.
- README **✨ What's New** updated for v1.0.12.

## 🔧 Dependencies

- **`express` ^5.1.0 → ^5.3.0** (locked 5.2.1 → 5.3.0), the only runtime change. It brings in the `qs` and `proxy-addr` advisory fixes ([#80](#80)).
- **CLDMV dev tools** ([#69](#69), [#73](#73), [#80](#80)): `@cldmv/vitest-runner` 1.5.3 → 1.11.5, `@cldmv/configs` 1.2.4 → 1.5.1 and `@cldmv/fix-headers` 2.2.0 → 2.6.2. `package.json` adds the fleet `katex` and `minimatch` overrides for the `@eslint/markdown` chain that configs 1.5 brings in, so `npm audit` is clean, and `dependabot.yml` takes the npm groups from the CLDMV/.github v4.47.0 template. Development only.
- **`vitest` and `@vitest/coverage-v8` 5.0.3 → 5.1.2** ([#72](#72), [#80](#80)). Development only.

---

## Upgrade notes

- If you relied on `npm install -g @cldmv/wol-proxy` setting up the systemd service, run `wol-proxy install-service` once after installing. A service you already set up keeps working; the unit file is the same.
- Node.js 18 or later, as express 5 already required.
- No other changes. The HTTP API and its options are the same as in v1.0.11.



<details>
<summary>👥 Contributors</summary>

- @Shinrai

</details>

---

<!-- coverage-start -->

![coverage](https://img.shields.io/badge/coverage-100.0%25-brightgreen?style=for-the-badge&logo=vitest&logoColor=white)

| Metric | Coverage |
|--------|----------|
| Statements | 100.0% |
| Branches   | 100.0% |
| Functions  | 100.0% |
| Lines      | 100.0% |

*Avg: **100.0%** · `0032a7a` · Node lts/**

<!-- coverage-end -->

<!-- co-authors -->

Co-authored-by: Shinrai <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: tests Touches test files, fixtures, or test infrastructure ! fix → next v4 flow: fix contributor PR targeting the next integration branch type: dependencies Relates to dependency updates, version bumps, or package management type: documentation Relates to docs, README updates, guides, or inline code comments

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant