Commit Graph

56 Commits

Author SHA1 Message Date
Michael Hoang
7aa275a5b4 install: upload vars needed for activation for installation 2024-12-22 05:53:26 +00:00
lassulus
d91f653a65 vars: allow setting files as needed for activation 2024-12-19 13:05:05 +01:00
lassulus
c888f01823 vars: eval finalScript lazy 2024-12-14 13:38:51 +01:00
lassulus
3abe715472 vars: export also file owner & group to deployment.json 2024-12-05 10:29:19 +01:00
lassulus
19a251d6fc vars: add file mode 2024-12-04 23:30:39 +01:00
lassulus
4b63296d5f vars sops: passthrough neededForUsers 2024-12-03 23:54:21 +01:00
lassulus
d89ee46d7f vars password-store: add neededForUsers option 2024-12-03 22:28:39 +01:00
Jörg Thalheim
e250332f4b fix sops deprecation warning 2024-12-03 11:13:17 +01:00
lassulus
5372066e04 vars password-store: fix secretLocation again :) 2024-11-30 18:01:23 +01:00
lassulus
893892aff4 vars password-store: fix secretLocation 2024-11-30 17:24:17 +01:00
DavHau
66ce80c096 vars: rename: invalidation -> validation 2024-11-29 17:23:31 +07:00
DavHau
03bcf6bba3 vars: generate docs for cli and module 2024-11-29 17:23:31 +07:00
lassulus
748053154e vars: remove dead option 2024-11-28 16:39:01 +01:00
lassulus
af1dacc651 vars: use vars in option descriptions 2024-11-28 16:38:47 +01:00
lassulus
c00ac4a246 vars: remove secretsUploadDirectory from common module 2024-11-28 16:38:06 +01:00
Jörg Thalheim
0239770978 vars: add name to generators 2024-11-26 15:26:16 +01:00
lassulus
70a5910946 core password-store: define fileModule only if file is secret 2024-11-25 12:40:51 +01:00
lassulus
35cafe141b core password-store: set default location to not conflict with facts 2024-11-23 10:38:14 +01:00
lassulus
8ec33eb8cf core password-store: fix secret location 2024-11-22 22:34:09 +01:00
lassulus
0ef31a42df clan-cli password-store: silence move-mount output 2024-11-22 22:34:09 +01:00
DavHau
3f62e143ec 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
lassulus
8e1697a089 password-store owner & group support 2024-11-16 01:18:59 +01:00
lassulus
7ae7ac8bd1 cli vars password-store: fix file locations 2024-11-14 12:07:52 +01:00
lassulus
9f7d46a536 core vars: remove default for dirs 2024-11-13 13:23:42 +01:00
Jörg Thalheim
6bfabbb8e6 vars: use explicit lib.mkOption function
the error messages where hard to read, when I tried to add a nested
option. Let's make the code easier to understand instead of saving some
characters to type.
2024-10-31 12:10:57 +01:00
Jörg Thalheim
56bb9c4c5a vars: move owner/group to a sops namespace
we want to allow users to use this feature but do not want to use this
option in our own module because it's not supported by password store.
2024-10-31 12:10:57 +01:00
Louis Opter
f540ab91a1 vars: add the user and group options on files
This changeset forwards the ownership control options from sops-nix.
2024-10-23 09:05:53 +00:00
DavHau
501ade7de7 vars: implement migration
Migrating generated files from the facts subsystem to the vars subsystem is now possible.

HowTo:
1. declare `clan.core.vars.generators.<generator>.migrateFact = my_service` where `my_service` refers to a service from `clan.core.facts.services`
2. run `clan vers generate your_machine` or `clan machines update your_machine`

Vars will only be migrated for a generator if:
1. The facts service specified via `migrateFact` does exist
2. None of the vars to generate exist yet
3. All public var names exist in the public facts store
4. All secret var names exist in the secret fact store

If the migration is deemed possible, the generator script will not be executed. Instead the files from the public or secret facts store are read and stored into the corresponding vars store
2024-09-19 17:57:03 +02:00
DavHau
1c56ef5725 vars: allow setting a default for values 2024-09-17 21:11:38 +02:00
DavHau
53592837a9 vars: get rid of meta.json 2024-09-12 16:52:44 +02:00
DavHau
3c27cc31e9 vars/sops: load sops info from nix instead of filesystem 2024-09-12 16:30:21 +02:00
a-kenji
4d2ad709ad vars: use correct paths for value accesses
Use correct paths for value accesses of vars under:

- `per-machine`
- `shared`
2024-09-11 19:02:43 +02:00
DavHau
bd554ca392 vars: new option prompts.<name>.createFile 2024-09-04 15:48:10 +02:00
DavHau
8efcd65bed vars: global metadata paths for all store backends
This also changes the paths where sops stores teh secret -> all sops secrets will have to be re-generated
2024-09-03 16:30:01 +02:00
DavHau
ec055f7606 vars: introduce deploy=true/false for generated files 2024-09-01 14:32:46 +02:00
DavHau
1a27bfa8a8 Reapply + Fix "vars: fix - upload machines own secrets only"
This reverts commit 0cd29daf88.
2024-08-23 15:42:46 +02:00
DavHau
0cd29daf88 Revert "vars: fix - upload machines own secrets only"
This reverts commit 2a8958f494.
2024-08-21 14:59:05 +02:00
DavHau
2a8958f494 vars: fix - upload machines own secrets only 2024-08-21 14:47:41 +02:00
a-kenji
6130505177 vars: fix using vars module with multiple machines
This filters the secrets to only include the secrets managed under `per-machine` and `shared`,
otherwise new deployments will fail, when using the vars module for multiple machines:

```
[vyr] /nix/store/[…]sops-install-secrets: failed to decrypt '/nix/store/[…]/sops/vars/per-machine/draper/garage/admin_token/secret': Error getting data key: 0 successful groups required, got 0
```

This doesn't fix all the edge cases with this approach.
We get a similar error if we deploy shared vars that are not
encrypted for our machine key. This needs to be addressed when
implementing the shared vars functionality.
2024-08-17 14:00:56 +00:00
DavHau
b2646aa0fe tests: improve testing framework for impure vm tests
Also fix computet sops secret paths for vars
2024-08-04 13:40:12 +07:00
DavHau
cc9c828598 vars: introduce share flag 2024-08-03 15:26:53 +07:00
DavHau
2155675fc6 vars: fix bug when computing taarget path for sops 2024-07-29 12:09:59 +00:00
DavHau
a5065a1936 vars/sops: fix loading of vars from directory structure 2024-07-29 18:01:26 +07:00
DavHau
5bd20fcf2c vars: add support for password-store 2024-07-23 14:54:18 +07:00
DavHau
9ff076aec1 vars: implement prompts 2024-07-22 20:40:12 +07:00
DavHau
117843021e vars: implement dependencies 2024-07-17 16:42:16 +07:00
Jörg Thalheim
f8a7f0ecb1 vars: remove deprecated nixos options 2024-07-15 20:41:27 +02:00
DavHau
d21926db47 vars: implement secret generation 2024-07-11 11:37:17 +07:00
DavHau
3447a98bee vars: implement generating public variables via in_repo 2024-07-09 14:26:56 +07:00
DavHau
32f3b3a309 vars: add generator.runtimeInputs 2024-07-04 13:42:25 +07:00