2024-03-28 10:52:59 +01:00
|
|
|
{ pkgs, lib, config, ... }:
|
|
|
|
let
|
|
|
|
format = pkgs.formats.php { };
|
|
|
|
cfg = config.services.pvv-nettsiden;
|
|
|
|
in {
|
|
|
|
services.pvv-nettsiden = {
|
|
|
|
enable = true;
|
2023-01-29 01:51:35 +01:00
|
|
|
|
2024-03-28 10:52:59 +01:00
|
|
|
domainName = "www2.pvv.ntnu.no";
|
|
|
|
|
|
|
|
settings = {
|
|
|
|
DOOR_SECRET = "verysecret";
|
|
|
|
|
|
|
|
DB = {
|
|
|
|
DSN = "mysql:dbname=www_data_www2;host=mysql.pvv.ntnu.no";
|
|
|
|
USER = "www-data_www2";
|
|
|
|
PASS = format.lib.mkRaw "file_get_contents('${config.sops.secrets."nettsiden/database/password".path}')";
|
|
|
|
};
|
|
|
|
|
|
|
|
SAML = {
|
|
|
|
COOKIE_SALT = "changeme";
|
|
|
|
COOKIE_SECURE = true;
|
|
|
|
ADMIN_PASSWORD = "torskefjes";
|
|
|
|
TRUSTED_DOMAINS = [ cfg.domainName ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
services.phpfpm.pools."pvv-nettsiden".settings = {
|
|
|
|
# "php_admin_value[error_log]" = "stderr";
|
|
|
|
"php_admin_flag[log_errors]" = true;
|
|
|
|
"catch_workers_output" = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
sops.secrets."nettsiden/database/password" = {
|
|
|
|
owner = config.services.phpfpm.pools.pvv-nettsiden.user;
|
|
|
|
group = config.services.phpfpm.pools.pvv-nettsiden.group;
|
|
|
|
};
|
2023-01-29 01:51:35 +01:00
|
|
|
}
|