Merge pull request 'clan-cli: vars: add the owner and group options on files' (#2255) from lopter/clan-core:lo-sops-ownership into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/2255
This commit is contained in:
@@ -119,6 +119,14 @@ in
|
||||
'';
|
||||
type = str;
|
||||
};
|
||||
owner = {
|
||||
description = "The user name or id that will own the secret file. This option is currently only implemented for sops";
|
||||
default = "root";
|
||||
};
|
||||
group = {
|
||||
description = "The group name or id that will own the secret file. This option is currently only implemented for sops";
|
||||
default = "root";
|
||||
};
|
||||
value =
|
||||
{
|
||||
description = ''
|
||||
|
||||
@@ -40,6 +40,7 @@ in
|
||||
flip map vars (secret: {
|
||||
name = "vars/${secret.generator}/${secret.name}";
|
||||
value = {
|
||||
inherit (secret) owner group;
|
||||
sopsFile = secretPath secret;
|
||||
format = "binary";
|
||||
};
|
||||
|
||||
@@ -21,10 +21,11 @@ in
|
||||
flip mapAttrsToList vars.generators (
|
||||
gen_name: generator:
|
||||
flip mapAttrsToList (relevantFiles generator) (
|
||||
fname: _file: {
|
||||
fname: file: {
|
||||
name = fname;
|
||||
generator = gen_name;
|
||||
inherit (generator) share;
|
||||
inherit (file) owner group;
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
@@ -30,7 +30,10 @@ def register_parser(parser: argparse.ArgumentParser) -> None:
|
||||
import_sops_parser = subparser.add_parser("import-sops", help="import a sops file")
|
||||
register_import_sops_parser(import_sops_parser)
|
||||
|
||||
parser_key = subparser.add_parser("key", help="create and show age keys")
|
||||
parser_key = subparser.add_parser(
|
||||
"key",
|
||||
help="create, show, or update the key for the clan",
|
||||
)
|
||||
register_key_parser(parser_key)
|
||||
|
||||
register_secrets_parser(subparser)
|
||||
|
||||
Reference in New Issue
Block a user