@xeplr/monitor 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -15,7 +15,7 @@ The page itself is [`@xeplr/ui-monitor`](https://github.com/Xeplr/xeplr-ui-monit
15
15
  On the servers, every app already runs as a systemd service: `xeplr-bi-api`, `xeplr-bi-auth`, `xeplr-bi-jobs`, and testbi's `xeplr-bi-dev-*`. The monitor starts nothing itself. It asks `systemctl` the same way the deploy does, and reads the journal, where the services' output goes.
16
16
 
17
17
  ```
18
- browser ──https──▶ nginx ──▶ xeplr-monitor (127.0.0.1:19400, its own user)
18
+ browser ──https──▶ nginx ──▶ xeplr-monitor (port 19400, its own user)
19
19
  ├─ systemctl show status (no sudo)
20
20
  ├─ sudo -n systemctl start|stop|restart|kill (sudoers: xeplr-* only)
21
21
  └─ journalctl -u … -o json [-f] (systemd-journal group)
@@ -50,7 +50,6 @@ The page turns these into a short **needs a look** list for a running service: m
50
50
  | `MONITOR_SECRET` | **yes** | Signs the sign-in cookie. At least 32 characters (`openssl rand -base64 48`). Changing it signs everyone out. |
51
51
  | `MONITOR_ALLOW` | **yes** | Which services may be added and controlled, comma-separated; `*` matches anything: `xeplr-*` or `xeplr-*,postgresql`. Keep sudoers the same. |
52
52
  | `MONITOR_PORT` | no | Default 19400. |
53
- | `MONITOR_HOST` | no | Default `127.0.0.1`, so only nginx on the same machine reaches it. |
54
53
  | `MONITOR_SUDO` | no | `actions` (default): start, stop, restart and kill go through `sudo -n`. `all`: reading the journal does too. `none`: nothing does (root, or polkit rights). |
55
54
 
56
55
  There are no defaults for where data lives. A missing required setting stops the server at startup and names it. `requiredEnv` is exported, so a host can add it to its own `env.required.js`.
package/bin/server.js CHANGED
@@ -12,8 +12,7 @@ monitor.start({
12
12
  secret: process.env.MONITOR_SECRET,
13
13
  allow: process.env.MONITOR_ALLOW,
14
14
  sudo: process.env.MONITOR_SUDO,
15
- port: process.env.MONITOR_PORT,
16
- host: process.env.MONITOR_HOST
15
+ port: process.env.MONITOR_PORT
17
16
  }).catch(function(err) {
18
17
  console.error('[xeplr-monitor] could not start:', err.message);
19
18
  process.exit(1);
package/bin/users.js CHANGED
File without changes
@@ -13,5 +13,4 @@ MONITOR_ALLOW=xeplr-*
13
13
 
14
14
  # Optional.
15
15
  # MONITOR_PORT=19400 (default 19400)
16
- # MONITOR_HOST=127.0.0.1 (default: only nginx on this machine reaches it)
17
16
  # MONITOR_SUDO=actions (actions | all | none — see the README)
package/index.js CHANGED
@@ -59,8 +59,8 @@ function pageRouter(dir) {
59
59
 
60
60
  /**
61
61
  * Serve it: the API at /api, the page everywhere else. → the http server,
62
- * once listening. Listens on 127.0.0.1 unless told otherwise: nginx is its
63
- * front door.
62
+ * once listening on its port. nginx is its front door, as for every xeplr
63
+ * service.
64
64
  */
65
65
  function start(config) {
66
66
  config = config || {};
@@ -68,7 +68,6 @@ function start(config) {
68
68
  // 0 is a port too (any free one); only a missing value takes the default.
69
69
  var port = config.port === undefined || config.port === null || config.port === '' ? 19400 : Number(config.port);
70
70
  var built = createApp(port, 'xeplr-monitor', {
71
- host: config.host || '127.0.0.1',
72
71
  // Its own sign-in: it must work when @xeplr/auth is down. The headers go in
73
72
  // front of it, so a refused request carries them too (createApp's
74
73
  // `middleware` runs only after the gate).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xeplr/monitor",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "See and control a server's services: status, start, stop, restart, kill, and their logs live. Its own sign-in, no database",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -39,7 +39,7 @@
39
39
  "node": ">=20"
40
40
  },
41
41
  "dependencies": {
42
- "@xeplr/base-apis": "^3.0.2",
42
+ "@xeplr/base-apis": "^3.0.3",
43
43
  "@xeplr/utils": "^2.0.1",
44
44
  "express": "^5.3.0"
45
45
  },