mirror of https://gitlab.crans.org/nounous/nixos
Déclaration de dexidp
parent
951aa7e6a0
commit
754988cbfe
|
|
@ -0,0 +1,13 @@
|
||||||
|
{ ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./hardware-configuration.nix
|
||||||
|
./dexidp.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
networking.hostName = "dexidp";
|
||||||
|
boot.loader.grub.devices = [ "/dev/vda" ];
|
||||||
|
|
||||||
|
system.stateVersion = "26.05";
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,59 @@
|
||||||
|
{ ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
services.dex = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
issuer = "https://idp.crans.org/";
|
||||||
|
storage = {
|
||||||
|
type = "postgres";
|
||||||
|
config = {
|
||||||
|
host = "tealc.adm.crans.org";
|
||||||
|
database = "dexidp";
|
||||||
|
user = "dexidp";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
web.http = "127.0.0.1:8000";
|
||||||
|
oauth2 = {
|
||||||
|
responseTypes = [ "code" "token" "id_token" ];
|
||||||
|
skipApprovalScreen = false;
|
||||||
|
};
|
||||||
|
enablePasswordDB = false;
|
||||||
|
connectors = [
|
||||||
|
{
|
||||||
|
type = "ldap";
|
||||||
|
id = "ldap";
|
||||||
|
name = "Compte Cr@ns";
|
||||||
|
config = {
|
||||||
|
host = "172.16.10.157:389";
|
||||||
|
insecureNoSSL = true;
|
||||||
|
bindDN = "cn=dexidp,ou=service-users,dc=crans,dc=org";
|
||||||
|
userSearch = {
|
||||||
|
baseDN = "cn=Utilisateurs,dc=crans,dc=org";
|
||||||
|
username = "cn";
|
||||||
|
idAttr = "cn";
|
||||||
|
emailAttr = "mail";
|
||||||
|
nameAttr = "sn";
|
||||||
|
preferredUsernameAttr = "cn";
|
||||||
|
};
|
||||||
|
groupSearch = {
|
||||||
|
baseDN = "ou=posix,ou=groups,dc=crans,dc=org";
|
||||||
|
userMatchers = [
|
||||||
|
{
|
||||||
|
userAttr = "cn";
|
||||||
|
groupAttr = "memberUid";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
nameAttr = "cn";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
age.secrets.dexidp-env = {
|
||||||
|
file = ../../../secrets/dexidp/dexidp-env.age;
|
||||||
|
owner = "dex";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
{
|
||||||
|
name = "dexidp";
|
||||||
|
description = "Machine qui gère l'OIDC";
|
||||||
|
id = 999;
|
||||||
|
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
networking = {
|
||||||
|
adm.enable = true;
|
||||||
|
srv = {
|
||||||
|
enable = true;
|
||||||
|
ipv4.address = "";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
monitoring = {
|
||||||
|
nginx.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
resticClient.when = "03:27";
|
||||||
|
resticClient.enable = false;
|
||||||
|
|
||||||
|
services = {
|
||||||
|
acme.enable = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue