@forgezero/agent 0.1.88 → 0.1.89

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.
@@ -2,7 +2,7 @@
2
2
  // src/host-maintenance.ts
3
3
  import { lstatSync, readFileSync } from "fs";
4
4
  var ROOT = "/opt/forgezero";
5
- var SLOT_FILE = `${ROOT}/.forge-slot`;
5
+ var SLOT_FILE = `${ROOT}/slots/.active`;
6
6
  var SHARED_ENV = `${ROOT}/shared/.env`;
7
7
  var JWT = "/etc/forgezero/creds/arangodb-jwt.cred";
8
8
  var FZ = "/usr/local/bin/fz";
package/dist/index.d.ts CHANGED
@@ -170,6 +170,13 @@ export type InitialVaultReplicaStatus = {
170
170
  * is available again.
171
171
  */
172
172
  export declare function initializeVaultReplica(cache: Pick<SecretCache, 'load'>): Promise<InitialVaultReplicaStatus>;
173
+ /** Keep the local signed/control plane alive while remote attestation retries. */
174
+ export declare function attemptInitialAttestation<T>(attempt: () => Promise<T>, onDeferred: (cause: unknown) => void): Promise<{
175
+ verified: true;
176
+ result: T;
177
+ } | {
178
+ verified: false;
179
+ }>;
173
180
  /**
174
181
  * Bring the agent up.
175
182
  *
@@ -366,7 +366,7 @@ function systemdAgentEgressDirectives(loopbackTcpPorts = []) {
366
366
  }
367
367
 
368
368
  // src/version.ts
369
- var VERSION = "0.1.88";
369
+ var VERSION = "0.1.89";
370
370
 
371
371
  // src/otel-collector.ts
372
372
  var FORGEZERO_OTEL_COLLECTOR_UNIT = "forgezero-otel-collector.service";
@@ -495,7 +495,12 @@ async function executeSoftwareOperation(operation) {
495
495
  }
496
496
  if (software === "nginx") {
497
497
  const binary = await run(["/usr/sbin/nginx", "-v"]);
498
- return binary.exitCode === 0 ? run(["/usr/bin/systemctl", "is-active", "--quiet", "nginx.service"]) : binary;
498
+ if (binary.exitCode !== 0)
499
+ return binary;
500
+ if (!existsSync("/usr/lib/nginx/modules/ngx_http_headers_more_filter_module.so")) {
501
+ return { exitCode: 1, output: "Nginx response-header suppression module is unavailable" };
502
+ }
503
+ return run(["/usr/bin/systemctl", "is-active", "--quiet", "nginx.service"]);
499
504
  }
500
505
  if (software === "arangodb") {
501
506
  const binary = await run(["/usr/sbin/arangod", "--version"]);
@@ -527,7 +532,7 @@ async function executeSoftwareOperation(operation) {
527
532
  }
528
533
  if (software === "docker" || software === "nginx" || software === "ufw" || software === "openssh-client" || software === "git") {
529
534
  const packageName = software === "openssh-client" ? "openssh-client" : software === "docker" ? "docker.io" : software;
530
- const installed = await aptInstall(packageName);
535
+ const installed = software === "nginx" ? await aptInstallMany(["nginx", "libnginx-mod-http-headers-more-filter"]) : await aptInstall(packageName);
531
536
  if (installed.exitCode !== 0 || software !== "nginx" && software !== "docker")
532
537
  return installed;
533
538
  if (software === "docker") {
@@ -495,7 +495,12 @@ async function executeSoftwareOperation(operation) {
495
495
  }
496
496
  if (software === "nginx") {
497
497
  const binary = await run(["/usr/sbin/nginx", "-v"]);
498
- return binary.exitCode === 0 ? run(["/usr/bin/systemctl", "is-active", "--quiet", "nginx.service"]) : binary;
498
+ if (binary.exitCode !== 0)
499
+ return binary;
500
+ if (!existsSync("/usr/lib/nginx/modules/ngx_http_headers_more_filter_module.so")) {
501
+ return { exitCode: 1, output: "Nginx response-header suppression module is unavailable" };
502
+ }
503
+ return run(["/usr/bin/systemctl", "is-active", "--quiet", "nginx.service"]);
499
504
  }
500
505
  if (software === "arangodb") {
501
506
  const binary = await run(["/usr/sbin/arangod", "--version"]);
@@ -527,7 +532,7 @@ async function executeSoftwareOperation(operation) {
527
532
  }
528
533
  if (software === "docker" || software === "nginx" || software === "ufw" || software === "openssh-client" || software === "git") {
529
534
  const packageName = software === "openssh-client" ? "openssh-client" : software === "docker" ? "docker.io" : software;
530
- const installed = await aptInstall(packageName);
535
+ const installed = software === "nginx" ? await aptInstallMany(["nginx", "libnginx-mod-http-headers-more-filter"]) : await aptInstall(packageName);
531
536
  if (installed.exitCode !== 0 || software !== "nginx" && software !== "docker")
532
537
  return installed;
533
538
  if (software === "docker") {
@@ -117,6 +117,9 @@ export type OperatorCommand = (argv: readonly string[], options?: {
117
117
  secret?: boolean;
118
118
  safeStdout?: boolean;
119
119
  }) => Promise<OperatorCommandResult>;
120
+ export declare const operatorPackagedFzCliPath: () => string;
121
+ export declare const operatorPackagedAgentPath: () => string;
122
+ export declare const operatorPackagedGitSshPath: () => string;
120
123
  export interface OperatorPlatformBootstrapOptions {
121
124
  exec?: OperatorCommand;
122
125
  fetch?: typeof fetch;
@@ -143,6 +146,15 @@ export declare function planOperatorPlatformBootstrap(request: OperatorPlatformB
143
146
  /** Exact non-secret coordinates derived from the same reviewed files bootstrap applies. */
144
147
  export declare function operatorPlatformFleetCoordinates(fleet: OperatorPlatformBootstrapFleetRequest): OperatorPlatformFleetCoordinates;
145
148
  export declare function planOperatorPlatformFleetBootstrap(fleet: OperatorPlatformBootstrapFleetRequest, mode: OperatorPlatformBootstrapMode): OperatorPlatformBootstrapFleetPlan;
149
+ /** Keep typed failure text while proving no attended value can be returned. */
150
+ export declare function redactOperatorSecretDiagnostic(stderr: string, stdin?: string): string;
151
+ /**
152
+ * Create or reopen the one shared genesis credential on the reviewed Metal
153
+ * host. The operator laptop is transport only: the value exists in local RAM
154
+ * long enough to cross the already pinned SSH sessions, while the only durable
155
+ * copy is encrypted by Metal's systemd host key.
156
+ */
157
+ export declare function operatorMetalClusterBootstrapCode(requestInput: OperatorMetalBootstrapRequest, options?: OperatorPlatformBootstrapOptions): Promise<string>;
146
158
  export declare function collectOperatorGuestHostKeys(request: OperatorMetalBootstrapRequest, options?: OperatorPlatformBootstrapOptions, includeRehearsal?: boolean): Promise<OperatorGuestHostKeyEvidence>;
147
159
  export interface OperatorGuestTransport {
148
160
  run(nodeName: string, argv: readonly string[], options?: {