aboutsummaryrefslogtreecommitdiff
path: root/nixops
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2019-05-11 01:14:51 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2019-05-11 01:14:51 +0200
commit5af8d43b9ee0543ff212e5c51fb0e750a2b83955 (patch)
tree07d979d2a30f23aa8c4bccb40343b728885f7b76 /nixops
parent742c28ad92467859fb7f54c4b8b4d09d9864a75e (diff)
downloadNix-5af8d43b9ee0543ff212e5c51fb0e750a2b83955.tar.gz
Nix-5af8d43b9ee0543ff212e5c51fb0e750a2b83955.tar.zst
Nix-5af8d43b9ee0543ff212e5c51fb0e750a2b83955.zip
Use sockets for etherpad-lite
Diffstat (limited to 'nixops')
-rw-r--r--nixops/modules/websites/tools/ether.nix11
1 files changed, 6 insertions, 5 deletions
diff --git a/nixops/modules/websites/tools/ether.nix b/nixops/modules/websites/tools/ether.nix
index 3efa363..9c78b0c 100644
--- a/nixops/modules/websites/tools/ether.nix
+++ b/nixops/modules/websites/tools/ether.nix
@@ -5,6 +5,7 @@ let
5 # Make sure we’re not rebuilding whole libreoffice just because of a 5 # Make sure we’re not rebuilding whole libreoffice just because of a
6 # dependency 6 # dependency
7 libreoffice = (import <nixpkgs> { overlays = []; }).libreoffice-fresh; 7 libreoffice = (import <nixpkgs> { overlays = []; }).libreoffice-fresh;
8 ecfg = config.services.etherpad-lite;
8in { 9in {
9 options.services.myWebsites.tools.etherpad-lite = { 10 options.services.myWebsites.tools.etherpad-lite = {
10 enable = lib.mkEnableOption "enable etherpad's website"; 11 enable = lib.mkEnableOption "enable etherpad's website";
@@ -30,8 +31,8 @@ in {
30 "title": "Etherpad", 31 "title": "Etherpad",
31 "favicon": "favicon.ico", 32 "favicon": "favicon.ico",
32 33
33 "ip": "127.0.0.1", 34 "ip": "",
34 "port" : ${env.listenPort}, 35 "port" : "${ecfg.sockets.node}",
35 "showSettingsInAdminPage" : false, 36 "showSettingsInAdminPage" : false,
36 "dbType" : "postgres", 37 "dbType" : "postgres",
37 "dbSettings" : { 38 "dbSettings" : {
@@ -154,14 +155,14 @@ in {
154 155
155 RewriteCond %{REQUEST_URI} ^/socket.io [NC] 156 RewriteCond %{REQUEST_URI} ^/socket.io [NC]
156 RewriteCond %{QUERY_STRING} transport=websocket [NC] 157 RewriteCond %{QUERY_STRING} transport=websocket [NC]
157 RewriteRule /(.*) ws://localhost:${env.listenPort}/$1 [P,L] 158 RewriteRule /(.*) unix://${ecfg.sockets.node}|ws://ether.immae.eu/$1 [P,NE,QSA,L]
158 159
159 <IfModule mod_proxy.c> 160 <IfModule mod_proxy.c>
160 ProxyVia On 161 ProxyVia On
161 ProxyRequests Off 162 ProxyRequests Off
162 ProxyPreserveHost On 163 ProxyPreserveHost On
163 ProxyPass / http://localhost:${env.listenPort}/ 164 ProxyPass / unix://${ecfg.sockets.node}|http://ether.immae.eu/
164 ProxyPassReverse / http://localhost:${env.listenPort}/ 165 ProxyPassReverse / unix://${ecfg.sockets.node}|http://ether.immae.eu/
165 <Proxy *> 166 <Proxy *>
166 Options FollowSymLinks MultiViews 167 Options FollowSymLinks MultiViews
167 AllowOverride None 168 AllowOverride None