Commit Graph

20 Commits

Author SHA1 Message Date
DavHau
37a49a14f4 vars: fix re-generate behavior for dependencies of shared vars (#5001)
fixes https://git.clan.lol/clan/clan-core/issues/3791

This fixes multiple issues we had when re-generating shared vars.

Problem 1: shared vars are re-generated for each individual machine instead of just once (see #3791)

Problem 2: When a shared var was re-generated for one machine, dependent vars on other machines did not get re-generated, leading to broken state

Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5001
2025-09-02 14:54:24 +00:00
Jörg Thalheim
db5571d623 SIM108: fix 2025-08-26 15:23:36 +02:00
DavHau
c308fd63a7 vars: delete old var when changing share
When changing a password from non-shared to shared, we want to remove the old one
2025-08-25 10:37:46 +00:00
DavHau
7b61a668e9 vars: refactor: use Machine objects instead of base_dir strings
Replace base_dir string parameters with Machine objects throughout the vars
module for better type safety and consistency.
2025-08-20 11:59:18 +07:00
Johannes Kirschbauer
4312e3fc2f vars: move generator class and bound methods into seperate module 2025-08-14 11:05:42 +02:00
a-kenji
cd8a1d9a32 pkgs/cli: Autocomplete various vars subcommands
Add autocomplete for `vars` for the following subcommands:

```
clan vars get [machine] [var_id]
clan vars set [machine] [var_id]
```
2025-07-22 18:03:55 +02:00
Johannes Kirschbauer
ad48771c98 vars/api: rename, unregister some unused vars functions 2025-07-06 20:57:42 +02:00
Qubasa
8b1968cca6 clan-cli: Move Machine object to clan_lib 2025-05-22 19:11:19 +02:00
lassulus
f2bf142e80 clan-cli: clan_cli.git -> clan_lib.git 2025-05-20 14:35:14 +02:00
lassulus
fa052f45bd clan_lib: move clan_lib.flake.flake to clan_lib.flake 2025-05-16 19:28:36 +02:00
lassulus
5423b9af41 clan_cli: move flake class to clan_lib 2025-05-16 13:38:47 +02:00
Jörg Thalheim
75fa7ac609 add multiline-hidden prompt for both ui and cli 2025-05-14 19:53:36 +02:00
lassulus
2a8f40e91a clan_cli machines: use Flake instead of FlakeId 2025-02-07 06:26:09 +01:00
Johannes Kirschbauer
06869a4d27 API/vars: use string based interfaces to get and set vars to avoid state mutations 2025-01-10 12:06:01 +00:00
DavHau
b64422679e vars: commit files for clan vars set
fixes #2601
2024-12-17 15:56:08 +07:00
Jörg Thalheim
c9e80f38ca vars: make interface more type-safe 2024-11-26 17:08:26 +01:00
DavHau
01c833f2bc vars/generate: improve output when vars are updated
fixes #2076

- print old and new value if possible
- also inform the user if something hasn't changed
2024-09-18 16:57:01 +02:00
DavHau
6bb93d087c vars: refactor - ask prompts before running any generators 2024-09-06 16:08:46 +02:00
DavHau
a57525d5c6 vars: add api endpoint set_prompts 2024-09-04 18:06:11 +02:00
DavHau
3f23ad4f79 vars: set vars via cli; improve getting vars via cli; 2024-09-04 14:48:42 +02:00