Commit Graph

2940 Commits

Author SHA1 Message Date
Mic92
45b2539455 Merge pull request 'Flake: remove unused variable and mark other fields as non-init' (#3535) from cleanup-flake into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3535
2025-05-07 13:20:10 +00:00
Jörg Thalheim
f3a6fe8870 Flake: remove unused variable and mark other fields as non-init 2025-05-07 14:40:22 +02:00
Qubasa
a6a69bb09b clan-cli: Refactor the API to use the Flake object 2025-05-07 13:12:48 +02:00
DavHau
18e75c9954 GUI: initialize support for vars prompts
... for now only when updating a machine (not when installing)

Whenever the user clicks on the update button in the machine view, and only if user input is needed for some missing vars, the user will be forwarded to a vars page.
2025-05-07 18:06:35 +07:00
Johannes Kirschbauer
f0d42c839b Refactor(machine/class): use frozen dataclass for class 'machine' 2025-05-06 17:12:52 +02:00
Johannes Kirschbauer
79a54616e5 Refactor(machine/install): don't mutate the machine class during installation 2025-05-06 17:09:37 +02:00
Johannes Kirschbauer
d8883db24d Refactor(machine/update): cleanup dataflow and logic conditions to be intuitive 2025-05-06 16:49:32 +02:00
Mic92
ec5c87c47c Merge pull request 'Host: actual setup ssh controlmaster' (#3515) from fix-control-master into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3515
2025-05-06 11:21:05 +00:00
Jörg Thalheim
f3c673d165 only apply ssh control master to local ssh connection 2025-05-06 13:11:30 +02:00
Jörg Thalheim
5846f5d63a Host: actual setup ssh controlmaster
before we were not entering the context manager
2025-05-06 13:11:30 +02:00
Johannes Kirschbauer
19dbab01d7 chore(API): cleanup remove unnused functions 2025-05-06 12:29:11 +02:00
Jörg Thalheim
28227e8b0a fix build_host set if it doesn't exist 2025-05-06 09:56:58 +02:00
Mic92
1d1b7c73b5 Merge pull request 'fix incorrect target host when build host is set' (#3511) from ssh-foo into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3511
2025-05-06 07:54:40 +00:00
Jörg Thalheim
e8d2ae2d7e fix incorrect target host when build host is set 2025-05-06 09:54:08 +02:00
Jörg Thalheim
19947c6d6b fix incorrect target host when build host is set 2025-05-06 09:26:59 +02:00
Luis Hebendanz
a887e26fef Merge pull request 'clan-cli: fix bubblewrap not finding bash when IN_NIX_SANDBOX=1 if prev environment doesn't have it in PATH' (#3503) from Qubasa/clan-core:fix_bubblewrap_bash_path into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3503
2025-05-05 21:07:22 +00:00
Luis Hebendanz
d55e70506d Merge pull request 'clan-cli: add test_create in clan_lib test folder' (#3501) from Qubasa/clan-core:api_vm_test into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3501
2025-05-05 20:29:57 +00:00
Qubasa
073304ec6b clan-cli: fix bubblewrap not finding bash when IN_NIX_SANDBOX=1 if prev environment doesn't have it in PATH 2025-05-05 22:19:17 +02:00
hsjobeki
f6b0b5ada5 Merge pull request 'API(cli): add method to Flake class to allow calling nix functions' (#3502) from hsjobeki/clan-core:improvements-2 into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3502
2025-05-05 20:16:28 +00:00
Qubasa
b90812ecce clan-cli: add test_create in clan_lib test folder 2025-05-05 22:16:02 +02:00
Johannes Kirschbauer
dfa5a228e8 feat(clanLib): init evalServiceSchema 2025-05-05 21:55:29 +02:00
Johannes Kirschbauer
750cca1991 API(cli): add method to Flake class to allow calling nix functions 2025-05-05 21:46:20 +02:00
DavHau
23d19f1a52 vars: improve API of generate_vars_for_machine
receive list of generator names as an argument instead of generator objects
2025-05-05 15:55:04 +07:00
Jörg Thalheim
be79d75c08 bind ssh controlmaster to live time of CLI 2025-05-04 16:28:14 +02:00
Jörg Thalheim
dc4268dbf2 fix ssh control master check (#3488)
Co-authored-by: pinpox <git@pablo.tools>
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3488
Co-authored-by: Jörg Thalheim <joerg@thalheim.io>
Co-committed-by: Jörg Thalheim <joerg@thalheim.io>
2025-05-04 12:49:53 +00:00
Jörg Thalheim
9af16037a2 Revert "Merge pull request 'Fix deploying with sudo + password' (#3470) from target-host into main"
This reverts commit fbc0f9cde5, reversing
changes made to b47c25c620.
2025-05-04 13:37:39 +02:00
Jörg Thalheim
f640beaec5 tests_secrets_cli: improve assertion message for pgp key 2025-05-04 10:51:49 +02:00
Jörg Thalheim
bd53342e50 fix terminal output when terminal is put into interactive mode 2025-05-04 10:51:49 +02:00
Jörg Thalheim
28c06bbdc1 update: fix sudo password prompt 2025-05-04 10:51:49 +02:00
Jörg Thalheim
39880f9434 fix upload when sudo prompts are needed 2025-05-04 10:51:49 +02:00
Mic92
b47c25c620 Merge pull request 'Miscellaneous ssh fixes.' (#3487) from misc-fixes into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3487
2025-05-04 08:51:31 +00:00
Jörg Thalheim
7079e7f538 cmd: don't shadow time module 2025-05-04 10:39:50 +02:00
Jörg Thalheim
fb4421427b Host: always set needs_user_terminal for ssh commands, only override prefix if given by user 2025-05-04 10:39:39 +02:00
Jörg Thalheim
ef07a5b217 run_local: allow stdin to be a file descriptor 2025-05-04 10:39:28 +02:00
Jörg Thalheim
d98c01bc3a update_hardware_config: use host.run rather than adhoc ssh command 2025-05-04 10:30:46 +02:00
Jörg Thalheim
35ee7986d7 rename connect_ssh_shell to interactive_ssh
better name than secure shell shell
2025-05-04 10:28:43 +02:00
Jörg Thalheim
75cb031e6e move password/tor_socks into Host attributes
we set those parameters usually just once.
2025-05-04 10:28:43 +02:00
Jörg Thalheim
2f32e5bde2 configure ControlMaster and ControlPath for SSH connections
This should speed up deployments by not having to reconnect to the server on each command
2025-05-04 09:48:37 +02:00
Jörg Thalheim
f86c874ac8 facts/sops: no longer upload age key
The vars backend already does this for us.
This avoids duplicated work.
2025-05-04 09:29:29 +02:00
Mic92
376ab40c4b Merge pull request 'chore(deps): update nixpkgs digest to f21e454' (#3445) from renovate/nixpkgs-digest into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3445
2025-05-04 07:16:50 +00:00
Mic92
655c7e4eed Merge pull request 'Avoid a few cases of chmod-after-creation' (#3438) from tangential/clan-core:it-s_a_race into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3438
2025-05-04 07:08:43 +00:00
Jörg Thalheim
ee8921273a disable age-plugin-se for now on aarch64-linuxql
disable
2025-05-04 09:07:06 +02:00
Mic92
08a5ad0848 Merge pull request 'clanCore/vars/sops: only copy required secrets to store' (#3457) from vdbe/clan-core:clanCore/vars/sops/only-copy-used into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3457
2025-05-04 06:41:37 +00:00
vdbe
f3e32ce827 clanCore/vars/sops: only copy required secrets to store
Create a store path per in repo secret/var to be copied, this prevents
unused secrets from being leaked.

For example the `root-password` generator contains both the hashed and
unhashed password but only the hash is used.
2025-05-04 08:08:58 +02:00
Mic92
dcb3eb95dc Merge pull request 'Set terminal on nix flake update/archive' (#3468) from fix-shell-on-copy into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3468
2025-05-04 05:59:58 +00:00
DavHau
890eb3a882 GUI/devshell: hot reload python API
This change speeds up the development workflow on the GUI when modifying the python api

The GUI started from the devshell already hot reloads itself on any change of the typescript codebase.

But python api changes were not caught bu the hot reload and required a reload of the devshell which is slow.

This change implements a custom vite plugin to also listen to changes coming from the clan-cli python code and re-generate the python-ts api on any change.
2025-05-03 19:22:16 +07:00
DavHau
71cdbc989c GUI/vars: add endpoints for getting prompts and generating vars 2025-05-03 14:44:51 +07:00
DavHau
6e9382b942 refactor(vars): move migration logic to extra file 2025-05-03 07:33:11 +00:00
DavHau
b9a20ef6a5 GUI: generate sops key when creating clan 2025-05-03 13:00:27 +07:00
pinpox
938dc5b155 Set terminal on nix flake update/archive
When using resident SSH-keys (-sk), e.g. from a Yubikey that require a
Pin, a terminal is needed to be able to enter it during deployment.
2025-05-02 15:41:29 +02:00