1 { lib, env, stdenv, fetchurl, shaarli, config }:
3 varDir = "/var/lib/shaarli";
6 install -m 0755 -o ${apache.user} -g ${apache.group} -d ${varDir} \
7 ${varDir}/cache ${varDir}/pagecache ${varDir}/tmp ${varDir}/data \
10 webRoot = shaarli varDir;
14 modules = [ "proxy_fcgi" "rewrite" "env" ];
16 vhostConf = socket: ''
17 Alias /Shaarli "${root}"
19 Include ${config.secrets.fullPaths."webapps/tools-shaarli"}
21 Header set Access-Control-Allow-Origin "*"
22 Header set Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS"
23 Header set Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept, Authorization, Client-Security-Token, Accept-Encoding"
26 DirectoryIndex index.php index.htm index.html
27 Options Indexes FollowSymLinks MultiViews Includes
31 SetHandler "proxy:unix:${socket}|fcgi://localhost"
36 keys."webapps/tools-shaarli" = {
41 SetEnv SHAARLI_LDAP_PASSWORD "${env.ldap.password}"
42 SetEnv SHAARLI_LDAP_DN "${env.ldap.dn}"
43 SetEnv SHAARLI_LDAP_HOST "ldaps://${env.ldap.host}"
44 SetEnv SHAARLI_LDAP_BASE "${env.ldap.base}"
45 SetEnv SHAARLI_LDAP_FILTER "${env.ldap.filter}"
49 serviceDeps = [ "openldap.service" ];
50 basedir = builtins.concatStringsSep ":" [ webRoot varDir ];
52 "listen.owner" = apache.user;
53 "listen.group" = apache.group;
55 "pm.max_children" = "60";
56 "pm.process_idle_timeout" = "60";
58 # Needed to avoid clashes in browser cookies (same domain)
59 "php_value[session.name]" = "ShaarliPHPSESSID";
60 "php_admin_value[open_basedir]" = "${basedir}:/tmp";
61 "php_admin_value[session.save_path]" = "${varDir}/phpSessions";
62 "php_admin_value[upload_max_filesize]" = "200M";
63 "php_admin_value[post_max_size]" = "200M";