Commit Graph

477 Commits

Author SHA1 Message Date
kenji
2e403425f9 Merge pull request 'pkgs/clan: Add --tags support to clan machines update' (#4061) from kenji/pkgs/clan: Add --tags support to clan machines update into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4061
2025-06-24 09:43:35 +00:00
Luis Hebendanz
feb47ffe33 Merge pull request 'clan-cli: Move hardware.py to clan_lib/machines part2' (#4066) from Qubasa/clan-core:move_to_clan_lib2 into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4066
2025-06-24 09:19:41 +00:00
Qubasa
168e1d8c96 clan-cli: Move hardware.py to clan_lib/machines 2025-06-24 11:07:37 +02:00
Qubasa
78fdd21610 clan-cli: Add missining propagation of host-key-check in machines.update 2025-06-24 10:35:53 +02:00
a-kenji
fc0e8fa1bd pkgs/clan: Add --tags support to clan machines update 2025-06-23 23:51:43 +02:00
Qubasa
071151f300 clan-lib: Rename parse_deployment_address to parse_ssh_uri 2025-06-23 15:32:35 +02:00
Qubasa
054ea67fb7 clan-cli: Simplify HostKeyCheck to a Literal instead of an Enum 2025-06-23 15:08:44 +02:00
Qubasa
274c552365 clan-lib: machines.py: Remove host_key attribute 2025-06-19 17:55:56 +02:00
Qubasa
aac07ddd25 clan-lib: machines.py: Remove private_key attribute 2025-06-19 17:28:50 +02:00
a-kenji
1f692c91e4 pkgs/clan: Improve machines list tests
Extend and Improve `clan machines list` testing as well as the `--tags`
subcommand.
2025-06-18 16:03:02 +02:00
Michael Hoang
a0f39a4a66 cli: fix machines update failing with protocol mismatch on macOS 2025-06-18 16:30:11 +07:00
Jörg Thalheim
a2eaf20492 machines: fix remote-program for darwin nix copy
MacOS doesn't come with a proper login shell for ssh and therefore
doesn't have nix in $PATH as it doesn't source /etc/profile.
This restores the remote-program parameter that was accidentally
removed in commit e14f30bdc0.
2025-06-17 16:30:04 +02:00
Qubasa
86536bae42 clan-lib: Refactor remote host handling to function parameters
This refactoring improves the separation of concerns by moving remote host creation logic from the Machine class to the calling functions, making the code more flexible and testable.
2025-06-17 14:04:22 +02:00
Qubasa
d29bba48e7 clan-lib: Make Remote overridable over function arguments 2025-06-17 13:53:43 +02:00
Jörg Thalheim
28a0f09514 install: correctly pass nix options to nixos-anywhere
The nix_options were collected but never passed to the nixos-anywhere command.
This fix adds the options to the command before the target host argument.
2025-06-17 12:43:20 +02:00
hsjobeki
4e2ccf0117 Merge pull request 'Feat(machine/templates): simplify template args for machines command' (#3937) from hsjobeki/template-ux into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3937
2025-06-14 08:25:28 +00:00
Qubasa
68b7c22faf clan-cli: init machine from inventory 2025-06-12 16:36:55 +02:00
Johannes Kirschbauer
abee3147ea Fix(morph): ensure machine dir exists 2025-06-11 20:38:15 +02:00
Johannes Kirschbauer
799c23bb56 doc(cli/templates): improve help description 2025-06-11 17:00:10 +02:00
Johannes Kirschbauer
a254ff46a1 fix(tess/morph): skip creating existing machine 2025-06-11 17:00:10 +02:00
Johannes Kirschbauer
b5ed9fdfed Docs(cli/machines): improve description of '--template' 2025-06-11 17:00:10 +02:00
Johannes Kirschbauer
1e3e7b6d37 Chore(machine/templates): simplify template args for machines command 2025-06-11 17:00:08 +02:00
Johannes Kirschbauer
92fdba3965 Chore(templates): move helper functions into a util file 2025-06-10 19:38:10 +02:00
Qubasa
ee802ad723 clan-cli: Use Remote class in DeployInfo, add tests for qrcode parser and json parser 2025-06-09 19:27:01 +02:00
hsjobeki
78c0ad24d9 Merge pull request 'Refactor(api/update_machine): rename to set_machine; use name, flake' (#3899) from api-narrowing into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3899
2025-06-09 11:55:28 +00:00
Johannes Kirschbauer
2685db33d7 Refactor(cli/list_machines): rename to list_full_machines
This makes it clear that this should be used with care
It is potentially more expensive to create the full object, therefore it should be discouraged by its longer name
This listing is implemented based on the basic listing, where each item is turned into the bigger machine class
2025-06-09 13:40:57 +02:00
Johannes Kirschbauer
57e71e6c66 Refactor(api/list_machines): rename from list_inv_machines 2025-06-09 13:33:25 +02:00
lassulus
8ce860f0d3 Revert "clan-cli: Use Remote class in DeployInfo, add tests for qrcode parser and json parser"
This reverts commit b1ef5f00bf.
2025-06-09 11:28:15 +02:00
hsjobeki
4faec2c4d2 Merge pull request 'Chore(api): narrow down get_machine' (#3863) from api-narrowing into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3863
2025-06-09 08:59:36 +00:00
Qubasa
b1ef5f00bf clan-cli: Use Remote class in DeployInfo, add tests for qrcode parser and json parser 2025-06-07 00:51:24 +02:00
Jörg Thalheim
b4263caf37 cli: fix buildHost source upload destination
Sources were being uploaded to target host instead of build host,
causing nixos-rebuild to fail with "no such file or directory".
2025-06-06 14:51:12 +02:00
Johannes Kirschbauer
ea1c1a5185 Chore(api): narrow down get_machine
Dont require the user to pass the machine into the same getter function
The workflow contradicts itself here
2025-06-04 20:38:45 +02:00
Jörg Thalheim
2ef379b4df update/upload_sources remove ssh_control_master again from upload_sources 2025-05-28 16:21:30 +02:00
Jörg Thalheim
cedc5113ea add sudo_askpass_proxy 2025-05-28 16:21:30 +02:00
Johannes Kirschbauer
d482e22610 chore(nix_models): migrate import to use exported clan models 2025-05-28 14:03:22 +02:00
Johannes Kirschbauer
dd9ea44770 refactor(persist/utils): rename apply_patch to 'set_value_by_path' 2025-05-28 10:16:48 +02:00
Johannes Kirschbauer
63733f2c14 Fix(test): migrate machine cli command tests to use the new functions 2025-05-27 17:57:08 +02:00
Johannes Kirschbauer
e6d1f71907 Feat(inventory): remove legacy action functions
Inventory should only and always be accessed through the inventory store.
Manually reading and writing to the json file is highly insecure
2025-05-27 17:20:04 +02:00
Johannes Kirschbauer
90d9dbb242 Refactor(lib/inventory): move machine actions into clan_lib/machines/actions.py 2025-05-26 17:51:12 +02:00
Johannes Kirschbauer
55195e57e0 fix(morph/test): temporary workaround for morph test 2025-05-26 16:06:12 +02:00
Johannes Kirschbauer
14701fda01 chore: add todo comments for template logic in create machine 2025-05-26 16:05:20 +02:00
Johannes Kirschbauer
fe933d8eb7 Fix(machines/create): check if machine is already created 2025-05-23 22:31:06 +02:00
Johannes Kirschbauer
c8588eddb6 Fix(machines/create): always add 'deploy.targetHost'
Rationale: not passing the value, is equivalent to deleting a value from the inventory store
See: 'delete_by_path'
deploy.targetHost has a default of null (None)
2025-05-23 22:07:09 +02:00
Qubasa
8b1968cca6 clan-cli: Move Machine object to clan_lib 2025-05-22 19:11:19 +02:00
Qubasa
e14f30bdc0 clan-cli: Rename Host -> Remote move to clan_lib and mark as frozen 2025-05-22 14:08:27 +02:00
Jörg Thalheim
e275bb20bc fix build_host not beeing applied 2025-05-22 00:22:04 +02:00
lassulus
2de3dcef15 clan-cli: clan_cli.inventory -> clan_lib.inventory 2025-05-21 12:06:38 +02:00
Johannes Kirschbauer
d3fc1725f0 docs: replace outdates reference links to 'guides' in the cli 2025-05-20 18:49:35 +02:00
lassulus
03990ef7f0 clan-cli: clan_cli.templates -> clan_lib.templates 2025-05-20 16:08:02 +02:00
lassulus
a4895a4d96 clan-cli: clan_cli.async_run -> clan_lib.async_run 2025-05-20 15:05:11 +02:00