diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-02-11 00:16:15 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-02-11 00:16:15 +0100 |
commit | e229e6f2a411b9c03ee80bfb53b6b77e8f2ccb0b (patch) | |
tree | 5048061078e8e2e31930a93dbf53899e88958597 /nixops/modules/websites/tools/tools/ympd.nix | |
parent | 0a03d9d7b89f101ac889e13b622cfa86705da20f (diff) | |
download | Nix-e229e6f2a411b9c03ee80bfb53b6b77e8f2ccb0b.tar.gz Nix-e229e6f2a411b9c03ee80bfb53b6b77e8f2ccb0b.tar.zst Nix-e229e6f2a411b9c03ee80bfb53b6b77e8f2ccb0b.zip |
Add mpd and make adjustments
Diffstat (limited to 'nixops/modules/websites/tools/tools/ympd.nix')
-rw-r--r-- | nixops/modules/websites/tools/tools/ympd.nix | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/nixops/modules/websites/tools/tools/ympd.nix b/nixops/modules/websites/tools/tools/ympd.nix index 3d0faad..613a171 100644 --- a/nixops/modules/websites/tools/tools/ympd.nix +++ b/nixops/modules/websites/tools/tools/ympd.nix | |||
@@ -3,14 +3,17 @@ let | |||
3 | ympd = rec { | 3 | ympd = rec { |
4 | config = { | 4 | config = { |
5 | webPort = "localhost:${env.listenPort}"; | 5 | webPort = "localhost:${env.listenPort}"; |
6 | mpd = env.mpd; | 6 | mpd = { |
7 | host = "${env.mpd.host} --mpdpass ${env.mpd.password}"; | ||
8 | port = env.mpd.port; | ||
9 | }; | ||
7 | }; | 10 | }; |
8 | apache = { | 11 | apache = { |
9 | modules = [ | 12 | modules = [ |
10 | "proxy_wstunnel" | 13 | "proxy_wstunnel" |
11 | ]; | 14 | ]; |
12 | vhostConf = '' | 15 | vhostConf = '' |
13 | <LocationMatch "^/mpd"> | 16 | <LocationMatch "^/mpd(?!/music.(mp3|ogg))"> |
14 | Use LDAPConnect | 17 | Use LDAPConnect |
15 | Require ldap-group cn=users,cn=mpd,ou=services,dc=immae,dc=eu | 18 | Require ldap-group cn=users,cn=mpd,ou=services,dc=immae,dc=eu |
16 | </LocationMatch> | 19 | </LocationMatch> |
@@ -24,6 +27,14 @@ let | |||
24 | <Location "/mpd/ws"> | 27 | <Location "/mpd/ws"> |
25 | ProxyPass ws://${config.webPort}/ws | 28 | ProxyPass ws://${config.webPort}/ws |
26 | </Location> | 29 | </Location> |
30 | <Location "/mpd/music.mp3"> | ||
31 | ProxyPass http://localhost:${env.mp3port}/ | ||
32 | ProxyPassReverse http://localhost:${env.mp3port}/ | ||
33 | </Location> | ||
34 | <Location "/mpd/music.ogg"> | ||
35 | ProxyPass http://localhost:${env.oggport}/ | ||
36 | ProxyPassReverse http://localhost:${env.oggport}/ | ||
37 | </Location> | ||
27 | ''; | 38 | ''; |
28 | }; | 39 | }; |
29 | }; | 40 | }; |