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:
pinpox
2025-05-14 14:25:13 +00:00
5 changed files with 41 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
---
description = "Convenient Administration for the Clan App"
categories = ["Utility"]
features = [ "inventory", "deprecated" ]
---

View File

@@ -0,0 +1,3 @@
{
imports = [ ./roles/default.nix ];
}

View 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;
};
}

View File

@@ -9,6 +9,7 @@ in
# only import available files, as this allows to filter the files for tests.
flake.clanModules = filterAttrs (_name: pathExists) {
auto-upgrade = ./auto-upgrade;
admin = ./admin;
borgbackup = ./borgbackup;
borgbackup-static = ./borgbackup-static;
deltachat = ./deltachat;

View File

@@ -90,7 +90,7 @@ nav:
- reference/clanModules/index.md
- reference/clanModules/frontmatter/index.md
# 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
- reference/clanModules/borgbackup-static.md
- reference/clanModules/data-mesher.md