Commit Graph

117 Commits

Author SHA1 Message Date
Jörg Thalheim
fb217cc4b2 remove flip functions from sops code 2025-01-15 13:59:49 +00:00
Johannes Kirschbauer
31a1fe887e Vars: interface improve docs formatting 2025-01-14 17:40:57 +01:00
clan-bot
2a7ff6c1d5 Merge pull request 'vars in_repo: throw as a default so we can catch it with tryEval' (#2745) from lassulus/clan-core:throw_inrepo into main 2025-01-14 14:58:20 +00:00
lassulus
b25fe641d2 vars in_repo: throw as a default so we can catch it with tryEval 2025-01-14 15:53:54 +01:00
Jörg Thalheim
9b885f54af matrix-synapse: migrate to vars 2025-01-14 14:16:19 +00:00
lassulus
cc99a23ac2 pass move-mount-beneath: add more debug info 2025-01-12 11:17:22 +01:00
DavHau
4a9ae3a45f vars: rename createFile -> persist 2025-01-11 04:19:46 +00:00
Johannes Kirschbauer
d46ffe9f4a Chore:_migrate 'machineName' to 'settings.machine.name' 2024-12-31 14:55:50 +01:00
Johannes Kirschbauer
315be52e34 Chore: init settings submdule, move clanDir into settings submodule 2024-12-31 14:18:09 +01:00
lassulus
8790b2163a vars password-store: fix usage with newer vars 2024-12-25 22:09:52 +01:00
Jörg Thalheim
21ecbfc673 vars: simplify validationHash type for better error messages 2024-12-25 19:21:51 +00:00
Michael Hoang
1d7e0c1c02 install: upload vars needed for activation for installation 2024-12-22 05:53:26 +00:00
lassulus
70ff7fcc2f vars: allow setting files as needed for activation 2024-12-19 13:05:05 +01:00
lassulus
9cc3bdbc9f vars: eval finalScript lazy 2024-12-14 13:38:51 +01:00
lassulus
e9efe2f0d1 vars: export also file owner & group to deployment.json 2024-12-05 10:29:19 +01:00
lassulus
82fb1edc37 vars: add file mode 2024-12-04 23:30:39 +01:00
lassulus
b381a71266 vars sops: passthrough neededForUsers 2024-12-03 23:54:21 +01:00
lassulus
e6eaa3cc03 vars password-store: add neededForUsers option 2024-12-03 22:28:39 +01:00
Jörg Thalheim
d3babc9d69 fix sops deprecation warning 2024-12-03 11:13:17 +01:00
lassulus
8d31a710fe vars password-store: fix secretLocation again :) 2024-11-30 18:01:23 +01:00
lassulus
0afa050ca2 vars password-store: fix secretLocation 2024-11-30 17:24:17 +01:00
DavHau
5c5a87d416 vars: rename: invalidation -> validation 2024-11-29 17:23:31 +07:00
DavHau
fbbfcc0aa5 vars: generate docs for cli and module 2024-11-29 17:23:31 +07:00
lassulus
cdfcc42107 vars: remove dead option 2024-11-28 16:39:01 +01:00
lassulus
0e4f967dad vars: use vars in option descriptions 2024-11-28 16:38:47 +01:00
lassulus
8337a3ec41 vars: remove secretsUploadDirectory from common module 2024-11-28 16:38:06 +01:00
Jörg Thalheim
cd2ea0d735 vars: add name to generators 2024-11-26 15:26:16 +01:00
lassulus
aee27ba441 core password-store: define fileModule only if file is secret 2024-11-25 12:40:51 +01:00
lassulus
448e04a4ef core password-store: set default location to not conflict with facts 2024-11-23 10:38:14 +01:00
lassulus
fe4bf1c815 core password-store: fix secret location 2024-11-22 22:34:09 +01:00
lassulus
53f78d7959 clan-cli password-store: silence move-mount output 2024-11-22 22:34:09 +01:00
DavHau
d4c8b2e4ed 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
8f0c575425 password-store owner & group support 2024-11-16 01:18:59 +01:00
lassulus
faf0946c99 cli vars password-store: fix file locations 2024-11-14 12:07:52 +01:00
lassulus
2c66b36931 core vars: remove default for dirs 2024-11-13 13:23:42 +01:00
Jörg Thalheim
0a844097db 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
0842b05687 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
4effc0c50e 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
0a8b7f38a8 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
6fc27d402b vars: allow setting a default for values 2024-09-17 21:11:38 +02:00
DavHau
85477d51f6 vars: get rid of meta.json 2024-09-12 16:52:44 +02:00
DavHau
e905407989 vars/sops: load sops info from nix instead of filesystem 2024-09-12 16:30:21 +02:00
a-kenji
6dd1a7395f 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
dc4fcb7329 vars: new option prompts.<name>.createFile 2024-09-04 15:48:10 +02:00
DavHau
924f5e41c6 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
62ccd0ed4b vars: introduce deploy=true/false for generated files 2024-09-01 14:32:46 +02:00
DavHau
f0a3eaca96 Reapply + Fix "vars: fix - upload machines own secrets only"
This reverts commit cb860f9a03.
2024-08-23 15:42:46 +02:00
DavHau
cb860f9a03 Revert "vars: fix - upload machines own secrets only"
This reverts commit 8d61b03f8d.
2024-08-21 14:59:05 +02:00
DavHau
8d61b03f8d vars: fix - upload machines own secrets only 2024-08-21 14:47:41 +02:00
a-kenji
63b5417c3d 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