{ lib, php, env, writeText, phpldapadmin, config }:
rec {
keys."webapps/tools-ldap" = {
user = apache.user;
group = apache.group;
permissions = "0400";
text = ''
custom->appearance['show_clear_password'] = true;
$config->custom->appearance['hide_template_warning'] = true;
$config->custom->appearance['theme'] = "tango";
$config->custom->appearance['minimalMode'] = false;
$config->custom->appearance['tree'] = 'AJAXTree';
$servers = new Datastore();
$servers->newServer('ldap_pla');
$servers->setValue('server','name','Immae’s LDAP');
$servers->setValue('server','host','ldaps://${env.ldap.host}');
$servers->setValue('login','auth_type','cookie');
$servers->setValue('login','bind_id','${env.ldap.dn}');
$servers->setValue('login','bind_pass','${env.ldap.password}');
$servers->setValue('appearance','pla_password_hash','ssha');
$servers->setValue('login','attr','uid');
$servers->setValue('login','fallback_dn',true);
'';
};
webRoot = phpldapadmin.override { config = config.secrets.fullPaths."webapps/tools-ldap"; };
apache = rec {
user = "wwwrun";
group = "wwwrun";
modules = [ "proxy_fcgi" ];
root = "${webRoot}/htdocs";
vhostConf = socket: ''
Alias /ldap "${root}"