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" ];
21 webappName = "tools_rompr";
22 root = "/run/current-system/webapps/${webappName}";
27 Options Indexes FollowSymLinks
28 DirectoryIndex index.php
33 ErrorDocument 404 /rompr/404.php
34 AddType image/x-icon .ico
37 SetHandler "proxy:unix:${phpFpm.socket}|fcgi://localhost"
41 <Directory ${root}/albumart/small>
42 Header Set Cache-Control "max-age=0, no-store"
43 Header Set Cache-Control "no-cache, must-revalidate"
46 <Directory ${root}/albumart/asdownloaded>
47 Header Set Cache-Control "max-age=0, no-store"
48 Header Set Cache-Control "no-cache, must-revalidate"
51 <LocationMatch "^/rompr">
53 Require ldap-group cn=users,cn=mpd,ou=services,dc=immae,dc=eu
58 basedir = builtins.concatStringsSep ":" [ webRoot varDir ];
59 socket = "/var/run/phpfpm/rompr.sock";
63 group = ${apache.group}
64 listen.owner = ${apache.user}
65 listen.group = ${apache.group}
68 pm.process_idle_timeout = 60
70 ; Needed to avoid clashes in browser cookies (same domain)
71 php_value[session.name] = RomprPHPSESSID
72 php_admin_value[open_basedir] = "${basedir}:/tmp"
73 php_admin_value[session.save_path] = "${varDir}/phpSessions"
74 php_flag[magic_quotes_gpc] = Off
75 php_flag[track_vars] = On
76 php_flag[register_globals] = Off
77 php_admin_flag[allow_url_fopen] = On
78 php_value[include_path] = ${webRoot}
79 php_admin_value[upload_tmp_dir] = "${varDir}/prefs"
80 php_admin_value[post_max_size] = 32M
81 php_admin_value[upload_max_filesize] = 32M
82 php_admin_value[memory_limit] = 256M