diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2023-10-04 01:35:06 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2023-10-04 02:11:48 +0200 |
commit | 1a64deeb894dc95e2645a75771732c6cc53a79ad (patch) | |
tree | 1b9df4838f894577a09b9b260151756272efeb53 /systems/eldiron/websites/tools/ympd.nix | |
parent | fa25ffd4583cc362075cd5e1b4130f33306103f0 (diff) | |
download | Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.tar.gz Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.tar.zst Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.zip |
Squash changes containing private information
There were a lot of changes since the previous commit, but a lot of them
contained personnal information about users. All thos changes got
stashed into a single commit (history is kept in a different place) and
private information was moved in a separate private repository
Diffstat (limited to 'systems/eldiron/websites/tools/ympd.nix')
-rw-r--r-- | systems/eldiron/websites/tools/ympd.nix | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/systems/eldiron/websites/tools/ympd.nix b/systems/eldiron/websites/tools/ympd.nix new file mode 100644 index 0000000..0d8d41d --- /dev/null +++ b/systems/eldiron/websites/tools/ympd.nix | |||
@@ -0,0 +1,54 @@ | |||
1 | { env, config }: | ||
2 | let | ||
3 | ympd = rec { | ||
4 | config = { | ||
5 | webPort = "localhost:${toString env.listenPort}"; | ||
6 | host = env.mpd.host; | ||
7 | port = env.mpd.port; | ||
8 | }; | ||
9 | apache = { | ||
10 | modules = [ | ||
11 | "proxy_wstunnel" | ||
12 | ]; | ||
13 | vhostConf = '' | ||
14 | <LocationMatch "^/mpd(?!/music.(mp3|ogg))"> | ||
15 | Use LDAPConnect | ||
16 | Require ldap-group cn=users,cn=mpd,ou=services,dc=immae,dc=eu | ||
17 | </LocationMatch> | ||
18 | |||
19 | RedirectMatch permanent "^/mpd$" "/mpd/" | ||
20 | <Location "/mpd/"> | ||
21 | ProxyPass http://${config.webPort}/ | ||
22 | ProxyPassReverse http://${config.webPort}/ | ||
23 | ProxyPreserveHost on | ||
24 | </Location> | ||
25 | <Location "/mpd/ws"> | ||
26 | ProxyPass ws://${config.webPort}/ws | ||
27 | </Location> | ||
28 | <Location "/mpd/music.mp3"> | ||
29 | ProxyPass unix:///run/mpd/mp3.sock|http://tools.immae.eu/mpd/mp3 | ||
30 | ProxyPassReverse unix:///run/mpd/mp3.sock|http://tools.immae.eu/mpd/mp3 | ||
31 | </Location> | ||
32 | <Location "/mpd/music.ogg"> | ||
33 | ProxyPass unix:///run/mpd/ogg.sock|http://tools.immae.eu/mpd/ogg | ||
34 | ProxyPassReverse unix:///run/mpd/ogg.sock|http://tools.immae.eu/mpd/ogg | ||
35 | </Location> | ||
36 | ''; | ||
37 | }; | ||
38 | }; | ||
39 | in | ||
40 | ympd // { | ||
41 | monitoringPlugins = [ "http" ]; | ||
42 | monitoringObjects.service = [ | ||
43 | { | ||
44 | service_description = "mpd website is running on tools.immae.eu"; | ||
45 | host_name = config.hostEnv.fqdn; | ||
46 | use = "external-web-service"; | ||
47 | check_command = ["check_https_auth" "tools.immae.eu" "/mpd/" "<title>ympd"]; | ||
48 | |||
49 | servicegroups = "webstatus-webapps"; | ||
50 | _webstatus_name = "MPD (YMPD)"; | ||
51 | _webstatus_url = "https://tools.immae.eu/mpd/"; | ||
52 | } | ||
53 | ]; | ||
54 | } | ||