@hivemagnus/magnus 2.10.1 → 3.0.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/dist/init.js +1 -1
- package/dist/templates.d.ts +10 -0
- package/dist/templates.js +12 -1
- package/package.json +11 -11
package/dist/init.js
CHANGED
|
@@ -119,7 +119,7 @@ export async function init(io, options) {
|
|
|
119
119
|
writeFileSync(project.envFile('server'), serverEnv({
|
|
120
120
|
databaseUrl: databaseUrl, redisUrl: redisUrl, port: options.serverPort, publicUrl: `https://${host}:${options.serverPort}`,
|
|
121
121
|
uiOrigin, tlsCert: tls.cert, tlsKey: tls.key, home: project.path('data'), backupDir: project.path('backups'), autoMigrate: options.autoMigrate,
|
|
122
|
-
projectDir: project.dir, runtimeFile: project.path('run', 'server-runtime.json'),
|
|
122
|
+
projectDir: project.dir, runtimeFile: project.path('run', 'server-runtime.json'), version,
|
|
123
123
|
...(tls.selfSigned ? { extraCaFile: tls.cert } : {}),
|
|
124
124
|
}, {}), { mode: 0o600 });
|
|
125
125
|
const password = options.adminPassword ?? randomBytes(12).toString('base64url');
|
package/dist/templates.d.ts
CHANGED
|
@@ -8,6 +8,14 @@ import type { Project } from './project.js';
|
|
|
8
8
|
*/
|
|
9
9
|
export declare const ALLOW_SCRIPTS: Readonly<Record<string, true>>;
|
|
10
10
|
export declare const SERVER_SECRET_NAMES: readonly ["API_SECRET", "JWT_SECRET", "NODE_MANAGER_SECRET", "AUDIT_HMAC_SECRET", "RESULT_SIGNING_SECRET", "LOG_INGEST_SIGNING_SECRET", "CREDENTIAL_ROTATION_KEY", "METRICS_TOKEN", "WEBHOOK_ENCRYPTION_KEY"];
|
|
11
|
+
/**
|
|
12
|
+
* The shared node credentials. From 3.0.0 the server runs in NODE_AUTH_MODE=enforce by default and
|
|
13
|
+
* needs neither (agents enroll with their own keys), so a new project of 3.0.0 or later does not get
|
|
14
|
+
* them; an older release still requires them. Add both by hand only to run an explicit compat mode.
|
|
15
|
+
*/
|
|
16
|
+
export declare const SHARED_NODE_SECRET_NAMES: readonly string[];
|
|
17
|
+
/** The secrets a new project of `version` gets. */
|
|
18
|
+
export declare function serverSecretNames(version: string | undefined): readonly string[];
|
|
11
19
|
export interface ServiceUnitOptions {
|
|
12
20
|
project: Project;
|
|
13
21
|
nodePath: string;
|
|
@@ -61,6 +69,8 @@ export interface ServerEnvSettings {
|
|
|
61
69
|
autoMigrate: boolean;
|
|
62
70
|
projectDir: string;
|
|
63
71
|
runtimeFile: string;
|
|
72
|
+
/** The release the project starts on: from 3.0.0 the shared node credentials are left out. */
|
|
73
|
+
version?: string;
|
|
64
74
|
}
|
|
65
75
|
export declare function serverEnv(settings: ServerEnvSettings, secrets: Record<string, string>): string;
|
|
66
76
|
/**
|
package/dist/templates.js
CHANGED
|
@@ -26,6 +26,17 @@ export const SERVER_SECRET_NAMES = [
|
|
|
26
26
|
'METRICS_TOKEN',
|
|
27
27
|
'WEBHOOK_ENCRYPTION_KEY',
|
|
28
28
|
];
|
|
29
|
+
/**
|
|
30
|
+
* The shared node credentials. From 3.0.0 the server runs in NODE_AUTH_MODE=enforce by default and
|
|
31
|
+
* needs neither (agents enroll with their own keys), so a new project of 3.0.0 or later does not get
|
|
32
|
+
* them; an older release still requires them. Add both by hand only to run an explicit compat mode.
|
|
33
|
+
*/
|
|
34
|
+
export const SHARED_NODE_SECRET_NAMES = ['NODE_MANAGER_SECRET', 'RESULT_SIGNING_SECRET'];
|
|
35
|
+
/** The secrets a new project of `version` gets. */
|
|
36
|
+
export function serverSecretNames(version) {
|
|
37
|
+
const major = Number(/^(\d+)\./.exec(version ?? '')?.[1] ?? 'NaN');
|
|
38
|
+
return Number.isFinite(major) && major >= 3 ? SERVER_SECRET_NAMES.filter((name) => !SHARED_NODE_SECRET_NAMES.includes(name)) : SERVER_SECRET_NAMES;
|
|
39
|
+
}
|
|
29
40
|
export const UNIT_MARKER = '# Generated by `magnus init`';
|
|
30
41
|
/** At most three failed starts in five minutes: a crash loop stops instead of filling the disk with dumps. */
|
|
31
42
|
export const START_LIMIT = ['StartLimitIntervalSec=300', 'StartLimitBurst=3'];
|
|
@@ -192,7 +203,7 @@ export function serverEnv(settings, secrets) {
|
|
|
192
203
|
{ name: 'TLS_KEY_PATH', value: settings.tlsKey },
|
|
193
204
|
...(settings.extraCaFile ? [{ name: 'NODE_EXTRA_CA_CERTS', value: settings.extraCaFile, comment: 'Agent certificates the server trusts (this host\'s self-signed one; append your CA).' }] : []),
|
|
194
205
|
] },
|
|
195
|
-
{ title: 'Secrets (generated; each one distinct)', entries: entries(
|
|
206
|
+
{ title: 'Secrets (generated; each one distinct)', entries: entries(serverSecretNames(settings.version)) },
|
|
196
207
|
{ title: 'Upgrades (set any of these to false to run your own release process)', entries: [
|
|
197
208
|
{ name: 'MAGNUS_AUTO_MIGRATE', value: String(settings.autoMigrate), comment: 'Back up and apply pending migrations at startup.' },
|
|
198
209
|
{ name: 'MAGNUS_AUTO_MIGRATE_BACKUP', value: 'true' },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hivemagnus/magnus",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Install, upgrade and roll back a Magnus server and console with one command: `npx @hivemagnus/magnus init`, then `magnus upgrade`. Pins exact, tested component versions, backs up PostgreSQL before every migration and reverts automatically when the new version fails its health check.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"magnus",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"clean": "node -e \"const fs=require('node:fs');fs.rmSync('dist',{recursive:true,force:true});fs.rmSync('tsconfig.tsbuildinfo',{force:true})\""
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@hivemagnus/magnus-contracts": "
|
|
50
|
+
"@hivemagnus/magnus-contracts": "3.0.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@types/node": "^24.19.2",
|
|
@@ -56,18 +56,18 @@
|
|
|
56
56
|
},
|
|
57
57
|
"magnusRelease": {
|
|
58
58
|
"schema": 1,
|
|
59
|
-
"version": "
|
|
59
|
+
"version": "3.0.0",
|
|
60
60
|
"engines": {
|
|
61
61
|
"node": "^24.22.3 || ^26.13.1"
|
|
62
62
|
},
|
|
63
63
|
"components": {
|
|
64
|
-
"@hivemagnus/magnus-server": "
|
|
65
|
-
"@hivemagnus/magnus-ui": "
|
|
66
|
-
"@hivemagnus/magnus-contracts": "
|
|
67
|
-
"@hivemagnus/magnus-agent": "
|
|
64
|
+
"@hivemagnus/magnus-server": "3.0.0",
|
|
65
|
+
"@hivemagnus/magnus-ui": "3.0.0",
|
|
66
|
+
"@hivemagnus/magnus-contracts": "3.0.0",
|
|
67
|
+
"@hivemagnus/magnus-agent": "3.0.0"
|
|
68
68
|
},
|
|
69
|
-
"breaking":
|
|
70
|
-
"minUpgradeFrom": "
|
|
69
|
+
"breaking": true,
|
|
70
|
+
"minUpgradeFrom": "2.10.2",
|
|
71
71
|
"engineProtocol": 2,
|
|
72
72
|
"newRequiredEnv": [],
|
|
73
73
|
"newOptionalEnv": [],
|
|
@@ -77,8 +77,8 @@
|
|
|
77
77
|
"selfUpgradeProtocol": 1,
|
|
78
78
|
"minLauncher": 1
|
|
79
79
|
},
|
|
80
|
-
"summary": "
|
|
81
|
-
"notesUrl": "https://github.com/ChefTaco/magnus/releases/tag/
|
|
80
|
+
"summary": "Per-node credentials, phase 3: NODE_AUTH_MODE defaults to enforce on the server and the agent. The shared node secret is refused and no longer sent in either direction, HMAC-only evidence and decisions are refused, the automatic legacy upgrade is closed and NODE_AUTO_REGISTER is off. A server with the mode unset refuses to start while any real node lacks an active key or its agent does not sign evidence (or is 2.10.0/2.10.1), naming them; an explicit compat or warn keeps working for this major and is deprecated. NODE_MANAGER_SECRET and RESULT_SIGNING_SECRET are no longer required outside compat and warn. Adds server-key rotation (stage, promote, retire) and a two-ADMIN approval for scheduler-source settlements in place of the reviewer HMAC. No migrations. Upgrade from 2.10.2 only: optionally run 2.10.2 in warn for a day, confirm GET /api/v1/node-credentials/summary reports no blockers, remove NODE_AUTH_MODE and upgrade the server with --allow-major; 2.10.2 agents keep working, and moving an agent to 3.0.0 crosses a major, so it is done by hand on the node. Roll back by setting NODE_AUTH_MODE=compat. See docs/NODE_CREDENTIALS.md.",
|
|
81
|
+
"notesUrl": "https://github.com/ChefTaco/magnus/releases/tag/v3.0.0",
|
|
82
82
|
"allowScripts": {
|
|
83
83
|
"@prisma/engines": true,
|
|
84
84
|
"argon2": true,
|