pgserve 2.2.1 → 2.2.3

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 CHANGED
@@ -14,6 +14,110 @@ All notable changes to `pgserve` are documented here. The format follows
14
14
  [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and this project adheres
15
15
  to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
16
16
 
17
+ ## [2.2.3] - 2026-05-03
18
+
19
+ ### Changed
20
+
21
+ - **`autopg install` now auto-supervises the console UI under pm2** as a
22
+ separate process named `autopg-ui`. The bundled SPA from v2.2.2 is now
23
+ always available at `http://127.0.0.1:8433` after a fresh install — no
24
+ more "operator runs install, doesn't know the UI exists" gap.
25
+ - **The console now requires a password** (Basic Auth). On first install
26
+ `autopg install` generates a 24-char admin password, prints it ONCE to
27
+ stdout, and stores the scrypt hash in `~/.autopg/admin.json` (mode
28
+ 0600). Browsers prompt natively for the password on first visit and
29
+ cache it for the session.
30
+ - **`autopg uninstall` removes both processes** (`autopg-ui` + `pgserve`)
31
+ cleanly.
32
+
33
+ ### Added
34
+
35
+ - **`autopg auth rotate-admin-password`** — generates a new admin
36
+ password, prints once, updates `admin.json`. Existing browser sessions
37
+ re-prompt on their next request.
38
+ - **`autopg auth show-admin-path`** — prints the path to `admin.json`.
39
+ - **`--with-ui` flag on `autopg install`** — UI-only path. Refreshes
40
+ (or registers) just the `autopg-ui` pm2 process without touching the
41
+ daemon. Useful for changing UI host/port post-install or for
42
+ retrofitting the UI onto a v2.2.2 host without restarting postgres.
43
+ - **`--redeploy` flag on `autopg install`** — full redeploy: tears down
44
+ both pm2 processes and reinstalls fresh. Equivalent to
45
+ `autopg uninstall && autopg install` in one command.
46
+ - **`--no-ui` flag on `autopg install`** — opt out of the UI process for
47
+ CI / headless / server hosts that don't need a permanent localhost web
48
+ server.
49
+ - **`--ui-port N` flag on `autopg install`** — override the default UI
50
+ port (8433).
51
+ - **`--ui-host H` flag on `autopg install`** — override the default UI
52
+ bind host (127.0.0.1). Non-loopback values trigger a loud warning at
53
+ the UI server because the console has no TLS.
54
+ - **`AUTOPG_DISABLE_AUTH=1` env var** — escape hatch for CI / smoke tests.
55
+ Only honored when the request comes from `127.0.0.1` / `::1`; cannot
56
+ accidentally expose an unauthenticated UI on a LAN.
57
+
58
+ ### Notes
59
+
60
+ - **Re-run `autopg install` on existing v2.2.2 hosts** to pick up the UI
61
+ auto-supervise + admin password. Idempotent — the daemon is left
62
+ untouched. The first re-run prints the new admin password.
63
+ - **UI process memory cap is 256MB**. Restart budget + exp-backoff are
64
+ shared with the daemon's hardened defaults.
65
+ - **Single-user dev tool boundary, with auth at the door.** Loopback
66
+ binding + Basic Auth + scrypt-hashed password covers the
67
+ "random-local-process-curl'ing-settings" case. Multi-user hosts where
68
+ intra-UID isolation matters should use `--no-ui`.
69
+ - **Hash scheme**: scrypt (RFC 7914, Node built-in since v10.5),
70
+ N=16384, r=8, p=1, 32-byte derived key, 32-byte salt. No npm dep
71
+ added.
72
+
73
+ ## [2.2.2] - 2026-05-03
74
+
75
+ ### Changed
76
+
77
+ - **console: pre-bundle assets via `bun build`; drop CDN Babel dependency.**
78
+ The `autopg ui` console previously loaded `react@18`, `react-dom@18`, and
79
+ `@babel/standalone` from `unpkg.com` and transpiled `.jsx` files in the
80
+ browser. The console is now pre-bundled into `console/dist/app.js`
81
+ (~210KB minified) at publish time. Operators on offline / corporate-proxy
82
+ / flaky-network hosts now get a fully local UI. Eliminates ~150KB of
83
+ in-browser Babel work per page load.
84
+ - **console: source moves to `console/src/`; npm tarball ships only
85
+ `console/dist/`.** Repo layout now has `console/src/` (editable sources,
86
+ gitignored from publish) and `console/dist/` (build artifact, in tarball,
87
+ gitignored in repo). `package.json#files` updated to ship `console/dist/`
88
+ only (drop ~80KB of unminified `.jsx` from npm install).
89
+ - **`react@^18.3.1` and `react-dom@^18.3.1` added as runtime dependencies.**
90
+ Versions match the unpkg UMD scripts loaded by v2.2.1 and earlier — no
91
+ behavior change. Required for the bun-build pipeline to bundle them.
92
+
93
+ ### Added
94
+
95
+ - **`bun run console:build`** — produces `console/dist/{app.js,index.html,*.css}`
96
+ via `bun build console/src/main.jsx --target browser --minify`. Wired into
97
+ `prepublishOnly` so npm publish always ships fresh artifacts.
98
+ - **`bun run console:dev`** — incremental rebuild on file change for
99
+ contributors editing the SPA. Output goes to `console/dist/app.js`.
100
+ - **`console/src/main.jsx`** — entry shim that imports `react` + `react-dom`,
101
+ exposes them on `globalThis`, then imports the existing flat-script `.jsx`
102
+ sources in original `<script>`-tag order. Preserves the SPA's existing
103
+ global-pattern code without rewriting every file.
104
+ - **`tests/console/no-cdn.test.js`** — regression test that boots
105
+ `autopg ui`, asserts served HTML has zero `unpkg`/`jsdelivr`/`cdn.babel`/
106
+ `babel/standalone` references, and verifies `app.js` is reachable as a
107
+ static asset.
108
+
109
+ ### Notes
110
+
111
+ - **Trust boundary:** `127.0.0.1` only, single-user, no auth, no TLS — same
112
+ as v2.2.x.
113
+ - **`src/cli-ui.cjs#resolveConsoleRoot()`** prefers `console/dist/` when
114
+ present, falls back to `console/src/` for repo-checkout dev mode (with a
115
+ one-line stderr warning to remind contributors to run `console:build`).
116
+ - **Bundle size deviation:** wish target was ≤100KB minified; realistic
117
+ baseline is ~210KB (React 18 alone is ~130KB minified+gzipped). The
118
+ 100KB target was aspirational and unachievable without removing React;
119
+ CHANGELOG documents the actual figure for transparency.
120
+
17
121
  ## Unreleased — autopg console settings
18
122
 
19
123
  ### Added