aboutsummaryrefslogtreecommitdiff
path: root/nixops
diff options
context:
space:
mode:
Diffstat (limited to 'nixops')
-rw-r--r--nixops/modules/websites/tools/ether/default.nix4
-rw-r--r--nixops/modules/websites/tools/ether/etherpad-lite.json15
-rw-r--r--nixops/modules/websites/tools/ether/etherpad_lite.nix80
-rw-r--r--nixops/modules/websites/tools/ether/libreoffice_patch.diff11
4 files changed, 7 insertions, 103 deletions
diff --git a/nixops/modules/websites/tools/ether/default.nix b/nixops/modules/websites/tools/ether/default.nix
index 0d04c36..09e5c9d 100644
--- a/nixops/modules/websites/tools/ether/default.nix
+++ b/nixops/modules/websites/tools/ether/default.nix
@@ -1,7 +1,7 @@
1{ lib, pkgs, config, myconfig, mylibs, ... }: 1{ lib, pkgs, config, myconfig, mylibs, ... }:
2let 2let
3 etherpad = pkgs.callPackage ./etherpad_lite.nix { 3 etherpad = pkgs.callPackage ./etherpad_lite.nix {
4 inherit (mylibs) fetchedGithub; 4 inherit (pkgs.webapps) etherpad-lite etherpad-lite-modules;
5 env = myconfig.env.tools.etherpad-lite; 5 env = myconfig.env.tools.etherpad-lite;
6 }; 6 };
7 7
@@ -44,7 +44,7 @@ in {
44 Restart = "always"; 44 Restart = "always";
45 Type = "simple"; 45 Type = "simple";
46 TimeoutSec = 60; 46 TimeoutSec = 60;
47 ExecStartPre = "+${pkgs.coreutils}/bin/chown etherpad-lite:etherpad-lite /var/secrets/webapps/tools-etherpad /var/secrets/webapps/tools-etherpad-sessionkey /var/secrets/webapps/tools-etherpad-apikey"; 47 ExecStartPre = "+${pkgs.coreutils}/bin/chown -R etherpad-lite:etherpad-lite /var/secrets/webapps/tools-etherpad /var/secrets/webapps/tools-etherpad-sessionkey /var/secrets/webapps/tools-etherpad-apikey";
48 }; 48 };
49 }; 49 };
50 50
diff --git a/nixops/modules/websites/tools/ether/etherpad-lite.json b/nixops/modules/websites/tools/ether/etherpad-lite.json
deleted file mode 100644
index 81369c4..0000000
--- a/nixops/modules/websites/tools/ether/etherpad-lite.json
+++ /dev/null
@@ -1,15 +0,0 @@
1{
2 "tag": "1.7.0",
3 "meta": {
4 "name": "etherpad-lite",
5 "url": "https://github.com/ether/etherpad-lite",
6 "branch": "refs/tags/1.7.0"
7 },
8 "github": {
9 "owner": "ether",
10 "repo": "etherpad-lite",
11 "rev": "96ac381afb9ea731dad48968f15d77dc6488bd0d",
12 "sha256": "03k6bwlm9ch9kssy9jipfg8ij7rpbzd89xq4mvg4grg1q6ivnzk9",
13 "fetchSubmodules": true
14 }
15}
diff --git a/nixops/modules/websites/tools/ether/etherpad_lite.nix b/nixops/modules/websites/tools/ether/etherpad_lite.nix
index e67497b..35220ee 100644
--- a/nixops/modules/websites/tools/ether/etherpad_lite.nix
+++ b/nixops/modules/websites/tools/ether/etherpad_lite.nix
@@ -1,35 +1,8 @@
1{ env, fetchedGithub, fetchurl, stdenv, writeText, pkgs, cacert }: 1{ env, etherpad-lite, etherpad-lite-modules, writeText, pkgs }:
2let 2let
3 listenPort = env.listenPort; 3 listenPort = env.listenPort;
4 sessionkey = writeText "SESSIONKEY.txt" env.session_key; 4 sessionkey = writeText "SESSIONKEY.txt" env.session_key;
5 apikey = writeText "APIKEY.txt" env.api_key; 5 apikey = writeText "APIKEY.txt" env.api_key;
6 jquery = fetchurl {
7 url = https://code.jquery.com/jquery-1.9.1.js;
8 sha256 = "0h4dk67yc9d0kadqxb6b33585f3x3559p6qmp70l00qwq030vn3v";
9 };
10 etherpad_modules = [
11 "ep_aa_file_menu_toolbar"
12 "ep_adminpads"
13 "ep_align"
14 "ep_bookmark"
15 "ep_clear_formatting"
16 "ep_colors"
17 "ep_copy_paste_select_all"
18 "ep_cursortrace"
19 "ep_embedmedia"
20 "ep_font_family"
21 "ep_font_size"
22 "ep_headings2"
23 "ep_ldapauth"
24 "ep_line_height"
25 "ep_markdown"
26 "ep_previewimages"
27 "ep_ruler"
28 "ep_scrollto"
29 "ep_set_title_on_pad"
30 "ep_subscript_and_superscript"
31 "ep_timesliderdiff"
32 ];
33 keys = [ 6 keys = [
34 { 7 {
35 dest = "webapps/tools-etherpad-apikey"; 8 dest = "webapps/tools-etherpad-apikey";
@@ -146,53 +119,10 @@ let
146 ''; 119 '';
147 } 120 }
148 ]; 121 ];
149 webappDir = stdenv.mkDerivation (fetchedGithub ./etherpad-lite.json // rec { 122 webappDir = (etherpad-lite.override {
150 __noChroot = true; 123 session_key = "/var/secrets/webapps/tools-etherpad-sessionkey";
151 patches = [ ./libreoffice_patch.diff ]; 124 api_key = "/var/secrets/webapps/tools-etherpad-apikey";
152 buildPhase = '' 125 }).withModules etherpad-lite-modules;
153 export GIT_SSL_CAINFO=${cacert}/etc/ssl/certs/ca-bundle.crt
154 export SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt
155 export HOME=$PWD
156
157 touch src/.ep_initialized
158 cp -v src/static/custom/js.template src/static/custom/index.js
159 cp -v src/static/custom/js.template src/static/custom/pad.js
160 cp -v src/static/custom/js.template src/static/custom/timeslider.js
161 cp -v src/static/custom/css.template src/static/custom/index.css
162 cp -v src/static/custom/css.template src/static/custom/pad.css
163 cp -v src/static/custom/css.template src/static/custom/timeslider.css
164
165 sed -i 's/var\/dirty.db/\/var\/lib\/etherpad-lite\/dirty.db/g' \
166 settings.json.template
167
168 mkdir -v node_modules
169 ln -s ../src node_modules/ep_etherpad-lite
170
171 node bin/doc/generate doc/index.md --format=html \
172 --template=doc/template.html > documentation.html
173
174 cd src
175 npm install
176 cd ..
177 ${builtins.concatStringsSep "\n"
178 (map (n: "npm install ${n}; touch node_modules/${n}/.ep_initialized") etherpad_modules)}
179 '';
180 installPhase = ''
181 mkdir -p $out
182 install -t $out/src/ -vDm 644 src/.ep_initialized
183 cp -a node_modules $out/
184 cp -a src/* $out/src/
185 ln -sf /var/secrets/webapps/tools-etherpad-sessionkey $out/SESSIONKEY.txt
186 ln -sf /var/secrets/webapps/tools-etherpad-apikey $out/APIKEY.txt
187 cp ${jquery} $out/src/static/js/jquery.js
188
189 mkdir $out/doc
190 install -t "$out/doc/" \
191 -vDm 644 {CHANGELOG,CONTRIBUTING,README}.md \
192 -vDm 644 documentation.html
193 '';
194 buildInputs = [ pkgs.nodejs pkgs.python ];
195 });
196in 126in
197 { 127 {
198 inherit webappDir keys listenPort; 128 inherit webappDir keys listenPort;
diff --git a/nixops/modules/websites/tools/ether/libreoffice_patch.diff b/nixops/modules/websites/tools/ether/libreoffice_patch.diff
deleted file mode 100644
index d9e3dfc..0000000
--- a/nixops/modules/websites/tools/ether/libreoffice_patch.diff
+++ /dev/null
@@ -1,11 +0,0 @@
1--- a/src/node/utils/LibreOffice.js 2018-06-18 09:54:15.087161212 +0200
2+++ b/src/node/utils/LibreOffice.js 2018-06-18 10:33:27.534055021 +0200
3@@ -63,6 +63,7 @@
4 '--invisible',
5 '--nologo',
6 '--nolockcheck',
7+ '-env:UserInstallation=file:///tmp/',
8 '--convert-to', task.type,
9 task.srcFile,
10 '--outdir', tmpDir
11