1 { lib, env, stdenv, fetchedGithub }:
5 varDir = "/var/lib/rompr";
7 install -m 0755 -o ${apache.user} -g ${apache.group} -d ${varDir} \
8 ${varDir}/prefs ${varDir}/albumart ${varDir}/phpSessions
10 webRoot = stdenv.mkDerivation (fetchedGithub ./rompr.json // rec {
13 ln -sf ../../../../../../${varDir}/prefs $out/prefs
14 ln -sf ../../../../../../${varDir}/albumart $out/albumart
20 modules = [ "headers" "mime" "proxy_fcgi" ];
22 Alias /rompr ${webRoot}
24 <Directory ${webRoot}>
25 Options Indexes FollowSymLinks
26 DirectoryIndex index.php
31 ErrorDocument 404 /rompr/404.php
32 AddType image/x-icon .ico
35 SetHandler "proxy:unix:${phpFpm.socket}|fcgi://localhost"
39 <Directory ${webRoot}/albumart/small>
40 Header Set Cache-Control "max-age=0, no-store"
41 Header Set Cache-Control "no-cache, must-revalidate"
44 <Directory ${webRoot}/albumart/asdownloaded>
45 Header Set Cache-Control "max-age=0, no-store"
46 Header Set Cache-Control "no-cache, must-revalidate"
49 <LocationMatch "^/rompr">
51 Require ldap-group cn=users,cn=mpd,ou=services,dc=immae,dc=eu
57 basedir = builtins.concatStringsSep ":" [ webRoot varDir ];
58 socket = "/var/run/phpfpm/rompr.sock";
62 group = ${apache.group}
63 listen.owner = ${apache.user}
64 listen.group = ${apache.group}
67 pm.process_idle_timeout = 60
69 ; Needed to avoid clashes in browser cookies (same domain)
70 php_value[session.name] = RomprPHPSESSID
71 php_admin_value[open_basedir] = "${basedir}:/tmp"
72 php_admin_value[session.save_path] = "${varDir}/phpSessions"
73 php_flag[magic_quotes_gpc] = Off
74 php_flag[track_vars] = On
75 php_flag[register_globals] = Off
76 php_admin_flag[allow_url_fopen] = On
77 php_value[include_path] = ${webRoot}
78 php_admin_value[upload_tmp_dir] = "${varDir}/prefs"
79 php_admin_value[post_max_size] = 32M
80 php_admin_value[upload_max_filesize] = 32M
81 php_admin_value[memory_limit] = 256M