Commit Graph

684 Commits

Author SHA1 Message Date
Juanjo Presa
c7cee905d1 vars: respect deploy flag for shared secrets 2025-10-18 23:09:31 +02:00
Luis Hebendanz
9821e39b06 Merge pull request 'clanServices: add warning if manifest.readme is not set' (#5537) from Qubasa/clan-core:fix_manifest_readmes into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5537
2025-10-16 17:12:46 +00:00
Qubasa
2ac65b9c83 clan_lib/modules.py: get_service_readmes now logs an error if the readme is empty 2025-10-16 19:07:49 +02:00
Johannes Kirschbauer
17c35c4259 persistence: align some more variable names 2025-10-16 13:04:24 +02:00
Johannes Kirschbauer
727474055e persistence: invert all writeability logic into not readonly 2025-10-16 13:01:34 +02:00
Johannes Kirschbauer
892cb1baae inventoryStore: invert writeability terms to readonly 2025-10-16 13:00:21 +02:00
Johannes Kirschbauer
5eb6b703f0 inventoryStore: align class names and methods 2025-10-16 12:50:54 +02:00
Johannes Kirschbauer
d78dca47e2 modules: update service test 2025-10-16 12:42:49 +02:00
Johannes Kirschbauer
8254d197f0 api: persistence allow path prefix 2025-10-16 12:42:45 +02:00
Johannes Kirschbauer
a4839f9cf2 api: persistence, fix regressions 2025-10-16 11:57:38 +02:00
Johannes Kirschbauer
a32a5151dc api: remove unused validation method 2025-10-15 16:19:21 +02:00
Johannes Kirschbauer
16d245b179 api: check deletions if possible 2025-10-15 16:15:54 +02:00
Qubasa
867fa5140b clan_lib: Add get_service_readmes api function
Returns the README.md for one or multiple clan services, needed for the
clan ai feature
2025-10-14 18:54:22 +02:00
Qubasa
2b616575e1 service_runner: Fix starting a service twice 2025-10-14 17:32:21 +02:00
Qubasa
3f07f6ac79 service_runner: add grouping feature 2025-10-14 17:32:21 +02:00
Qubasa
c6b0b114c5 clan_lib: init platform independent service_runner 2025-10-14 17:31:37 +02:00
hsjobeki
8803343ae1 Merge pull request 'persistence: generate properties for data by traversing data' (#5502) from persistence_attributes into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5502
2025-10-14 15:27:10 +00:00
Johannes Kirschbauer
8609538756 clan_lib: allow explicit readonly access to inventory attributes 2025-10-14 17:21:39 +02:00
pinpox
42e3fea9e5 clanServices: add desktop module 2025-10-14 16:02:20 +02:00
Johannes Kirschbauer
0c245f8eda persistence: generate properties for data by traversing data 2025-10-14 14:51:06 +02:00
Qubasa
23008d1f73 openapi: Add a test for TypeAliasing 2025-10-14 12:06:04 +02:00
Qubasa
f1747079c8 clan_cli: Add typeAlias support for api.py 2025-10-14 11:30:48 +02:00
hsjobeki
d9f6b7e3fb Merge pull request 'api: prepare persistence_attributes' (#5453) from persistence_attributes into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5453
2025-10-13 15:23:03 +00:00
Johannes Kirschbauer
40de60946a api: migrate to use persistence attributes everywhere 2025-10-13 17:04:01 +02:00
Michael Hoang
46f746d09c cli: fix installation test with latest release of nixos-anywhere 2025-10-13 15:06:20 +02:00
DavHau
bf41a9ef00 vars/sops: stop writing on clan vars check
This fixes an issue where check_vars() would add machine keys or authorize machines for shared vars.

These write operations should only ever be done on a `clan vars generate`, which `clan vars check` should be a read-only operation
2025-10-13 18:43:49 +07:00
Johannes Kirschbauer
63fdc13928 persist: add attributes props to accumulator 2025-10-12 17:45:14 +02:00
Johannes Kirschbauer
c13879ce69 persist: rename write map to attribute map 2025-10-12 17:45:14 +02:00
Johannes Kirschbauer
f57bc30c5a persist/writeability: rename non_writeable to readonly 2025-10-12 17:45:14 +02:00
Michael Hoang
bc09d5c886 cli: ensure init-hardware-config passes Nix options to nixos-anywhere 2025-10-10 17:00:10 +02:00
DavHau
fd5d7934a0 vars: refactor - make shared generators carry machines list
This should make it simpler to improve the implementation of granting a new machine access to a shared secret.
The current approach using the health_check is  pretty hacky
2025-10-09 15:41:04 +07:00
DavHau
744f35e0cc vars: cleanup + fix wording 2025-10-09 07:38:00 +02:00
DavHau
da6cd324f0 Merge pull request 'vars/performance: aggregate selects over all machines and generators' (#5402) from dave into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5402
2025-10-08 06:04:50 +00:00
DavHau
c5b96df7b0 vars/performance: aggregate selects over all machines and generators
This improves the performance of deployment, by aggregating uncached select calls for vars generate into two batches.
batch 1: Get all generators of all machines
batch 2: get all final scripts for generators which need to run
2025-10-08 13:00:20 +07:00
Jörg Thalheim
204f9d09e3 network: refactor get_best_remote to class-based context manager
Resolves the "RuntimeError: generator didn't stop after throw()" issue
by replacing the generator-based @contextmanager with an explicit class.

This maintains backward compatibility through a factory function.
2025-10-07 13:05:20 +02:00
Jörg Thalheim
10ed2cc7f7 sops: don't leak secret key in debug logs 2025-10-07 11:31:12 +02:00
DavHau
43b1744528 tests: disable state-version generation in all python tests
This improves the performance of tests, as there are less vars operations to perform.
2025-10-06 17:08:42 +07:00
Qubasa
b56230e3a7 clan_lib: Add clan_module_to_llm_function for ai integration 2025-10-03 12:32:33 +02:00
Qubasa
2df96d3a9b inventory: Add roles.<name>.description option and a warning if it is not set 2025-10-02 18:57:55 +02:00
DavHau
393323ba91 Merge pull request 'vars: optimize generate - reduce cache misses' (#5348) from dave into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5348
2025-10-02 11:50:26 +00:00
DavHau
5a6ffbf916 vars: optimize generate - reduce cache misses
optimize the `clan vars generate` procedure by pre-caching more selectors.

To achieve this, helper functions are added to several classes.

Also a debugging feature is added to the Flake class in order to track stack traces of cache misses
2025-10-02 18:46:11 +07:00
a-kenji
df3fdf3758 pkgs/lib/git: List all files that are committed 2025-10-01 12:24:33 +02:00
a-kenji
08e2048eeb pkgs/lib: verbose git commits
Make sure the user knowns that a git command is run.

From the issue #4588:
> It is confusing at times, when executing some CLI command, expecting change,
then checking git status but no changes are observed.

We now log:
- git add (debug)
- git commit (info)

The git commit information is formatted the following way:
```
Committed machines/backup-target to git
```

Alternatives:
Currently this shows to the user what happened.
But we might want to show the user what is being run.
We could print the information before invoking the `git commit` itself.
Informing the user of a potential password input window.

Closes #4588
2025-10-01 11:46:01 +02:00
DavHau
b72145d4aa vars/list: reduce cache misses to 1
This improves the performance for clan vars list
2025-10-01 12:43:09 +07:00
Michael Hoang
51bf7c8848 cli: support machines init-hardware-config --debug 2025-09-25 22:10:01 +02:00
hsjobeki
becb32a947 Merge pull request 'lib/introspect: use valueMeta to expose more information' (#5262) from update-service into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5262
2025-09-24 16:38:14 +00:00
Johannes Kirschbauer
bcadf6b0fb clan_lib: write_rules complete internal keys 2025-09-24 18:34:09 +02:00
Johannes Kirschbauer
75121767d3 lib/introspect: use valueMeta to expose more information 2025-09-24 17:24:44 +02:00
Luis Hebendanz
8da25d5295 Merge pull request 'hardware-update-split' (#5261) from Qubasa/clan-core:hardware-update-split into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5261
2025-09-24 14:54:32 +00:00
Qubasa
ed069c48d3 clan-cli: rename to init-hardware-config 2025-09-24 16:51:06 +02:00