Commit Graph

584 Commits

Author SHA1 Message Date
Qubasa
6b784f8623 clan-cli: Rework 'clan ssh' command, improve Tor support. 2024-12-13 00:11:18 +01:00
Jörg Thalheim
9ad4e4d041 fix clan vars for public vars 2024-12-11 16:39:54 +01:00
Jörg Thalheim
91dbafd174 run clang-format 2024-12-11 14:38:36 +00:00
DavHau
a5148ede1d vars: add test to ensure shared secrets access after --regenerate
Ensure that a shared secret can still be accessed by all machines that share it, after a 'clan vars generate --regenerate' has been issued
2024-12-11 15:44:30 +07:00
DavHau
9ae5e27c33 vars: add test for shared secret not being regenerated
see https://git.clan.lol/clan/clan-core/issues/2393
2024-12-11 15:14:44 +07:00
Johannes Kirschbauer
959ab140a6 Inventory: init delete patial data 2024-12-10 21:19:04 +01:00
Johannes Kirschbauer
096ddea270 Inventory: fix persistence 2024-12-10 16:41:40 +01:00
lassulus
9129790e5c vars: move ensure_consistent_state into health_check, move into store classes 2024-12-10 11:54:52 +00:00
Qubasa
65a5789c5b clan-cli: Replace HostGroup and MachineGroup with generic AsyncRuntime class. Propagate cmd prefix over thread local. Close threads on CTRL+C 2024-12-09 18:07:23 +01:00
Johannes Kirschbauer
69b7f6be5b inventory.{cli,api}: use only dictionaries 2024-12-06 18:51:20 +01:00
Jörg Thalheim
0a4cf8a8b8 tests/sshd: also log what platform we received in the assert 2024-12-06 15:39:35 +00:00
Johannes Kirschbauer
6dd1ecb044 inventory/api: init smart update for inventory 2024-12-06 11:07:52 +01:00
Johannes Kirschbauer
a032c446e1 inventory/api: prepare list merging 2024-12-06 11:07:52 +01:00
Johannes Kirschbauer
ebd494e112 inventory/eval: init determine writeability for single inventory options 2024-12-05 16:18:46 +01:00
Johannes Kirschbauer
17de9e3e2f clan.cli.inventory: init partial write 2024-12-04 17:43:20 +01:00
clan-bot
daf892c046 Merge pull request 'Better install instructions for macos' (#2550) from arm64 into main 2024-12-04 16:32:02 +00:00
Jörg Thalheim
621fbd0f83 test_vars: set hostPlatform 2024-12-04 17:25:20 +01:00
lassulus
35ff4b92a6 test_vars_deployment: fix race condition with multiple VMs on error case 2024-12-04 17:07:36 +01:00
lassulus
0b8debae46 test_vars_deployment: pass stdin as DEVNULL to vm 2024-12-04 17:07:36 +01:00
Jörg Thalheim
012e2686d0 test_vms_cli: set hostPlatform x86_64-linux 2024-12-04 17:04:12 +01:00
Jörg Thalheim
eac609a85d test_flake_with_core: set system explicit 2024-12-04 15:54:00 +01:00
Jörg Thalheim
4457cdddbc getpwnam-preload.c: no longer log shell 2024-12-04 14:57:00 +01:00
Jörg Thalheim
3452ca54e6 skip writing the empty inventory json 2024-12-04 12:14:32 +01:00
DavHau
439cde691f vars: print() -> log.info() 2024-12-04 14:08:50 +07:00
DavHau
a11820b1d6 vars: Improve logging for migration 2024-12-04 12:42:03 +07:00
Jörg Thalheim
bbb2aca5cb rename run_no_output to run_no_stdout
we want stderr for some nix commands.
2024-12-03 17:15:28 +01:00
Qubasa
570bceff4e clan-cli: Fix ignored debug flag in clan vms run, refactor Host.run to use RunOpts 2024-12-03 16:01:51 +01:00
DavHau
5c5a87d416 vars: rename: invalidation -> validation 2024-11-29 17:23:31 +07:00
Qubasa
cf2ddfc191 clan-vm-manager: Fix regression part2 2024-11-28 19:01:46 +01:00
Qubasa
cc8c76e4d4 clan-cli: refactor HostGroup._run_local to work with RunOpts 2024-11-28 16:05:51 +01:00
Qubasa
1f98df96e3 clan-cli: cmd.run now has its options extracted to a dataclass 2024-11-28 15:26:37 +01:00
Johannes Kirschbauer
ffff5aa5ae CLI/tests: use correct fixture paths 2024-11-28 11:56:12 +01:00
Qubasa
9c2c33d577 clan-cli: SSH now completely refactored to use dataclasses everywhere 2024-11-28 10:52:14 +01:00
DavHau
44e6fe803f vars: make all python tests work in nix sandbox
- generate a flake.lock file for each template by copying the clan-core flake.lock and modifying it

- call nix build with --store for tests inside the sandbox
2024-11-27 14:32:02 +07:00
Jörg Thalheim
c9e80f38ca vars: make interface more type-safe 2024-11-26 17:08:26 +01:00
Jörg Thalheim
39db147e48 test_vars: mock ask function instead of sys.stdin 2024-11-26 11:56:38 +00:00
Johannes Kirschbauer
0811dd8e3e API/serde: add handling for serializing enum classes 2024-11-26 10:44:06 +00:00
DavHau
1881d7f0a5 vars: fix migration - secrets end up in public store 2024-11-26 17:02:11 +07:00
Qubasa
b9154fddd2 clan-cli: Refactor ssh classes to dataclasses 2024-11-25 19:47:17 +01:00
Qubasa
979e5e839d clan-cli: Refactor ssh part 2, Refactor custom_logger 2024-11-22 22:08:50 +01:00
Qubasa
a4f3d9d1fc clan-cli: Refactor ssh folder part 1 2024-11-21 13:02:22 +01:00
DavHau
d4c8b2e4ed vars: implement invalidation mechanism
This adds options `invalidationData` to generators.

`invalidationData` can be used by an author of a generator to signal if a re-generation is required after updating the logic.

Whenever a generator with invalidation data is executed, a hash of that data is stored by the respective public and/or secret backends.

The stored hashes will be checked on future deployments, and a re-generation is triggered whenever a hash doesn't match what's defined in nix.
2024-11-20 16:27:22 +07:00
Jörg Thalheim
609dc90775 remove ssh.id_ed25519 from facts test
we have moved this to vars now.
2024-11-19 09:46:14 +00:00
DavHau
2127c7f5cb vars: add test for 'clan vars get' 2024-11-19 13:32:27 +07:00
DavHau
1d66d32163 tests: improve performance, keep flake.lock between tests
- deprecate fixture generate_flake in favor of class ClanFlake
- allow creating flake templates that can be copied, including their state, like git and lock files, in order to avoid expensive re-initialization
2024-11-18 17:01:58 +07:00
Qubasa
26730cd662 clan-cli: upload.py -> Replace rsync with native ssh command 2024-11-15 22:03:47 +07:00
a-kenji
edef77091a pkgs/cli: Fix typo in test fixtures 2024-11-14 15:00:44 +01:00
DavHau
05ff6cfd89 cleanup: remove legacy flake fixture test_flake_minimal and test_flake_with_core_and_pass 2024-11-14 14:03:29 +07:00
DavHau
8b94bc71bc vars: allow re-encrypting secrets when recipient keys were added.
When the users of a secret change, when for example a new admin user is added, an error will be thrown when generating vars, prompting the user to pass --fix to re-encrypt the secrets
2024-11-13 18:49:30 +07:00
Johannes Kirschbauer
9fb6ea2b8a Chore: remove unused clanImports module 2024-11-12 14:46:25 +01:00