Commit Graph

2472 Commits

Author SHA1 Message Date
Qubasa
64231e45f2 clan-cli: Fix symlink issue with copy_from_nixstore, add test for it. Also add more comprehensive clan template tests 2025-02-13 15:34:21 +07:00
Sacha Korban
9bc3d808c1 clan-cli: machines install: add phases option for nixos-anywhere 2025-02-13 17:10:02 +11:00
Louis Opter
0c1244ecb6 clan-cli: secrets machines remove: update secrets after removing the key
Quick follow up to PR #2781, this commit does the same kind of logic but
for machines instead of users and groups.

Note that this only affects the `clan secrets machines remove`
sub-command, and that `clan machines delete` still leaves unusable
secrets & vars behind. This can be addressed in a different change.
2025-02-13 03:53:23 +00:00
Michael Hoang
fa38ed6f0b zerotierone: fix on macOS 2025-02-10 20:56:31 +07:00
Qubasa
f4b9177226 clan-cli: Mark new test as impure 2025-02-10 20:36:55 +07:00
Qubasa
a8fa8f505c clan-cli: Add update_clan boolean option to create_clan 2025-02-10 20:36:55 +07:00
Qubasa
8baff4637e clan-cli: Fix disko template to not fail because of missing bootloader. 2025-02-10 20:36:55 +07:00
Qubasa
db1127a9b3 clan-cli: Add one more test for checking Flake with git+file: 2025-02-10 20:36:55 +07:00
lassulus
2dbdb61438 clan-cli: add persistant flake caching 2025-02-10 13:29:01 +00:00
Jörg Thalheim
385be1ea7c cli: fix build on macOS 2025-02-10 17:41:50 +07:00
Johannes Kirschbauer
048bd37e3b Inventory: automatically create emtpy file on write 2025-02-10 09:02:23 +00:00
Johannes Kirschbauer
f380046050 CLI: machine create use patch inventory for partial updates 2025-02-10 09:02:23 +00:00
lassulus
7d8c72f9bc clan_cli flake caching: support outPath 2025-02-10 04:33:37 +00:00
lassulus
2a8f40e91a clan_cli machines: use Flake instead of FlakeId 2025-02-07 06:26:09 +01:00
a-kenji
cf1a4f805c pkgs/cli: Rename create_file -> persist 2025-02-06 14:59:59 +00:00
a-kenji
521539608f pgks/cli: Add toplevel aliases 2025-02-06 14:56:57 +00:00
lassulus
9195fe4ca2 clan-cli: test_flake_caching: add actual flake caching test 2025-02-05 10:17:37 +00:00
Johannes Kirschbauer
afb723f8c0 Fix: use older nodejs version due to breaking classnames in 22.12 2025-02-05 03:36:43 +00:00
Qubasa
fdb3f89480 clan-app: Fix Gsettings schema files not found 2025-02-04 17:10:35 +07:00
Qubasa
bf26a2d306 clan-cli: Fix incorrect input handling in get_templates 2025-02-04 08:10:32 +00:00
a-kenji
da0f792d9e vars/interface: Change prompt.persist default to false
Change `prompt.persist` default to false.
We want a consistent default that is not conditionally dependent on
other values.
This makes communication on how the functionality is used more
consistent and easier understood.
2025-02-04 07:47:22 +00:00
a-kenji
1629fb68bd pkgs/clan: Remove select debug prints 2025-02-04 07:32:55 +00:00
a-kenji
38f1087517 pkgs/clan: Fix help formatter 2025-02-04 07:32:55 +00:00
lassulus
3f19444985 clan_cli: add select command 2025-02-04 07:32:55 +00:00
Michael Hoang
9458fdf7bc clan-cli: fix clan-cli accidentally dependending on all packages 2025-02-04 04:52:47 +00:00
Jörg Thalheim
efcfae387f shut up eslint warnings 2025-02-04 04:02:42 +00:00
Jörg Thalheim
638710818b fix mypy 2025-02-04 04:02:42 +00:00
Louis Opter
48268f7960 clan-cli: do not skip secrets.update_secrets when a group is removed
We need to remove all keys that were in the group from affected secrets.

With this change we now take `group_name` as an argument in
`{add,remove}_member`, which is a little bit more readable than
`group_folder.parent.name`, and helps DRY the code a bit.
2025-02-04 03:13:20 +00:00
Louis Opter
ef442ef316 clan-cli: secrets users add: make sure only one key argument was passed
This is slightly better input validation FWIW.
2025-02-04 03:13:20 +00:00
Louis Opter
81cf521d8c clan-cli: secrets: properly update secrets when an user is removed
Fixes #2659.
2025-02-04 03:13:20 +00:00
Louis Opter
36a54ead12 clan-cli: improve tests on clan secrets …
When users or groups are updated :

- Check that keys are properly updated on sops secrets;
- Check that no dangling symlinks are left behind in sops secrets.

And when an user is removed from the clan, check that it is removed from
the groups it belonged to.

This doesn't check this works for vars explicitly, since they share the
same logic, see `secret_paths.extend(list_vars_secrets(flake_dir))` in
commit f2856cb773.

Those improvements allow us to validate that #2659 is indeed fixed, and
tell us that we need to make the same kind of fixes for machines and
groups. For groups this is straightforward, and for machines, when one
is deleted, I wanna discuss first whether we want to delete all its
secrets as well.
2025-02-04 03:13:20 +00:00
Louis Opter
5fc9440a1e clan-cli: secrets: truly catch broken symlinks in collect_keys_for_type 2025-02-04 03:13:20 +00:00
Louis Opter
e2c6b7bffc clan-cli: secrets key generate: fix call to action message
So that it makes sense when an already existing PGP key is specified.
2025-02-04 03:13:20 +00:00
Louis Opter
26d07cf1f5 clan-cli: secrets: commit changes when group members are added or removed 2025-02-04 03:13:20 +00:00
Louis Opter
7be310062f clan-cli: honor clan.core.sops.defaultGroups option in vars fix 2025-02-04 03:13:20 +00:00
Louis Opter
66a9b22d66 clan-cli: secrets/sops: fix error message in maybe_get_admin_public_key 2025-02-04 03:13:20 +00:00
a-kenji
94362c1ff5 pkgs/clan: Fix typos 2025-02-02 23:20:39 +07:00
lassulus
18d7167fb3 test_api_dataclass_compat: exlcude flake.py 2025-02-02 11:52:36 +00:00
lassulus
02d450b905 clan-cli: add a Flake class with caching 2025-02-02 11:52:36 +00:00
lassulus
8e81cd08c8 clan-cli: add ipython to dev dependencies 2025-02-02 11:52:36 +00:00
lassulus
db417ecd13 clan-cli vars upload: add optional --directory 2025-02-02 11:52:36 +00:00
Qubasa
3acf8bbb4b clan-cli: Fix clan flakes create not working in nix shell 2025-02-01 12:16:20 +07:00
Qubasa
825b4abd37 clan-cli: Make clan machines create use templating.py 2025-01-31 18:07:48 +07:00
Qubasa
caaafdf5f9 clan-cli: Add test_clan_nix_attrset.py and minor fixups 2025-01-31 16:36:20 +07:00
Qubasa
8dd4b92a10 webview-ui: Fix create_clan js call 2025-01-30 17:26:41 +07:00
Qubasa
61762fdea3 clan-cli: Expand type_to_dict to support NewType and tuple types in dataclasses 2025-01-30 17:19:31 +07:00
Qubasa
0db5abf56a clan-cli: Make clan flakes create discover templates from inputs. Add clan flakes list command 2025-01-30 16:24:50 +07:00
Qubasa
5ceec3844a clan-cli: Add from_host function to Host class 2025-01-29 19:18:02 +07:00
Qubasa
84b8838084 clan-cli: Add ruff to devShell again. Add missing type annotations 2025-01-29 19:16:34 +07:00
Qubasa
ed6aaf5f0c clan: Add autoloaded clanModules from flake inputs. Rename 'directory' to 'self' in buildClan 2025-01-24 12:32:04 +07:00