1 { lib, env, stdenv, fetchurl, shaarli }:
3 varDir = "/var/lib/shaarli";
7 remotes = [ "eriomem" "ovh" ];
10 install -m 0755 -o ${apache.user} -g ${apache.group} -d ${varDir} \
11 ${varDir}/cache ${varDir}/pagecache ${varDir}/tmp ${varDir}/data \
14 webRoot = shaarli varDir;
18 modules = [ "proxy_fcgi" "rewrite" "env" ];
19 webappName = "tools_shaarli";
20 root = "/run/current-system/webapps/${webappName}";
21 vhostConf = socket: ''
22 Alias /Shaarli "${root}"
24 Include /var/secrets/webapps/tools-shaarli
26 DirectoryIndex index.php index.htm index.html
27 Options Indexes FollowSymLinks MultiViews Includes
31 SetHandler "proxy:unix:${socket}|fcgi://localhost"
37 dest = "webapps/tools-shaarli";
42 SetEnv SHAARLI_LDAP_PASSWORD "${env.ldap.password}"
43 SetEnv SHAARLI_LDAP_DN "${env.ldap.dn}"
44 SetEnv SHAARLI_LDAP_HOST "ldaps://${env.ldap.host}"
45 SetEnv SHAARLI_LDAP_BASE "${env.ldap.base}"
46 SetEnv SHAARLI_LDAP_FILTER "${env.ldap.filter}"
50 serviceDeps = [ "openldap.service" ];
51 basedir = builtins.concatStringsSep ":" [ webRoot varDir ];
53 "listen.owner" = apache.user;
54 "listen.group" = apache.group;
56 "pm.max_children" = "60";
57 "pm.process_idle_timeout" = "60";
59 # Needed to avoid clashes in browser cookies (same domain)
60 "php_value[session.name]" = "ShaarliPHPSESSID";
61 "php_admin_value[open_basedir]" = "${basedir}:/tmp";
62 "php_admin_value[session.save_path]" = "${varDir}/phpSessions";
63 "php_admin_value[upload_max_filesize]" = "200M";
64 "php_admin_value[post_max_size]" = "200M";