mirror of https://gitlab.crans.org/nounous/nixos
anubis : DB pour les secrets
parent
bf059ed261
commit
9aa3a3122e
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
|
|
@ -16,6 +17,7 @@ in
|
|||
{
|
||||
options.crans.anubis = {
|
||||
enable = mkEnableOption "Configuration d’Anubis du Crans.";
|
||||
useRedis = mkEnableOption "Utilisation de Redis pour sauvegarder les challenges";
|
||||
instances = mkOption {
|
||||
type = types.attrsOf (
|
||||
types.submodule {
|
||||
|
|
@ -62,6 +64,18 @@ in
|
|||
CHALLENGE = 200;
|
||||
DENY = 403;
|
||||
};
|
||||
logging = {
|
||||
sink = "stdio";
|
||||
level = "WARN";
|
||||
};
|
||||
store =
|
||||
let
|
||||
redCfg = config.services.redis.servers.anubis;
|
||||
in
|
||||
{
|
||||
backend = "valkey";
|
||||
parameters.url = "redis://${redCfg.bind}:${toString redCfg.port}/0";
|
||||
};
|
||||
};
|
||||
extraBots = [
|
||||
{
|
||||
|
|
@ -94,8 +108,7 @@ in
|
|||
METRIC_BIND = "/run/anubis/anubis-${name}/metrics.sock";
|
||||
TARGET = " "; # Subrequest authentification.
|
||||
COOKIE_DOMAIN = conf.hostname;
|
||||
# TODO: db pour mettre en commun les token.
|
||||
# Transitoirement on les sépare
|
||||
# XXX: Impossible de mettre en commun les challenges inter-sites ?
|
||||
COOKIE_PREFIX = "anubis-${conf.hostname}";
|
||||
REDIRECT_DOMAINS = conf.hostname;
|
||||
SOCKET_MODE = "0660";
|
||||
|
|
@ -104,5 +117,16 @@ in
|
|||
};
|
||||
}) cfg.instances;
|
||||
};
|
||||
|
||||
services.redis = {
|
||||
# Meilleure licence que Redis
|
||||
package = pkgs.valkey;
|
||||
servers.anubis = {
|
||||
enable = true;
|
||||
bind = "127.0.0.1";
|
||||
port = 6379;
|
||||
databases = 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue