Merge pull request 'Restore old admin module, with deprecation warning' (#3639) from admin-module-warning into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3639
This commit is contained in:
5
clanModules/admin/README.md
Normal file
5
clanModules/admin/README.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
description = "Convenient Administration for the Clan App"
|
||||||
|
categories = ["Utility"]
|
||||||
|
features = [ "inventory", "deprecated" ]
|
||||||
|
---
|
||||||
3
clanModules/admin/default.nix
Normal file
3
clanModules/admin/default.nix
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
imports = [ ./roles/default.nix ];
|
||||||
|
}
|
||||||
31
clanModules/admin/roles/default.nix
Normal file
31
clanModules/admin/roles/default.nix
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
{ lib, config, ... }:
|
||||||
|
{
|
||||||
|
|
||||||
|
options.clan.admin = {
|
||||||
|
allowedKeys = lib.mkOption {
|
||||||
|
default = { };
|
||||||
|
type = lib.types.attrsOf lib.types.str;
|
||||||
|
description = "The allowed public keys for ssh access to the admin user";
|
||||||
|
example = {
|
||||||
|
"key_1" = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD...";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
# Bad practice.
|
||||||
|
# Should we add 'clanModules' to specialArgs?
|
||||||
|
imports = [
|
||||||
|
../../sshd
|
||||||
|
../../root-password
|
||||||
|
];
|
||||||
|
config = {
|
||||||
|
|
||||||
|
warnings = [
|
||||||
|
''
|
||||||
|
The admin module has been migrated from `clan.services` to `clan.instances`
|
||||||
|
See https://docs.clan.lol/manual/distributed-services for usage.
|
||||||
|
''
|
||||||
|
];
|
||||||
|
|
||||||
|
users.users.root.openssh.authorizedKeys.keys = builtins.attrValues config.clan.admin.allowedKeys;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -9,6 +9,7 @@ in
|
|||||||
# only import available files, as this allows to filter the files for tests.
|
# only import available files, as this allows to filter the files for tests.
|
||||||
flake.clanModules = filterAttrs (_name: pathExists) {
|
flake.clanModules = filterAttrs (_name: pathExists) {
|
||||||
auto-upgrade = ./auto-upgrade;
|
auto-upgrade = ./auto-upgrade;
|
||||||
|
admin = ./admin;
|
||||||
borgbackup = ./borgbackup;
|
borgbackup = ./borgbackup;
|
||||||
borgbackup-static = ./borgbackup-static;
|
borgbackup-static = ./borgbackup-static;
|
||||||
deltachat = ./deltachat;
|
deltachat = ./deltachat;
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ nav:
|
|||||||
- reference/clanModules/index.md
|
- reference/clanModules/index.md
|
||||||
- reference/clanModules/frontmatter/index.md
|
- reference/clanModules/frontmatter/index.md
|
||||||
# TODO: display the docs of the clan.service modules
|
# TODO: display the docs of the clan.service modules
|
||||||
# - reference/clanServices/admin.md
|
- reference/clanModules/admin.md
|
||||||
# This is the module overview and should stay at the top
|
# This is the module overview and should stay at the top
|
||||||
- reference/clanModules/borgbackup-static.md
|
- reference/clanModules/borgbackup-static.md
|
||||||
- reference/clanModules/data-mesher.md
|
- reference/clanModules/data-mesher.md
|
||||||
|
|||||||
Reference in New Issue
Block a user