@forgezero/agent 0.1.64 → 0.1.65

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.
@@ -749,7 +749,7 @@ async function postSignedNode(options, path, body) {
749
749
  }
750
750
 
751
751
  // src/version.ts
752
- var VERSION3 = "0.1.64";
752
+ var VERSION3 = "0.1.65";
753
753
 
754
754
  // src/agent-heartbeat.ts
755
755
  var unquote = (value) => value.replace(/^['"]|['"]$/g, "");
package/dist/bootstrap.js CHANGED
@@ -1396,7 +1396,7 @@ var UPDATE_RETRY_BASE_MS = 5 * 60000;
1396
1396
  var UPDATE_RETRY_MAX_MS = 24 * 60 * 60000;
1397
1397
 
1398
1398
  // src/version.ts
1399
- var VERSION = "0.1.64";
1399
+ var VERSION = "0.1.65";
1400
1400
 
1401
1401
  // src/software.ts
1402
1402
  var PINNED_BUN_VERSION = "1.3.14";
@@ -84,6 +84,15 @@ export interface InstallOptions {
84
84
  nodeHostname?: string;
85
85
  telemetryEndpoint?: string;
86
86
  }
87
+ export type GitIdentityInstallOptions = Pick<InstallOptions, 'gitCredentialPath' | 'gitPublicKeyPath' | 'generateGitIdentity'>;
88
+ /**
89
+ * Resolve the optional compatibility Git identity from the explicit install
90
+ * environment. An ordinary Agent install must not load a credential merely
91
+ * because the CLI knows its conventional pathname: systemd treats every
92
+ * LoadCredentialEncrypted entry as required and refuses to start when that
93
+ * file does not exist.
94
+ */
95
+ export declare function resolveGitIdentityInstallOptions(environment: Readonly<Record<string, string | undefined>>): GitIdentityInstallOptions;
87
96
  export declare function planInstall(options: InstallOptions): ProvisionPlan;
88
97
  /** Execute the same ordered plan the control plane executes over SSH. */
89
98
  export declare function applyPlan(plan: ProvisionPlan, run: (operation: CapabilityOperation | ProvisionOperation) => Promise<{
package/dist/fz-agent.js CHANGED
@@ -8566,7 +8566,7 @@ function assertSupportedGuestImage(imageKey) {
8566
8566
  }
8567
8567
 
8568
8568
  // src/version.ts
8569
- var VERSION2 = "0.1.64";
8569
+ var VERSION2 = "0.1.65";
8570
8570
 
8571
8571
  // src/ssh-bootstrap.ts
8572
8572
  class SshBootstrapError extends Error {
package/dist/fz.js CHANGED
@@ -4829,7 +4829,7 @@ var UPDATE_RETRY_BASE_MS = 5 * 60000;
4829
4829
  var UPDATE_RETRY_MAX_MS = 24 * 60 * 60000;
4830
4830
 
4831
4831
  // src/version.ts
4832
- var VERSION2 = "0.1.64";
4832
+ var VERSION2 = "0.1.65";
4833
4833
 
4834
4834
  // src/software.ts
4835
4835
  var PINNED_BUN_VERSION = "1.3.14";
@@ -6596,6 +6596,16 @@ async function localRunner(operation) {
6596
6596
  `, exitCode: 1 };
6597
6597
  }
6598
6598
  }
6599
+ function resolveGitIdentityInstallOptions(environment) {
6600
+ const generateGitIdentity = environment.FZ_GENERATE_GIT_DEPLOY_KEY === "true";
6601
+ const explicitCredential = environment.FZ_GIT_CREDENTIAL_PATH?.trim() || undefined;
6602
+ const explicitPublicKey = environment.FZ_GIT_PUBLIC_KEY_PATH?.trim() || undefined;
6603
+ return {
6604
+ gitCredentialPath: explicitCredential ?? (generateGitIdentity ? "/etc/forgezero/creds/git-deploy-key.cred" : undefined),
6605
+ gitPublicKeyPath: explicitPublicKey ?? (generateGitIdentity ? "/etc/forgezero/git/deploy.pub" : undefined),
6606
+ generateGitIdentity
6607
+ };
6608
+ }
6599
6609
  function planInstall(options) {
6600
6610
  const { capabilities, ...unit } = options;
6601
6611
  return planProvision({ ...unit, mode: modeFor(capabilities) });
@@ -17456,16 +17466,13 @@ async function cmdAgent(options, args) {
17456
17466
  }
17457
17467
  const enrolTokenCredentialPath = "/etc/forgezero/creds/enrol-token.cred";
17458
17468
  const enrolStatePath = "/var/lib/forgezero/enrolment.json";
17459
- const gitCredentialPath = process.env.FZ_GIT_CREDENTIAL_PATH ?? "/etc/forgezero/creds/git-deploy-key.cred";
17460
- const gitPublicKeyPath = process.env.FZ_GIT_PUBLIC_KEY_PATH ?? "/etc/forgezero/git/deploy.pub";
17469
+ const gitIdentity = resolveGitIdentityInstallOptions(process.env);
17461
17470
  const plan = planInstall({
17462
17471
  capabilities: await readCapabilities(localRunner),
17463
17472
  socketPath: process.env.FZ_SOCKET_PATH ?? DEFAULT_SOCKET,
17464
17473
  seedPath: process.env.FZ_SEED_PATH ?? "/var/lib/forgezero/node.seed",
17465
17474
  seedCredentialPath: process.env.FZ_SEED_CREDENTIAL_PATH,
17466
- gitCredentialPath,
17467
- gitPublicKeyPath,
17468
- generateGitIdentity: process.env.FZ_GENERATE_GIT_DEPLOY_KEY === "true",
17475
+ ...gitIdentity,
17469
17476
  controlSocketPath: process.env.FZ_CONTROL_SOCKET,
17470
17477
  repository: process.env.FZ_DEPLOY_REPO,
17471
17478
  branch: process.env.FZ_DEPLOY_BRANCH,
@@ -17550,11 +17557,11 @@ async function cmdAgent(options, args) {
17550
17557
  for (const step3 of transcript)
17551
17558
  out.ok(step3.label);
17552
17559
  out.ok("Agent service and socket verified");
17553
- if (existsSync12(gitPublicKeyPath)) {
17560
+ if (gitIdentity.gitPublicKeyPath && existsSync12(gitIdentity.gitPublicKeyPath)) {
17554
17561
  out.line();
17555
17562
  out.line(" Compatibility SSH deploy public key:");
17556
17563
  out.line();
17557
- out.line(` ${readFileSync15(gitPublicKeyPath, "utf8").trim()}`);
17564
+ out.line(` ${readFileSync15(gitIdentity.gitPublicKeyPath, "utf8").trim()}`);
17558
17565
  out.line();
17559
17566
  }
17560
17567
  return 0;
@@ -292,7 +292,7 @@ function systemdAgentEgressDirectives(loopbackTcpPorts = []) {
292
292
  }
293
293
 
294
294
  // src/version.ts
295
- var VERSION = "0.1.64";
295
+ var VERSION = "0.1.65";
296
296
 
297
297
  // src/otel-collector.ts
298
298
  var FORGEZERO_OTEL_COLLECTOR_UNIT = "forgezero-otel-collector.service";
@@ -1396,7 +1396,7 @@ var UPDATE_RETRY_BASE_MS = 5 * 60000;
1396
1396
  var UPDATE_RETRY_MAX_MS = 24 * 60 * 60000;
1397
1397
 
1398
1398
  // src/version.ts
1399
- var VERSION = "0.1.64";
1399
+ var VERSION = "0.1.65";
1400
1400
 
1401
1401
  // src/software.ts
1402
1402
  var PINNED_BUN_VERSION = "1.3.14";
@@ -2088,7 +2088,7 @@ function requestSoftware(requirements, socketPath = DEFAULT_SOFTWARE_HELPER_SOCK
2088
2088
  }
2089
2089
 
2090
2090
  // src/version.ts
2091
- var VERSION3 = "0.1.64";
2091
+ var VERSION3 = "0.1.65";
2092
2092
 
2093
2093
  // src/egress-policy.ts
2094
2094
  import { realpathSync as realpathSync3 } from "node:fs";
package/dist/provision.js CHANGED
@@ -2088,7 +2088,7 @@ function requestSoftware(requirements, socketPath = DEFAULT_SOFTWARE_HELPER_SOCK
2088
2088
  }
2089
2089
 
2090
2090
  // src/version.ts
2091
- var VERSION3 = "0.1.64";
2091
+ var VERSION3 = "0.1.65";
2092
2092
 
2093
2093
  // src/egress-policy.ts
2094
2094
  import { realpathSync as realpathSync3 } from "node:fs";
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  /** One package version shared by both public binaries. Pinned to package.json by tests. */
2
- export declare const VERSION = "0.1.64";
2
+ export declare const VERSION = "0.1.65";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forgezero/agent",
3
- "version": "0.1.64",
3
+ "version": "0.1.65",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "check": "tsc --noEmit",