Skip to content

fix: make agent pre_authkey optional when disabled#476

Open
drifterza wants to merge 1 commit intotale:mainfrom
drifterza:fix/issue-455-nixos-agent-config
Open

fix: make agent pre_authkey optional when disabled#476
drifterza wants to merge 1 commit intotale:mainfrom
drifterza:fix/issue-455-nixos-agent-config

Conversation

@drifterza
Copy link
Contributor

Fixes #455

Problem

When using NixOS module with agent disabled, headplane fails to start because pre_authkey is required even when enabled: false.

Solution

Changed the agent config validation to only require pre_authkey when enabled is true. Uses arktype's narrow() for conditional validation.

Changes

  • app/server/config/config-schema.ts - pre_authkey now optional with conditional check
  • tests/unit/config/agent-disabled.test.ts - tests for disabled/enabled scenarios

Testing

  • 4 new tests covering: disabled without key, enabled without key (should fail), enabled with key, no agent config

When integration.agent.enabled is false, pre_authkey should not be
required. Added conditional validation using arktype's narrow().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nixos: even with agent disabled settings.integration.agent.pre_authkey_path needs to be set otherwise headplane won't start

1 participant