mirror of https://gitlab.crans.org/nounous/nixos
anubis : DB pour les secrets
parent
bf059ed261
commit
9aa3a3122e
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
|
pkgs,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
|
|
@ -16,6 +17,7 @@ in
|
||||||
{
|
{
|
||||||
options.crans.anubis = {
|
options.crans.anubis = {
|
||||||
enable = mkEnableOption "Configuration d’Anubis du Crans.";
|
enable = mkEnableOption "Configuration d’Anubis du Crans.";
|
||||||
|
useRedis = mkEnableOption "Utilisation de Redis pour sauvegarder les challenges";
|
||||||
instances = mkOption {
|
instances = mkOption {
|
||||||
type = types.attrsOf (
|
type = types.attrsOf (
|
||||||
types.submodule {
|
types.submodule {
|
||||||
|
|
@ -62,6 +64,18 @@ in
|
||||||
CHALLENGE = 200;
|
CHALLENGE = 200;
|
||||||
DENY = 403;
|
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 = [
|
extraBots = [
|
||||||
{
|
{
|
||||||
|
|
@ -94,8 +108,7 @@ in
|
||||||
METRIC_BIND = "/run/anubis/anubis-${name}/metrics.sock";
|
METRIC_BIND = "/run/anubis/anubis-${name}/metrics.sock";
|
||||||
TARGET = " "; # Subrequest authentification.
|
TARGET = " "; # Subrequest authentification.
|
||||||
COOKIE_DOMAIN = conf.hostname;
|
COOKIE_DOMAIN = conf.hostname;
|
||||||
# TODO: db pour mettre en commun les token.
|
# XXX: Impossible de mettre en commun les challenges inter-sites ?
|
||||||
# Transitoirement on les sépare
|
|
||||||
COOKIE_PREFIX = "anubis-${conf.hostname}";
|
COOKIE_PREFIX = "anubis-${conf.hostname}";
|
||||||
REDIRECT_DOMAINS = conf.hostname;
|
REDIRECT_DOMAINS = conf.hostname;
|
||||||
SOCKET_MODE = "0660";
|
SOCKET_MODE = "0660";
|
||||||
|
|
@ -104,5 +117,16 @@ in
|
||||||
};
|
};
|
||||||
}) cfg.instances;
|
}) 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