@lenne.tech/nest-server 12.3.2 → 12.5.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/.claude/rules/configurable-features.md +2 -1
- package/.claude/rules/testing.md +4 -4
- package/FRAMEWORK-API.md +2 -1
- package/dist/core/common/helpers/config-endpoint.helper.d.ts +3 -0
- package/dist/core/common/helpers/config-endpoint.helper.js +17 -0
- package/dist/core/common/helpers/config-endpoint.helper.js.map +1 -0
- package/dist/core/common/helpers/redact-secrets.helper.d.ts +3 -0
- package/dist/core/common/helpers/redact-secrets.helper.js +72 -0
- package/dist/core/common/helpers/redact-secrets.helper.js.map +1 -0
- package/dist/core/common/helpers/swagger.helper.js +6 -0
- package/dist/core/common/helpers/swagger.helper.js.map +1 -1
- package/dist/core/common/interfaces/server-options.interface.d.ts +6 -0
- package/dist/core/common/services/config.service.d.ts +3 -0
- package/dist/core/common/services/config.service.js +17 -3
- package/dist/core/common/services/config.service.js.map +1 -1
- package/dist/core/modules/error-code/error-codes.d.ts +18 -0
- package/dist/core/modules/error-code/error-codes.js +16 -0
- package/dist/core/modules/error-code/error-codes.js.map +1 -1
- package/dist/core/modules/hub/core-hub.service.js +1 -13
- package/dist/core/modules/hub/core-hub.service.js.map +1 -1
- package/dist/core/modules/hub/helpers/hub-mask.helper.d.ts +1 -1
- package/dist/core/modules/hub/helpers/hub-mask.helper.js +1 -42
- package/dist/core/modules/hub/helpers/hub-mask.helper.js.map +1 -1
- package/dist/core/modules/system-setup/core-system-setup.controller.d.ts +2 -2
- package/dist/core/modules/system-setup/core-system-setup.controller.js +17 -7
- package/dist/core/modules/system-setup/core-system-setup.controller.js.map +1 -1
- package/dist/core/modules/system-setup/core-system-setup.service.d.ts +18 -0
- package/dist/core/modules/system-setup/core-system-setup.service.js +118 -15
- package/dist/core/modules/system-setup/core-system-setup.service.js.map +1 -1
- package/dist/core/modules/system-setup/system-setup-http-init.helper.d.ts +11 -0
- package/dist/core/modules/system-setup/system-setup-http-init.helper.js +45 -0
- package/dist/core/modules/system-setup/system-setup-http-init.helper.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/server/modules/error-code/error-codes.d.ts +2 -0
- package/dist/server/server.controller.d.ts +1 -1
- package/dist/server/server.controller.js +2 -2
- package/dist/server/server.controller.js.map +1 -1
- package/migration-guides/11.13.x-to-11.14.0.md +5 -5
- package/migration-guides/12.3.x-to-12.4.x.md +169 -0
- package/migration-guides/12.4.x-to-12.5.x.md +136 -0
- package/package.json +1 -1
- package/src/core/common/helpers/config-endpoint.helper.ts +56 -0
- package/src/core/common/helpers/redact-secrets.helper.ts +175 -0
- package/src/core/common/helpers/swagger.helper.ts +7 -0
- package/src/core/common/interfaces/server-options.interface.ts +79 -5
- package/src/core/common/services/config.service.ts +41 -3
- package/src/core/modules/error-code/error-codes.ts +27 -0
- package/src/core/modules/hub/README.md +3 -1
- package/src/core/modules/hub/core-hub.service.ts +4 -20
- package/src/core/modules/hub/helpers/hub-mask.helper.ts +4 -92
- package/src/core/modules/system-setup/INTEGRATION-CHECKLIST.md +51 -16
- package/src/core/modules/system-setup/README.md +144 -28
- package/src/core/modules/system-setup/core-system-setup.controller.ts +30 -8
- package/src/core/modules/system-setup/core-system-setup.service.ts +246 -23
- package/src/core/modules/system-setup/system-setup-http-init.helper.ts +130 -0
- package/src/index.ts +3 -0
- package/src/server/server.controller.ts +7 -2
package/dist/index.js
CHANGED
|
@@ -24,6 +24,7 @@ export * from './core/common/filters/http-exception-log.filter.js';
|
|
|
24
24
|
export * from './core/common/filters/mongoose-cast-error.filter.js';
|
|
25
25
|
export * from './core/common/helpers/common.helper.js';
|
|
26
26
|
export * from './core/common/helpers/config.helper.js';
|
|
27
|
+
export * from './core/common/helpers/config-endpoint.helper.js';
|
|
27
28
|
export * from './core/common/helpers/content-disposition.helper.js';
|
|
28
29
|
export * from './core/common/helpers/context.helper.js';
|
|
29
30
|
export * from './core/common/helpers/cookies.helper.js';
|
|
@@ -44,6 +45,7 @@ export * from './core/common/helpers/meta.helper.js';
|
|
|
44
45
|
export * from './core/common/helpers/model.helper.js';
|
|
45
46
|
export * from './core/common/helpers/outbound-url.helper.js';
|
|
46
47
|
export * from './core/common/helpers/process-diagnostics.helper.js';
|
|
48
|
+
export * from './core/common/helpers/redact-secrets.helper.js';
|
|
47
49
|
export * from './core/common/helpers/register-enum.helper.js';
|
|
48
50
|
export * from './core/common/helpers/scim.helper.js';
|
|
49
51
|
export * from './core/common/helpers/service.helper.js';
|
|
@@ -214,6 +216,7 @@ export * from './core/modules/permissions/permissions-scanner.js';
|
|
|
214
216
|
export * from './core/modules/system-setup/core-system-setup.controller.js';
|
|
215
217
|
export * from './core/modules/system-setup/core-system-setup.module.js';
|
|
216
218
|
export * from './core/modules/system-setup/core-system-setup.service.js';
|
|
219
|
+
export * from './core/modules/system-setup/system-setup-http-init.helper.js';
|
|
217
220
|
export * from './core/modules/sync/core-sync-base.controller.js';
|
|
218
221
|
export * from './core/modules/sync/core-sync.constants.js';
|
|
219
222
|
export * from './core/modules/sync/core-sync.controller.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,kBAAkB,CAAC;AAKjC,cAAc,mCAAmC,CAAC;AAClD,cAAc,uCAAuC,CAAC;AACtD,cAAc,mDAAmD,CAAC;AAClE,cAAc,oDAAoD,CAAC;AACnE,cAAc,oDAAoD,CAAC;AACnE,cAAc,wDAAwD,CAAC;AACvE,cAAc,+DAA+D,CAAC;AAC9E,cAAc,oDAAoD,CAAC;AACnE,cAAc,4DAA4D,CAAC;AAC3E,cAAc,iDAAiD,CAAC;AAChE,cAAc,sDAAsD,CAAC;AACrE,cAAc,kDAAkD,CAAC;AACjE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,oDAAoD,CAAC;AACnE,cAAc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|
|
72
72
|
SYSTEM_SETUP_DISABLED: string;
|
|
73
73
|
SYSTEM_SETUP_BETTERAUTH_REQUIRED: string;
|
|
74
|
+
SYSTEM_SETUP_HTTP_INIT_DISABLED: string;
|
|
75
|
+
SYSTEM_SETUP_TOKEN_INVALID: string;
|
|
74
76
|
AI_NO_CONNECTION: string;
|
|
75
77
|
AI_CONNECTION_DISABLED: string;
|
|
76
78
|
AI_CONNECTION_NOT_AVAILABLE: string;
|
|
@@ -8,7 +8,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
10
|
import { Controller, Get, Render } from '@nestjs/common';
|
|
11
|
-
import { ConfigService, RoleEnum, Roles } from '../index.js';
|
|
11
|
+
import { ConfigService, configEndpointResponse, RoleEnum, Roles } from '../index.js';
|
|
12
12
|
let ServerController = class ServerController {
|
|
13
13
|
configService;
|
|
14
14
|
constructor(configService) {
|
|
@@ -20,7 +20,7 @@ let ServerController = class ServerController {
|
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
config() {
|
|
23
|
-
return
|
|
23
|
+
return configEndpointResponse();
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.controller.js","sourceRoot":"","sources":["../../src/server/server.controller.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAEzD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"server.controller.js","sourceRoot":"","sources":["../../src/server/server.controller.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAEzD,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAI9E,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IACL;IAAtB,YAAsB,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;IAAG,CAAC;IAKtD,IAAI;QACF,OAAO;YACL,GAAG,EAAE,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAAC,KAAK,CAAC;SAClD,CAAC;IACJ,CAAC;IASD,MAAM;QACJ,OAAO,sBAAsB,EAAE,CAAC;IAClC,CAAC;CACF,CAAA;AAhBC;IAHC,GAAG,EAAE;IACL,MAAM,CAAC,OAAO,CAAC;IACf,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC;;;;4CAK1B;AASD;IAFC,GAAG,CAAC,QAAQ,CAAC;IACb,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC;;;;8CAGrB;AArBU,gBAAgB;IAF5B,UAAU,EAAE;IACZ,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC;qCAEiB,aAAa;GADvC,gBAAgB,CAsB5B"}
|
|
@@ -49,9 +49,9 @@ New module for creating the first admin user on fresh deployments, especially us
|
|
|
49
49
|
|
|
50
50
|
```bash
|
|
51
51
|
# .env or Docker environment
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
NSC__SYSTEM_SETUP__INITIAL_ADMIN__EMAIL=admin@example.com
|
|
53
|
+
NSC__SYSTEM_SETUP__INITIAL_ADMIN__PASSWORD=YourSecurePassword123!
|
|
54
|
+
NSC__SYSTEM_SETUP__INITIAL_ADMIN__NAME=Admin # optional
|
|
55
55
|
```
|
|
56
56
|
|
|
57
57
|
Or in `config.env.ts`:
|
|
@@ -190,8 +190,8 @@ betterAuth: {
|
|
|
190
190
|
|
|
191
191
|
```bash
|
|
192
192
|
# .env
|
|
193
|
-
|
|
194
|
-
|
|
193
|
+
NSC__SYSTEM_SETUP__INITIAL_ADMIN__EMAIL=admin@example.com
|
|
194
|
+
NSC__SYSTEM_SETUP__INITIAL_ADMIN__PASSWORD=YourSecurePassword123!
|
|
195
195
|
```
|
|
196
196
|
|
|
197
197
|
### Step 4: Build and Test
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
# Migration Guide: 12.3.x → 12.4.x
|
|
2
|
+
|
|
3
|
+
## 12.4.0 contains breaking changes
|
|
4
|
+
|
|
5
|
+
The version number moves only the MINOR digit (the MAJOR follows NestJS). Read §1 before you update: a deployed
|
|
6
|
+
instance that creates its first administrator through `POST /system-setup/init` (a setup page in the frontend) is
|
|
7
|
+
refused from now on until it is configured.
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
| Category | Details |
|
|
12
|
+
|---|---|
|
|
13
|
+
| **Breaking Changes** | `POST /system-setup/init` is closed outside `local`, `ci` and `e2e` unless `systemSetup.httpInit` opens it (§1) |
|
|
14
|
+
| **New Features** | `systemSetup.httpInit` (`true` or `{ token }`), the `X-System-Setup-Token` header, `httpInitEnabled` / `httpInitTokenRequired` in `GET /system-setup/status`, error codes `LTNS_0053` / `LTNS_0054`, a boot report for a deployment that cannot be set up (§1) |
|
|
15
|
+
| **Bugfixes** | A deployed instance without `initialAdmin` could be taken over through the anonymous init (§1). A creation that failed after the user was written left a user without the admin role behind and locked the setup for good (§2). The documented ENV names for `initialAdmin` were never read (§3) |
|
|
16
|
+
| **Migration Effort** | None for a deployment that provisions its first admin through `initialAdmin`, and none locally. A deployed stage set up through the UI: one ENV variable (§1). A project using the camelCase ENV names: rename them (§3) |
|
|
17
|
+
|
|
18
|
+
## Quick Migration
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pnpm add @lenne.tech/nest-server@12.4.0
|
|
22
|
+
pnpm run update # nest-server-starter based projects: aligns the pins the framework raised
|
|
23
|
+
pnpm run build
|
|
24
|
+
pnpm test
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**Vendor mode**: run `/lt-dev:backend:update-nest-server-core` as usual.
|
|
28
|
+
|
|
29
|
+
Local development and the e2e suites of a starter-based project keep working without a change: `local`, `ci` and
|
|
30
|
+
`e2e` keep the init open.
|
|
31
|
+
|
|
32
|
+
## 1. The HTTP init is fail-closed outside the local environments
|
|
33
|
+
|
|
34
|
+
`POST /system-setup/init` is anonymous (`S_EVERYONE`). Until 12.4.0 its only guard was "no user exists yet", in every
|
|
35
|
+
environment, so every deployed instance that went live without `systemSetup.initialAdmin` could be taken over by
|
|
36
|
+
whoever called the route before the first person signed up — an administrator account for anybody who found the API.
|
|
37
|
+
|
|
38
|
+
**What changes:** outside `local`, `ci` and `e2e` the init answers **403 `LTNS_0053`** unless `systemSetup.httpInit`
|
|
39
|
+
opens it. The environment is the configured `env` (else `NODE_ENV`); the deployed `develop` and `test` stages of a
|
|
40
|
+
starter-based project, `production`, `staging` and any unknown or missing name count as deployed.
|
|
41
|
+
|
|
42
|
+
| `systemSetup.httpInit` | `local` / `ci` / `e2e` | every other environment |
|
|
43
|
+
|---|---|---|
|
|
44
|
+
| not set | open | **closed** — 403 `LTNS_0053` |
|
|
45
|
+
| `true` | open | open, without a token |
|
|
46
|
+
| `{ token: '<at least 16 characters>' }` | open, token required | open, token required — 403 `LTNS_0054` without it |
|
|
47
|
+
| `false` / `{ enabled: false }` | closed | closed |
|
|
48
|
+
|
|
49
|
+
`systemSetup.initialAdmin` is not affected: the configured admin is still created at boot in every environment.
|
|
50
|
+
|
|
51
|
+
**What to do on a deployed stage**, preferred first:
|
|
52
|
+
|
|
53
|
+
1. **Provision the admin via ENV** — created on the next start, no setup page needed:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
NSC__SYSTEM_SETUP__INITIAL_ADMIN__EMAIL=admin@example.com
|
|
57
|
+
NSC__SYSTEM_SETUP__INITIAL_ADMIN__PASSWORD=<strong password>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
2. **Open the init with a token** when the setup must happen through the UI:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
NSC__SYSTEM_SETUP__HTTP_INIT__TOKEN=<secret of at least 16 characters, with letters>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
The frontend sends it in the `X-System-Setup-Token` header. Remove the variable once the admin exists.
|
|
67
|
+
|
|
68
|
+
3. **Open the init without a token** (`NSC__SYSTEM_SETUP__HTTP_INIT=true`) only where nobody else can reach the API
|
|
69
|
+
before you do: whoever calls it first becomes the administrator. The boot warns about it while no user exists.
|
|
70
|
+
|
|
71
|
+
**A misconfiguration closes, it never opens.** `httpInit: { token: process.env.SETUP_TOKEN }` with the variable unset,
|
|
72
|
+
an empty or short token, or an empty / all-digit `NSC__SYSTEM_SETUP__HTTP_INIT__TOKEN` (the environment reader turns
|
|
73
|
+
it into a number) keep the init closed and log an error at boot naming the problem. A string `"true"` from
|
|
74
|
+
`NEST_SERVER_CONFIG` counts as not set.
|
|
75
|
+
|
|
76
|
+
**Frontend:** `GET /system-setup/status` additionally returns `httpInitEnabled` and `httpInitTokenRequired`, always,
|
|
77
|
+
whatever `needsSetup` says. Show the setup form only when `needsSetup && httpInitEnabled`, with a token field when
|
|
78
|
+
`httpInitTokenRequired`. A backend older than 12.4.0 sends neither field; treat that as "available" (as before).
|
|
79
|
+
`@lenne.tech/nuxt-extensions` handles this from its next release on.
|
|
80
|
+
|
|
81
|
+
```typescript
|
|
82
|
+
const { needsSetup, httpInitEnabled = true, httpInitTokenRequired = false } = await status.json();
|
|
83
|
+
if (needsSetup && httpInitEnabled) {
|
|
84
|
+
await fetch('/system-setup/init', {
|
|
85
|
+
body: JSON.stringify({ email, name, password }),
|
|
86
|
+
headers: {
|
|
87
|
+
'Content-Type': 'application/json',
|
|
88
|
+
...(httpInitTokenRequired ? { 'X-System-Setup-Token': setupToken } : {}),
|
|
89
|
+
},
|
|
90
|
+
method: 'POST',
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**Boot report.** A deployed instance that starts with zero users, no usable `initialAdmin` and a closed init now logs
|
|
96
|
+
an error that names both ways in — before, it stayed silent until somebody tried to sign in.
|
|
97
|
+
|
|
98
|
+
**Swagger:** while the init is closed, `POST /system-setup/init` is left out of the document `setupSwagger()` builds.
|
|
99
|
+
|
|
100
|
+
**A project controller** that extends `CoreSystemSetupController` and overrides `createInitialAdmin()` must call
|
|
101
|
+
`this.systemSetupService.assertHttpInitAllowed(token)` first (the token read with
|
|
102
|
+
`@Headers(SYSTEM_SETUP_TOKEN_HEADER)`); otherwise the override keeps the init open in every environment. A project's
|
|
103
|
+
own endpoint that calls `CoreSystemSetupService.createInitialAdmin()` directly does the same.
|
|
104
|
+
|
|
105
|
+
## 2. A failed creation no longer leaves a user behind
|
|
106
|
+
|
|
107
|
+
When a step after creating the user failed (linking the credential account, the user sync, the role update, the legacy
|
|
108
|
+
password), only the setup claim was released. The user stayed — without the admin role — so `needsSetup` turned
|
|
109
|
+
`false` and the init was refused for good: a deployment with a user and no administrator, recoverable only by editing
|
|
110
|
+
the database.
|
|
111
|
+
|
|
112
|
+
**What changes:** the partially created user is removed again (`internalAdapter.deleteUser()`: sessions, accounts and
|
|
113
|
+
the `users` row), `needsSetup` stays `true`, and the setup can be retried. The caller still gets 403 `LTNS_0050`, and
|
|
114
|
+
the server log names the original failure. If the removal itself fails, the log says which user to delete by hand.
|
|
115
|
+
|
|
116
|
+
**What to check on an instance that hit this before 12.4.0:** a `users` row without the admin role and no
|
|
117
|
+
administrator anywhere. Delete that row and its `account` rows, then provision the admin as in §1.
|
|
118
|
+
|
|
119
|
+
## 3. The ENV names for `initialAdmin`
|
|
120
|
+
|
|
121
|
+
The README, the integration checklist, the interface documentation and the 11.14.0 migration guide named the
|
|
122
|
+
variables `NSC__systemSetup__initialAdmin__email` / `__password` / `__name`. The environment reader lowercases every
|
|
123
|
+
segment it does not split at `_`, so those land under `systemsetup.initialadmin` — a key nothing reads — and no admin
|
|
124
|
+
was ever created from them.
|
|
125
|
+
|
|
126
|
+
**The names that work:**
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
NSC__SYSTEM_SETUP__INITIAL_ADMIN__EMAIL=admin@example.com
|
|
130
|
+
NSC__SYSTEM_SETUP__INITIAL_ADMIN__PASSWORD=<strong password>
|
|
131
|
+
NSC__SYSTEM_SETUP__INITIAL_ADMIN__NAME=Admin # optional
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Since 12.4.0 the boot warns about a `NSC__systemSetup__…` variable and names its correct spelling (names only, never
|
|
135
|
+
values). The environment reader itself is unchanged: it applies to every setting of every project.
|
|
136
|
+
|
|
137
|
+
## Compatibility Notes
|
|
138
|
+
|
|
139
|
+
| Pattern | Status |
|
|
140
|
+
|---|---|
|
|
141
|
+
| `systemSetup.initialAdmin` via config or (SCREAMING_SNAKE) ENV | Unchanged |
|
|
142
|
+
| Setup page used locally / in e2e suites (`local`, `ci`, `e2e`) | Unchanged |
|
|
143
|
+
| Setup page used on a deployed stage without configuration | **403 `LTNS_0053`** — see §1 |
|
|
144
|
+
| `systemSetup: { enabled: false }` | Unchanged (no endpoints at all) |
|
|
145
|
+
| `CoreSystemSetupService.createInitialAdmin()` called by project code | Not gated — call `assertHttpInitAllowed()` first on an HTTP path |
|
|
146
|
+
| A frontend reading `GET /system-setup/status` | Two additional fields; existing fields unchanged |
|
|
147
|
+
|
|
148
|
+
## Troubleshooting
|
|
149
|
+
|
|
150
|
+
| Symptom | Cause | Fix |
|
|
151
|
+
|---|---|---|
|
|
152
|
+
| 403 `LTNS_0053` on a deployed stage | The init is closed there by default | `initialAdmin` via ENV, or `NSC__SYSTEM_SETUP__HTTP_INIT__TOKEN` (§1) |
|
|
153
|
+
| 403 `LTNS_0054` | Token missing or different | Send the configured value in `X-System-Setup-Token` |
|
|
154
|
+
| Boot error "POST /system-setup/init stays closed" | The token configuration is unusable (missing, empty, short, a number) | Set a token of at least 16 characters with letters |
|
|
155
|
+
| Boot error "No users exist and this instance cannot be set up" | Deployed, no users, no usable `initialAdmin`, init closed | One of the ways in §1 |
|
|
156
|
+
| Boot warning "Environment variable NSC__systemSetup__… is not read" | camelCase ENV names | Rename as in §3 |
|
|
157
|
+
|
|
158
|
+
## Module Documentation
|
|
159
|
+
|
|
160
|
+
### System Setup
|
|
161
|
+
|
|
162
|
+
- [README](../src/core/modules/system-setup/README.md) — "HTTP init (`systemSetup.httpInit`)"
|
|
163
|
+
- [Integration Checklist](../src/core/modules/system-setup/INTEGRATION-CHECKLIST.md) — Steps 1 and 1b
|
|
164
|
+
|
|
165
|
+
## References
|
|
166
|
+
|
|
167
|
+
- `src/core/modules/system-setup/system-setup-http-init.helper.ts` — `resolveSystemSetupHttpInit()`, `isSystemSetupTokenValid()`
|
|
168
|
+
- `src/core/modules/system-setup/core-system-setup.service.ts` — `assertHttpInitAllowed()`, `reportSetupReachability()`, `rollbackInitialAdmin()`
|
|
169
|
+
- `.claude/rules/configurable-features.md` — "System Setup" row
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# Migration Guide: 12.4.x → 12.5.x
|
|
2
|
+
|
|
3
|
+
## 12.5.0 contains breaking changes
|
|
4
|
+
|
|
5
|
+
The version number moves only the MINOR digit (the MAJOR follows NestJS). Read §1 before you update: a project's
|
|
6
|
+
`GET /config` answers 404 in deployed environments from now on — once the project's controller uses the core's
|
|
7
|
+
`configEndpointResponse()`, which this guide asks for.
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
| Category | Details |
|
|
12
|
+
|---|---|
|
|
13
|
+
| **Breaking Changes** | `GET /config` via `configEndpointResponse()` answers only in `local`, `ci` and `e2e` unless `configEndpoint` opens it, and always redacted (§1) |
|
|
14
|
+
| **New Features** | `redactSecrets()`, `ConfigService.getRedactedConfig()`, `configEndpointResponse()`, `isConfigEndpointEnabled()`, the `configEndpoint` setting (§1) |
|
|
15
|
+
| **Bugfixes** | `GET /config` of a project created before the starter redacted returned every secret of the deployment to administrators (§1). The `ConfigService` debug output (`warn: true`) printed the configuration unredacted (§2). `ConfigService#mergeProperty(key, value)` merged nothing (§3) |
|
|
16
|
+
| **Migration Effort** | One line in the project's `ServerController` (§1). Nothing else |
|
|
17
|
+
|
|
18
|
+
## Quick Migration
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pnpm add @lenne.tech/nest-server@12.5.0
|
|
22
|
+
pnpm run update # nest-server-starter based projects: aligns the pins the framework raised
|
|
23
|
+
pnpm run build
|
|
24
|
+
pnpm test
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**Vendor mode**: run `/lt-dev:backend:update-nest-server-core` as usual, then apply §1 to `src/server/server.controller.ts`.
|
|
28
|
+
|
|
29
|
+
## 1. `GET /config`: redacted by the core, closed in deployed environments
|
|
30
|
+
|
|
31
|
+
The route lives in project code — the starter's `ServerController`. Until the starter redacted it (October 2026) it
|
|
32
|
+
returned `configFastButReadOnly` as it is: the database URI with its password, the JWT and Better-Auth secrets, the
|
|
33
|
+
mail password, API keys. Every project created before that still does, and an administrator account — or a stolen
|
|
34
|
+
administrator session — was enough to read them.
|
|
35
|
+
|
|
36
|
+
**What the core now provides:**
|
|
37
|
+
|
|
38
|
+
- `redactSecrets(value, extraSecretKeys?)` — the framework's one masker (moved from the Hub, where it stays available
|
|
39
|
+
as `maskConfigDeep`). It masks by key name — `secret`, `password`, `token` and `credential` anywhere in the name,
|
|
40
|
+
names ending in `pass` or `key` (`smtpPass`, `signingKey`), `encryption`, `dsn`, `salt`, … — masks the password of a
|
|
41
|
+
connection URI and every secret-named query parameter of a URI, keeps only scheme, host and port of an address under
|
|
42
|
+
a key ending in `url`, `uri`, `endpoint` or `webhook` (a webhook carries its secret in the path), works through nested
|
|
43
|
+
values, and masks EVERYTHING below a secret-named key except booleans.
|
|
44
|
+
- `ConfigService.getRedactedConfig()` — the running configuration through `redactSecrets()`, with the framework's
|
|
45
|
+
secret fields and your `security.secretFields`. The Hub config panel shows the same view.
|
|
46
|
+
- `configEndpointResponse()` — the body of `GET /config`: the redacted configuration, or a 404 where the endpoint is
|
|
47
|
+
closed.
|
|
48
|
+
- `configEndpoint` — whether it answers:
|
|
49
|
+
|
|
50
|
+
| `configEndpoint` | `local` / `ci` / `e2e` | every other environment (`develop`, `test`, `production`, …) |
|
|
51
|
+
|---|---|---|
|
|
52
|
+
| not set | answers | **404** |
|
|
53
|
+
| `true` | answers | answers |
|
|
54
|
+
| `false` | 404 | 404 |
|
|
55
|
+
|
|
56
|
+
A value that is not a boolean counts as not set. Environment variable: `NSC__CONFIG_ENDPOINT=true`.
|
|
57
|
+
|
|
58
|
+
**What to do** — in `src/server/server.controller.ts`, replace the body of the `config()` handler:
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
// Before (verbatim configuration, or the starter's own redact-secrets.util.ts)
|
|
62
|
+
@Get('config')
|
|
63
|
+
@Roles(RoleEnum.ADMIN)
|
|
64
|
+
config() {
|
|
65
|
+
return JSON.parse(JSON.stringify(this.configService.configFastButReadOnly));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// After
|
|
69
|
+
import { configEndpointResponse } from '@lenne.tech/nest-server';
|
|
70
|
+
|
|
71
|
+
@Get('config')
|
|
72
|
+
@Roles(RoleEnum.ADMIN)
|
|
73
|
+
config() {
|
|
74
|
+
return configEndpointResponse();
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
A starter-based project that already redacts with `src/server/common/utils/redact-secrets.util.ts` can delete that
|
|
79
|
+
file: the core's key pattern is a superset of that util's, and the core also masks what the util let through (values
|
|
80
|
+
nested below a secret-named key, a password passed as a URI query parameter). One difference you will see: the util
|
|
81
|
+
blanked a whole URL, the core keeps its scheme, host and port.
|
|
82
|
+
|
|
83
|
+
**Who calls `/config`?** No frontend or script of the lenne.Tech stack does; it is an administrator's debugging aid.
|
|
84
|
+
**If your project's own admin UI or tooling reads `/config` on a deployed stage, switch it back on there explicitly:**
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
NSC__CONFIG_ENDPOINT=true # or configEndpoint: true in config.env.ts for that environment
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
The endpoint then answers in that environment again, and the answer stays redacted: secret values read `***`, every
|
|
91
|
+
other setting is unchanged. An admin UI that displayed secrets from `/config` gets `***` for them from now on — that is
|
|
92
|
+
the point of this change.
|
|
93
|
+
|
|
94
|
+
**The status codes:** without a session the route's `@Roles(ADMIN)` still answers 401; an administrator gets 404
|
|
95
|
+
where the endpoint is closed, so it reads like a route that does not exist.
|
|
96
|
+
|
|
97
|
+
## 2. The `ConfigService` debug output is redacted
|
|
98
|
+
|
|
99
|
+
`new ConfigService(config, { warn: true })`, `mergeConfig(…, { warn: true })` and `setConfig(…, { warn: true })` print
|
|
100
|
+
the merged configuration — an opt-in debugging aid since 12.0.0. That output now goes through the same redaction, so
|
|
101
|
+
a debug session no longer writes the deployment's secrets to a log.
|
|
102
|
+
|
|
103
|
+
## 3. `ConfigService#mergeProperty(key, value)` merges the value
|
|
104
|
+
|
|
105
|
+
The instance method forwarded its `options` in place of `value` to the static one, so it merged `undefined`. It now
|
|
106
|
+
merges the value as its signature says. `ConfigService.mergeProperty()` (static) was not affected.
|
|
107
|
+
|
|
108
|
+
## Compatibility Notes
|
|
109
|
+
|
|
110
|
+
| Pattern | Status |
|
|
111
|
+
|---|---|
|
|
112
|
+
| A `ServerController` returning `configFastButReadOnly` | Still unredacted until you apply §1 — the core cannot reach a route in project code |
|
|
113
|
+
| `configEndpointResponse()` in `local` / `ci` / `e2e` | Answers as before, redacted |
|
|
114
|
+
| E2E suites reading `/config` (`NODE_ENV=e2e`) | Unchanged, apart from masked secret values |
|
|
115
|
+
| `maskConfigDeep` (Hub) | Still exported, now the same function as `redactSecrets` — values below a secret-named key keep their structure (masked) and booleans stay visible |
|
|
116
|
+
| Health check, `/meta`, error responses | Unchanged — they carry no configuration |
|
|
117
|
+
|
|
118
|
+
## Troubleshooting
|
|
119
|
+
|
|
120
|
+
| Symptom | Cause | Fix |
|
|
121
|
+
|---|---|---|
|
|
122
|
+
| `GET /config` answers 404 for an administrator | Deployed environment without `configEndpoint` | `NSC__CONFIG_ENDPOINT=true` on that stage, if you need it |
|
|
123
|
+
| A value you need reads `***` | Its key matches a secret pattern | Read it from the environment of the deployment; `/config` never shows secrets |
|
|
124
|
+
| A secret under an unusual key appears in plain text | No pattern matches it | Add the key to `security.secretFields` |
|
|
125
|
+
|
|
126
|
+
## Module Documentation
|
|
127
|
+
|
|
128
|
+
- [Hub README](../src/core/modules/hub/README.md) — the config panel uses the same redaction
|
|
129
|
+
- `.claude/rules/configurable-features.md` — "Config Endpoint" row
|
|
130
|
+
|
|
131
|
+
## References
|
|
132
|
+
|
|
133
|
+
- `src/core/common/helpers/redact-secrets.helper.ts` — `redactSecrets()`, `FRAMEWORK_SECRET_FIELDS`
|
|
134
|
+
- `src/core/common/helpers/config-endpoint.helper.ts` — `isConfigEndpointEnabled()`, `configEndpointResponse()`
|
|
135
|
+
- `src/core/common/services/config.service.ts` — `getRedactedConfig()`
|
|
136
|
+
- `src/server/server.controller.ts` — the reference controller
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lenne.tech/nest-server",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.5.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Server framework in TypeScript on top of NestJS: GraphQL and REST APIs on MongoDB, PostgreSQL, MySQL or MariaDB, with authentication, field-level permissions, multi-tenancy, offline sync and an AI assistant.",
|
|
6
6
|
"keywords": [
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { NotFoundException } from '@nestjs/common';
|
|
2
|
+
|
|
3
|
+
import type { IServerOptions } from '../interfaces/server-options.interface.js';
|
|
4
|
+
import { ConfigService } from '../services/config.service.js';
|
|
5
|
+
import { isLocalEnv } from './cookies.helper.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Whether a project's `GET /config` may answer (`configEndpoint`, 12.5.0+).
|
|
9
|
+
*
|
|
10
|
+
* | `configEndpoint` | `local` / `ci` / `e2e` | every other environment (`develop`, `test`, `production`, …) |
|
|
11
|
+
* |------------------|------------------------|---------------------------------------------------------------|
|
|
12
|
+
* | not set | answers | **404** |
|
|
13
|
+
* | `true` | answers | answers |
|
|
14
|
+
* | `false` | 404 | 404 |
|
|
15
|
+
*
|
|
16
|
+
* Answering always means the REDACTED configuration ({@link configEndpointResponse}). A value that is not a boolean
|
|
17
|
+
* (the string `'true'` from `NEST_SERVER_CONFIG`) counts as not set, so a string cannot open the endpoint by
|
|
18
|
+
* truthiness. The environment is the configured `env`, else `NODE_ENV`, compared with {@link isLocalEnv}.
|
|
19
|
+
*
|
|
20
|
+
* @param config - defaults to the running configuration
|
|
21
|
+
* @since 12.5.0
|
|
22
|
+
*/
|
|
23
|
+
export function isConfigEndpointEnabled(
|
|
24
|
+
config: Partial<IServerOptions> | undefined = ConfigService.configFastButReadOnly,
|
|
25
|
+
): boolean {
|
|
26
|
+
const setting = config?.configEndpoint;
|
|
27
|
+
if (setting === true || setting === false) {
|
|
28
|
+
return setting;
|
|
29
|
+
}
|
|
30
|
+
return isLocalEnv(config?.env ?? process.env.NODE_ENV);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The body of a project's `GET /config`: the redacted configuration, or a 404 where `configEndpoint` keeps the
|
|
35
|
+
* endpoint closed ({@link isConfigEndpointEnabled}).
|
|
36
|
+
*
|
|
37
|
+
* 404 rather than 403, so a closed endpoint reads like one that does not exist. The route's own `@Roles(ADMIN)`
|
|
38
|
+
* still runs first, so an anonymous caller keeps getting 401.
|
|
39
|
+
*
|
|
40
|
+
* ```typescript
|
|
41
|
+
* @Get('config')
|
|
42
|
+
* @Roles(RoleEnum.ADMIN)
|
|
43
|
+
* config() {
|
|
44
|
+
* return configEndpointResponse();
|
|
45
|
+
* }
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* @throws NotFoundException when the endpoint is closed in this environment
|
|
49
|
+
* @since 12.5.0
|
|
50
|
+
*/
|
|
51
|
+
export function configEndpointResponse(): Record<string, unknown> {
|
|
52
|
+
if (!isConfigEndpointEnabled(ConfigService.configFastButReadOnly)) {
|
|
53
|
+
throw new NotFoundException();
|
|
54
|
+
}
|
|
55
|
+
return ConfigService.getRedactedConfig();
|
|
56
|
+
}
|