@forgezero/agent 0.1.33 → 0.1.35
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 +21 -0
- package/dist/agent-heartbeat.js +1 -1
- package/dist/bootstrap.d.ts +128 -0
- package/dist/bootstrap.js +3361 -0
- package/dist/capacity-calibration.d.ts +51 -0
- package/dist/capacity-calibration.js +119 -0
- package/dist/cli/cloudflare-bootstrap.d.ts +11 -0
- package/dist/cloudflare-bootstrap.d.ts +218 -0
- package/dist/cloudflare-bootstrap.js +1196 -0
- package/dist/cloudflare-edge.d.ts +265 -0
- package/dist/cloudflare-edge.js +424 -0
- package/dist/definition.d.ts +3 -0
- package/dist/definition.js +174 -2
- package/dist/deploy-file.js +174 -2
- package/dist/deployment.d.ts +11 -0
- package/dist/fz-agent.js +1855 -3370
- package/dist/fz.js +8092 -6437
- package/dist/index.d.ts +2 -0
- package/dist/metal-bootstrap.d.ts +52 -0
- package/dist/metal-bootstrap.js +942 -0
- package/dist/platform-bootstrap-runtime.d.ts +161 -0
- package/dist/platform-bootstrap-runtime.js +462 -0
- package/dist/provision.js +5 -4
- package/dist/version.d.ts +1 -1
- package/package.json +26 -2
- package/schema/deploy-v2.json +14 -0
package/README.md
CHANGED
|
@@ -36,6 +36,27 @@ Install the service explicitly:
|
|
|
36
36
|
fz agent install --apply # writes a hardened systemd unit
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
+
The attended Cloudflare resource phase is part of the same published command,
|
|
40
|
+
but remains separate from the root host install so its management token never
|
|
41
|
+
enters the API or Agent service environment:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
chmod 600 cloudflare-bootstrap.json cloudflare-management.token
|
|
45
|
+
fz bootstrap platform cloudflare --bootstrap-config ./cloudflare-bootstrap.json
|
|
46
|
+
fz bootstrap platform cloudflare --bootstrap-config ./cloudflare-bootstrap.json --apply
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
The reviewed JSON has `format: 1`, kind
|
|
50
|
+
`forgezero-cloudflare-bootstrap-request`, a `checkpointPath`, the typed
|
|
51
|
+
`coordinates`, and `tokenFiles` containing file paths only. `coordinates.nodes`
|
|
52
|
+
explicitly lists each node name, origin hostname, loopback service, Tunnel name
|
|
53
|
+
and Access application name. Relative token, checkpoint and Worker project
|
|
54
|
+
paths resolve beside the config file. Plan is offline. Apply creates/reuses one
|
|
55
|
+
shared KV namespace, Worker and Access service token plus one Tunnel, Access
|
|
56
|
+
application, ingress rule and DNS record per node. The command prints only
|
|
57
|
+
resource IDs; connector, Access and requested runtime-token values stay in the
|
|
58
|
+
atomically updated owner-only checkpoint for direct systemd-credential handoff.
|
|
59
|
+
|
|
39
60
|
## What changes for an application
|
|
40
61
|
|
|
41
62
|
Nothing.
|
package/dist/agent-heartbeat.js
CHANGED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { type ProvisionPlan } from './cli/agent-install';
|
|
2
|
+
import { type SoftwareCommandResult, type SoftwareRequirement } from './software';
|
|
3
|
+
import { type PlatformSharedEnvironment } from './platform-bootstrap-runtime';
|
|
4
|
+
export declare const PLATFORM_BOOTSTRAP_PROFILES: readonly ["platform-db-api", "platform-api"];
|
|
5
|
+
export type PlatformBootstrapProfile = (typeof PLATFORM_BOOTSTRAP_PROFILES)[number];
|
|
6
|
+
export type DatabaseBootstrapRole = 'master' | 'joiner' | 'none';
|
|
7
|
+
export type BootstrapEnvironment = 'production' | 'development';
|
|
8
|
+
export interface PlatformBootstrapConfig {
|
|
9
|
+
kind: 'platform';
|
|
10
|
+
environment: BootstrapEnvironment;
|
|
11
|
+
profile: PlatformBootstrapProfile;
|
|
12
|
+
/** API-owned compute reference. Initial seed references are fz-n1..3/dev-fz-n1..3. */
|
|
13
|
+
computeReference: string;
|
|
14
|
+
nodeHostname: string;
|
|
15
|
+
apiUrl: string;
|
|
16
|
+
repository: string;
|
|
17
|
+
branch: string;
|
|
18
|
+
deployRoot?: string;
|
|
19
|
+
telemetryEndpoint: string;
|
|
20
|
+
database: {
|
|
21
|
+
role: DatabaseBootstrapRole;
|
|
22
|
+
/** Cluster mode must remain default. Bootstrap verifies it and never mutates it. */
|
|
23
|
+
serverMode: 'default';
|
|
24
|
+
address?: string;
|
|
25
|
+
master?: string;
|
|
26
|
+
coordinators: string[];
|
|
27
|
+
/** Owner/root-only file containing the shared 64-hex bootstrap code. */
|
|
28
|
+
bootstrapSecretFile: string;
|
|
29
|
+
};
|
|
30
|
+
/** Required for every post-genesis compute; initial n1..n3 derive their one-use capability. */
|
|
31
|
+
platformEnrolTokenFile?: string;
|
|
32
|
+
runtime: {
|
|
33
|
+
environment: PlatformSharedEnvironment;
|
|
34
|
+
serviceUser: string;
|
|
35
|
+
slotsDirectory: string;
|
|
36
|
+
bluePort: number;
|
|
37
|
+
greenPort: number;
|
|
38
|
+
healthPath: string;
|
|
39
|
+
keepReleases: number;
|
|
40
|
+
credentialFiles?: {
|
|
41
|
+
smtpPassword?: string;
|
|
42
|
+
backupS3Secret?: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
firewall: {
|
|
46
|
+
enabled: boolean;
|
|
47
|
+
sshPort: number;
|
|
48
|
+
privateCidrs: string[];
|
|
49
|
+
};
|
|
50
|
+
/** Install the connector binary only. Resource creation belongs to attended Cloudflare bootstrap. */
|
|
51
|
+
installCloudflared?: boolean;
|
|
52
|
+
/** Completed attended resource checkpoint; root seals only this node's runtime capabilities. */
|
|
53
|
+
cloudflareHandoff?: {
|
|
54
|
+
checkpointFile: string;
|
|
55
|
+
nodeName: string;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
export interface TenantBootstrapConfig {
|
|
59
|
+
kind: 'tenant';
|
|
60
|
+
apiUrl: string;
|
|
61
|
+
realm: string;
|
|
62
|
+
nodeHostname: string;
|
|
63
|
+
telemetryEndpoint: string;
|
|
64
|
+
enrolTokenFile: string;
|
|
65
|
+
repository?: string;
|
|
66
|
+
branch?: string;
|
|
67
|
+
profile?: string;
|
|
68
|
+
deployRoot?: string;
|
|
69
|
+
software?: SoftwareRequirement[];
|
|
70
|
+
installCloudflared?: boolean;
|
|
71
|
+
}
|
|
72
|
+
export type BootstrapConfig = PlatformBootstrapConfig | TenantBootstrapConfig;
|
|
73
|
+
export interface BootstrapStep {
|
|
74
|
+
id: string;
|
|
75
|
+
label: string;
|
|
76
|
+
mutation: boolean;
|
|
77
|
+
}
|
|
78
|
+
export interface BootstrapPlan {
|
|
79
|
+
kind: BootstrapConfig['kind'];
|
|
80
|
+
mode: 'install' | 'repair';
|
|
81
|
+
profile: string;
|
|
82
|
+
steps: readonly BootstrapStep[];
|
|
83
|
+
software: readonly SoftwareRequirement[];
|
|
84
|
+
statePath: string;
|
|
85
|
+
}
|
|
86
|
+
export interface BootstrapResult {
|
|
87
|
+
plan: BootstrapPlan;
|
|
88
|
+
applied: boolean;
|
|
89
|
+
status: BootstrapStatus;
|
|
90
|
+
launch?: {
|
|
91
|
+
command: string;
|
|
92
|
+
inviteUrl: string;
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
export interface BootstrapStatus {
|
|
96
|
+
initialized: boolean;
|
|
97
|
+
kind?: BootstrapConfig['kind'];
|
|
98
|
+
profile?: string;
|
|
99
|
+
services: Record<string, boolean>;
|
|
100
|
+
problems: string[];
|
|
101
|
+
}
|
|
102
|
+
export interface BootstrapHost {
|
|
103
|
+
uid(): number;
|
|
104
|
+
exists(path: string): boolean;
|
|
105
|
+
read(path: string): string;
|
|
106
|
+
write(path: string, content: string, mode: number): void;
|
|
107
|
+
mkdir(path: string, mode: number): void;
|
|
108
|
+
remove(path: string): void;
|
|
109
|
+
inspect?(path: string): {
|
|
110
|
+
regular: boolean;
|
|
111
|
+
symbolic: boolean;
|
|
112
|
+
uid: number;
|
|
113
|
+
mode: number;
|
|
114
|
+
links: number;
|
|
115
|
+
size: number;
|
|
116
|
+
};
|
|
117
|
+
exec(argv: readonly string[], options?: {
|
|
118
|
+
stdin?: string;
|
|
119
|
+
}): Promise<SoftwareCommandResult>;
|
|
120
|
+
ensureSoftware(requirements: readonly SoftwareRequirement[]): Promise<unknown>;
|
|
121
|
+
installAgent(config: BootstrapConfig, enrolTokenSourcePath?: string): Promise<ProvisionPlan>;
|
|
122
|
+
}
|
|
123
|
+
export declare function validateBootstrapConfig(value: BootstrapConfig): BootstrapConfig;
|
|
124
|
+
export declare function planBootstrap(input: BootstrapConfig, initialized?: boolean): BootstrapPlan;
|
|
125
|
+
export declare function bootstrapStatus(host?: BootstrapHost): Promise<BootstrapStatus>;
|
|
126
|
+
export declare function applyBootstrap(input: BootstrapConfig, host?: BootstrapHost): Promise<BootstrapResult>;
|
|
127
|
+
export declare function readBootstrapConfig(path: string): BootstrapConfig;
|
|
128
|
+
export declare function localBootstrapHost(): BootstrapHost;
|