{ env }:
let
ympd = rec {
config = {
webPort = "localhost:${env.listenPort}";
mpd = {
host = "${env.mpd.host} --mpdpass ${env.mpd.password}";
port = env.mpd.port;
};
};
apache = {
modules = [
"proxy_wstunnel"
];
vhostConf = ''
Use LDAPConnect
Require ldap-group cn=users,cn=mpd,ou=services,dc=immae,dc=eu
RedirectMatch permanent "^/mpd$" "/mpd/"
ProxyPass http://${config.webPort}/
ProxyPassReverse http://${config.webPort}/
ProxyPreserveHost on
ProxyPass ws://${config.webPort}/ws
ProxyPass http://localhost:${env.mp3port}/
ProxyPassReverse http://localhost:${env.mp3port}/
ProxyPass http://localhost:${env.oggport}/
ProxyPassReverse http://localhost:${env.oggport}/
'';
};
};
in
ympd