diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2022-05-10 15:17:55 +0200 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2022-05-10 15:18:07 +0200 |
commit | 8cd2f72926293a8bca1b42fe7bccb2b9e61740d1 (patch) | |
tree | b8242a66a6a3d9b09fe4a3a2896b5ab09aa20364 /app/cryptpad/build | |
parent | 79e61b6bfd1585d1ce318d2805b321c218cf3791 (diff) | |
download | nixcfg-8cd2f72926293a8bca1b42fe7bccb2b9e61740d1.tar.gz nixcfg-8cd2f72926293a8bca1b42fe7bccb2b9e61740d1.zip |
Working cryptpad
Diffstat (limited to 'app/cryptpad/build')
-rw-r--r-- | app/cryptpad/build/common.nix | 6 | ||||
-rw-r--r-- | app/cryptpad/build/default.nix | 21 | ||||
-rw-r--r-- | app/cryptpad/build/docker.nix | 2 |
3 files changed, 17 insertions, 12 deletions
diff --git a/app/cryptpad/build/common.nix b/app/cryptpad/build/common.nix index 980e821..957d381 100644 --- a/app/cryptpad/build/common.nix +++ b/app/cryptpad/build/common.nix @@ -1,6 +1,6 @@ rec { - cryptpadVersion = "4.14.1"; - cryptpadCommit = "5979aafdee90aab232658374b11aca8331fd0421"; + cryptpadVersion = "4.14.1+2"; + cryptpadCommit = "18c371bb5bda068a5d962dd7c4f0726320eea5e9"; pkgsSrc = fetchTarball { # Latest commit on https://github.com/NixOS/nixpkgs/tree/nixos-21.11 @@ -9,7 +9,7 @@ rec { sha256 = "sha256:1d7zg96xw4qsqh7c89pgha9wkq3rbi9as3k3d88jlxy2z0ns0cy2"; }; cryptpadSrc = builtins.fetchGit { - url = "https://github.com/xwiki-labs/cryptpad"; + url = "https://github.com/superboum/cryptpad"; ref = "refs/tags/${cryptpadVersion}"; rev = cryptpadCommit; }; diff --git a/app/cryptpad/build/default.nix b/app/cryptpad/build/default.nix index 7e31110..f0a5c00 100644 --- a/app/cryptpad/build/default.nix +++ b/app/cryptpad/build/default.nix @@ -39,30 +39,35 @@ in find node_modules -type f ! -path 'node_modules/gar/*' -executable -print | tee >(xargs -n 20 rm) # Remove only office that IS BIG - rm -rf www/common/onlyoffice + # COMMENTED as it is not as easy as planned. + # rm -rf www/common/onlyoffice ''; installPhase = '' mkdir -p $out/{bin,opt} + out_cryptpad=$out/opt/ + # copy the source code - cp -r .bowerrc bower.json package.json package-lock.json customize.dist lib server.js www $out/opt/ + cp -r .bowerrc bower.json package.json package-lock.json customize.dist lib server.js www $out_cryptpad # mount node_modules - cp -r node_modules $out/opt/node_modules + cp -r node_modules $out_cryptpad/node_modules + # patch + substituteInPlace $out_cryptpad/lib/workers/index.js --replace "lib/workers/db-worker" "$out_cryptpad/lib/workers/db-worker" # mount bower, based on the .bowerrc file at the git repo root - cp -r ${bower}/bower_components $out/opt/www/ + cp -r ${bower}/bower_components $out_cryptpad/www/ # cryptpad is bugged with absolute path, this is a workaround to use absolute path as relative path - ln -s / $out/opt/root + ln -s / $out_cryptpad/root - # start script + # start script, cryptpad is lost if its working directory is not its source directory cat > $out/bin/cryptpad <<EOF #!${pkgs.stdenv.shell} - cd $out/opt/ - ${nodejs}/bin/node server.js + cd $out_cryptpad + exec ${nodejs}/bin/node server.js EOF chmod +x $out/bin/cryptpad diff --git a/app/cryptpad/build/docker.nix b/app/cryptpad/build/docker.nix index 9ecd103..168963d 100644 --- a/app/cryptpad/build/docker.nix +++ b/app/cryptpad/build/docker.nix @@ -3,7 +3,7 @@ let pkgs = import common.pkgsSrc {}; app = import ./default.nix; in - pkgs.dockerTools.buildImage { + pkgs.dockerTools.buildLayeredImage { name = "superboum/cryptpad"; config = { Cmd = [ "${app}/bin/cryptpad" ]; |