Add API key support for git authentication

- Add nixos_config_api_key_file option to NixOS configuration
- Support reading API token from file for private repositories
- Automatically inject token into HTTPS URLs (https://token@host/repo.git)
- Graceful fallback to original URL if key file missing/empty
- Default key file location: /var/lib/cm-dashboard/git-api-key

Usage: echo 'your-api-token' | sudo tee /var/lib/cm-dashboard/git-api-key
This commit is contained in:
2025-10-24 19:30:26 +02:00
parent 8978356c49
commit 114ad52ae8
5 changed files with 39 additions and 7 deletions

View File

@@ -26,6 +26,7 @@ pub enum AgentCommand {
git_url: String,
git_branch: String,
working_dir: String,
api_key_file: Option<String>,
},
}