pulse-hub 3.5.0 → 3.6.0
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/CHANGELOG.md +6 -0
- package/backend/.env.example +52 -52
- package/backend/agent.js +372 -372
- package/backend/cli.js +23 -1
- package/backend/emails/env-backup.html +52 -52
- package/backend/emails/invite.html +53 -53
- package/backend/lib/agent-rpc.js +72 -72
- package/backend/lib/async-route.js +17 -17
- package/backend/lib/authz/bootstrap.js +35 -35
- package/backend/lib/authz/catalog.js +291 -291
- package/backend/lib/authz/delegation.js +104 -104
- package/backend/lib/authz/effective.js +104 -104
- package/backend/lib/authz/engine.js +251 -251
- package/backend/lib/authz/index.js +134 -134
- package/backend/lib/authz/migrate.js +871 -871
- package/backend/lib/authz/mutate.js +87 -87
- package/backend/lib/authz/preview.js +327 -327
- package/backend/lib/authz/scope.js +282 -282
- package/backend/lib/env-mask.js +131 -131
- package/backend/lib/invite-helpers.js +83 -83
- package/backend/lib/invites.js +160 -160
- package/backend/lib/logs.js +244 -244
- package/backend/lib/metrics.js +249 -249
- package/backend/lib/relay-state.js +564 -564
- package/backend/lib/session.js +48 -48
- package/backend/middleware/authz.js +65 -65
- package/backend/public/assets/favicon.svg +6 -6
- package/backend/public/assets/index.js +1 -1
- package/backend/public/index.html +23 -24
- package/backend/routes/access.js +123 -123
- package/backend/routes/audit.js +41 -41
- package/backend/routes/auth.js +207 -207
- package/backend/routes/invites-public.js +91 -91
- package/backend/routes/invites.js +121 -121
- package/backend/routes/logs.js +68 -68
- package/backend/routes/metrics.js +76 -76
- package/backend/routes/policies.js +240 -240
- package/backend/routes/teams.js +221 -221
- package/backend/routes/users.js +100 -100
- package/backend/seed-admins.js +68 -68
- package/backend/server.js +106 -106
- package/backend/ws/agent-relay.js +159 -159
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
One version covers the hub and the agent. Newest first.
|
|
4
4
|
|
|
5
|
+
## 3.6.0
|
|
6
|
+
|
|
7
|
+
- `pulse-hub setup` now asks whether to set up email (Gmail address + App Password) for
|
|
8
|
+
invites and env-file backups. It defaults to no, and is also available as
|
|
9
|
+
`--gmail-address` / `--gmail-app-password`.
|
|
10
|
+
|
|
5
11
|
## 3.5.0
|
|
6
12
|
|
|
7
13
|
- The hub is now an installable npm package: `sudo npm install -g pulse-hub && sudo pulse-hub setup`.
|
package/backend/.env.example
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
# Copy to backend/.env (gitignored, never commit) — or, for an npm-installed hub, this is
|
|
2
|
-
# /etc/pulse-hub/hub.env (written by `sudo pulse-hub setup`; PULSE_ENV_FILE points elsewhere). Loaded via dotenv on startup; a var
|
|
3
|
-
# already set another way (systemd Environment=, a shell export) always wins over this
|
|
4
|
-
# file. Sign-in is Google-only (password login was removed) — the three Google OAuth
|
|
5
|
-
# vars below are REQUIRED for anyone to be able to log in at all. Everything else is
|
|
6
|
-
# optional: with only the Google vars set, sessions default to 1 hour with an
|
|
7
|
-
# auto-generated signing key, no invite-by-email, and PULSE_SEED_ADMIN_EMAILS is how a
|
|
8
|
-
# fresh install gets its first user.
|
|
9
|
-
|
|
10
|
-
# ---- Sessions ----
|
|
11
|
-
PULSE_JWT_SECRET= # signing key for session tokens; unset = auto-generated into data/pulse.db
|
|
12
|
-
PULSE_SESSION_MAX_AGE_SECONDS=3600 # session lifetime in seconds
|
|
13
|
-
|
|
14
|
-
# ---- Env file editor (see docs/env-files.md) ----
|
|
15
|
-
PULSE_ENV_ENCRYPTION_KEY= # encrypts saved env-file versions at rest; unset = auto-generated into data/pulse.db (same file as the ciphertext, so set this to keep the key off the DB). Changing it makes old versions unreadable.
|
|
16
|
-
|
|
17
|
-
# ---- Google OAuth (required — this is the only way to sign in; see "Invite emails" below for invite sending) ----
|
|
18
|
-
PULSE_GOOGLE_CLIENT_ID= # OAuth 2.0 Web application client ID
|
|
19
|
-
PULSE_GOOGLE_CLIENT_SECRET= # OAuth 2.0 client secret
|
|
20
|
-
PULSE_GOOGLE_REDIRECT_URI=https://your-hub-domain.example/auth/google/callback # must exactly match the client's authorized redirect URI
|
|
21
|
-
|
|
22
|
-
# ---- Invite emails ----
|
|
23
|
-
# One shared Gmail account sends every invite, regardless of who clicks "invite" — not a
|
|
24
|
-
# per-user OAuth consent flow. Enable 2-Step Verification on that account, then create an
|
|
25
|
-
# App Password (https://myaccount.google.com/apppasswords) and use it here, not the
|
|
26
|
-
# account's real password.
|
|
27
|
-
PULSE_GMAIL_ADDRESS= # the shared Gmail account's address, e.g. pulse@example.com
|
|
28
|
-
PULSE_GMAIL_APP_PASSWORD= # that account's 16-character App Password
|
|
29
|
-
PULSE_PUBLIC_URL=https://your-hub-domain.example # hub's public base URL, used to build invite email links (no trailing slash)
|
|
30
|
-
|
|
31
|
-
# ---- Seed allowed emails ----
|
|
32
|
-
# On a fresh install this is how you get your FIRST user — there is no default
|
|
33
|
-
# admin/admin account anymore, and the invite flow needs an existing user to send one.
|
|
34
|
-
PULSE_SEED_ADMIN_EMAILS=alice@example.com,bob@example.com # comma-separated emails allowed to sign in with Google without an invite; run `npm run seed-admins` after editing
|
|
35
|
-
|
|
36
|
-
# ---- Roles: initial/additional super admins ----
|
|
37
|
-
# super_admin is Pulse's top role (see CLAUDE.md's "Auth model" / roles) — can manage
|
|
38
|
-
# every user's role (admin <-> viewer) and remove anyone but another super_admin. It is
|
|
39
|
-
# NEVER assignable from the Team page UI; the only way in is this env var followed by
|
|
40
|
-
# `npm run seed-admins` (creates the user if new, promotes them if already known — safe
|
|
41
|
-
# to re-run any time you add someone here). Every other pre-existing user becomes a
|
|
42
|
-
# plain 'admin' the first time a hub upgrades onto roles, so nobody loses access
|
|
43
|
-
# silently — see backend/lib/db.js's role migration.
|
|
44
|
-
PULSE_SUPER_ADMIN_EMAILS=alice@example.com # comma-separated; run `npm run seed-admins` after editing
|
|
45
|
-
|
|
46
|
-
# How long audit-log rows are kept before the hourly prune deletes them (days).
|
|
47
|
-
PULSE_AUDIT_RETENTION_DAYS=180
|
|
48
|
-
|
|
49
|
-
# ---- Network ----
|
|
50
|
-
# Where the hub listens. Keep 127.0.0.1 and put nginx in front of it.
|
|
51
|
-
PULSE_HOST=127.0.0.1
|
|
52
|
-
PULSE_PORT=5080
|
|
1
|
+
# Copy to backend/.env (gitignored, never commit) — or, for an npm-installed hub, this is
|
|
2
|
+
# /etc/pulse-hub/hub.env (written by `sudo pulse-hub setup`; PULSE_ENV_FILE points elsewhere). Loaded via dotenv on startup; a var
|
|
3
|
+
# already set another way (systemd Environment=, a shell export) always wins over this
|
|
4
|
+
# file. Sign-in is Google-only (password login was removed) — the three Google OAuth
|
|
5
|
+
# vars below are REQUIRED for anyone to be able to log in at all. Everything else is
|
|
6
|
+
# optional: with only the Google vars set, sessions default to 1 hour with an
|
|
7
|
+
# auto-generated signing key, no invite-by-email, and PULSE_SEED_ADMIN_EMAILS is how a
|
|
8
|
+
# fresh install gets its first user.
|
|
9
|
+
|
|
10
|
+
# ---- Sessions ----
|
|
11
|
+
PULSE_JWT_SECRET= # signing key for session tokens; unset = auto-generated into data/pulse.db
|
|
12
|
+
PULSE_SESSION_MAX_AGE_SECONDS=3600 # session lifetime in seconds
|
|
13
|
+
|
|
14
|
+
# ---- Env file editor (see docs/env-files.md) ----
|
|
15
|
+
PULSE_ENV_ENCRYPTION_KEY= # encrypts saved env-file versions at rest; unset = auto-generated into data/pulse.db (same file as the ciphertext, so set this to keep the key off the DB). Changing it makes old versions unreadable.
|
|
16
|
+
|
|
17
|
+
# ---- Google OAuth (required — this is the only way to sign in; see "Invite emails" below for invite sending) ----
|
|
18
|
+
PULSE_GOOGLE_CLIENT_ID= # OAuth 2.0 Web application client ID
|
|
19
|
+
PULSE_GOOGLE_CLIENT_SECRET= # OAuth 2.0 client secret
|
|
20
|
+
PULSE_GOOGLE_REDIRECT_URI=https://your-hub-domain.example/auth/google/callback # must exactly match the client's authorized redirect URI
|
|
21
|
+
|
|
22
|
+
# ---- Invite emails ----
|
|
23
|
+
# One shared Gmail account sends every invite, regardless of who clicks "invite" — not a
|
|
24
|
+
# per-user OAuth consent flow. Enable 2-Step Verification on that account, then create an
|
|
25
|
+
# App Password (https://myaccount.google.com/apppasswords) and use it here, not the
|
|
26
|
+
# account's real password.
|
|
27
|
+
PULSE_GMAIL_ADDRESS= # the shared Gmail account's address, e.g. pulse@example.com
|
|
28
|
+
PULSE_GMAIL_APP_PASSWORD= # that account's 16-character App Password
|
|
29
|
+
PULSE_PUBLIC_URL=https://your-hub-domain.example # hub's public base URL, used to build invite email links (no trailing slash)
|
|
30
|
+
|
|
31
|
+
# ---- Seed allowed emails ----
|
|
32
|
+
# On a fresh install this is how you get your FIRST user — there is no default
|
|
33
|
+
# admin/admin account anymore, and the invite flow needs an existing user to send one.
|
|
34
|
+
PULSE_SEED_ADMIN_EMAILS=alice@example.com,bob@example.com # comma-separated emails allowed to sign in with Google without an invite; run `npm run seed-admins` after editing
|
|
35
|
+
|
|
36
|
+
# ---- Roles: initial/additional super admins ----
|
|
37
|
+
# super_admin is Pulse's top role (see CLAUDE.md's "Auth model" / roles) — can manage
|
|
38
|
+
# every user's role (admin <-> viewer) and remove anyone but another super_admin. It is
|
|
39
|
+
# NEVER assignable from the Team page UI; the only way in is this env var followed by
|
|
40
|
+
# `npm run seed-admins` (creates the user if new, promotes them if already known — safe
|
|
41
|
+
# to re-run any time you add someone here). Every other pre-existing user becomes a
|
|
42
|
+
# plain 'admin' the first time a hub upgrades onto roles, so nobody loses access
|
|
43
|
+
# silently — see backend/lib/db.js's role migration.
|
|
44
|
+
PULSE_SUPER_ADMIN_EMAILS=alice@example.com # comma-separated; run `npm run seed-admins` after editing
|
|
45
|
+
|
|
46
|
+
# How long audit-log rows are kept before the hourly prune deletes them (days).
|
|
47
|
+
PULSE_AUDIT_RETENTION_DAYS=180
|
|
48
|
+
|
|
49
|
+
# ---- Network ----
|
|
50
|
+
# Where the hub listens. Keep 127.0.0.1 and put nginx in front of it.
|
|
51
|
+
PULSE_HOST=127.0.0.1
|
|
52
|
+
PULSE_PORT=5080
|