diff options
Diffstat (limited to 'cluster/prod/app/cryptpad')
-rw-r--r-- | cluster/prod/app/cryptpad/build/README.md | 20 | ||||
-rw-r--r-- | cluster/prod/app/cryptpad/build/default.nix | 6 | ||||
-rw-r--r-- | cluster/prod/app/cryptpad/build/npins/sources.json | 4 | ||||
-rw-r--r-- | cluster/prod/app/cryptpad/build_docker/README.md | 4 | ||||
-rw-r--r-- | cluster/prod/app/cryptpad/deploy/cryptpad-debug.hcl | 80 | ||||
-rw-r--r-- | cluster/prod/app/cryptpad/deploy/cryptpad.hcl | 6 |
6 files changed, 31 insertions, 89 deletions
diff --git a/cluster/prod/app/cryptpad/build/README.md b/cluster/prod/app/cryptpad/build/README.md index 13c6ea2..f97fce4 100644 --- a/cluster/prod/app/cryptpad/build/README.md +++ b/cluster/prod/app/cryptpad/build/README.md @@ -1,6 +1,24 @@ # CryptPad for NixOS with Deuxfleurs flavour -## Building +## Basic Usage + +### Building + +To build and load the Docker image used in our Deuxfleurs deployment, run: + +``` shell +docker load -i $(nix-build deuxfleurs.nix -A docker) +``` + +### Updating Cryptpad to a newer version + +- Check whether the cryptpad build instructions and the `install-onlyoffice.sh` + script has changed. If yes, then update `default.nix` accordingly. +- In `default.nix`, update the `version` field for cryptpad +- In `default.nix`, change the hash (any change works) of the release and `npmDepsHash` to trigger a rebuild +- Run `nix-build deuxfleurs.nix`. This will fail because the hashes have changed, but tell you the correct hash to insert in `default.nix`. + +## More info The `default.nix` file follows the nixpkgs `callPackage` convention for fetching dependencies, so you need to either: diff --git a/cluster/prod/app/cryptpad/build/default.nix b/cluster/prod/app/cryptpad/build/default.nix index 458253a..fffbd91 100644 --- a/cluster/prod/app/cryptpad/build/default.nix +++ b/cluster/prod/app/cryptpad/build/default.nix @@ -71,16 +71,16 @@ }); in buildNpmPackage rec { pname = "cryptpad"; - version = "2024.9.0"; + version = "2024.12.0"; src = fetchFromGitHub { owner = "cryptpad"; repo = "cryptpad"; rev = version; - hash = "sha256-OUtWaDVLRUbKS0apwY0aNq4MalGFv+fH9VA7LvWWYRs="; + hash = "sha256-oSrDajaCEc7I2AsDzKoO34ffd4OeXDwFDGm45yQDSvE="; }; - npmDepsHash = "sha256-pK0b7q1kJja9l8ANwudbfo3jpldwuO56kuulS8X9A5s="; + npmDepsHash = "sha256-1EwxAe+8FOrngZx5+FEeu9uHKWZNBpsECEGrsyiZ2GU="; inherit nodejs; diff --git a/cluster/prod/app/cryptpad/build/npins/sources.json b/cluster/prod/app/cryptpad/build/npins/sources.json index 3372fd0..1f513ad 100644 --- a/cluster/prod/app/cryptpad/build/npins/sources.json +++ b/cluster/prod/app/cryptpad/build/npins/sources.json @@ -3,8 +3,8 @@ "nixpkgs": { "type": "Channel", "name": "nixos-24.05", - "url": "https://releases.nixos.org/nixos/24.05/nixos-24.05.5385.1719f27dd95f/nixexprs.tar.xz", - "hash": "0f7i315g1z8kjh10hvj2zv7y2vfqxmwvd96hwlcrr8aig6qq5gzm" + "url": "https://releases.nixos.org/nixos/24.05/nixos-24.05.7376.b134951a4c9f/nixexprs.tar.xz", + "hash": "1f8j7fh0nl4qmqlxn6lis8zf7dnckm6jri4rwmj0qm1qivhr58lv" } }, "version": 3 diff --git a/cluster/prod/app/cryptpad/build_docker/README.md b/cluster/prod/app/cryptpad/build_docker/README.md new file mode 100644 index 0000000..03e11bb --- /dev/null +++ b/cluster/prod/app/cryptpad/build_docker/README.md @@ -0,0 +1,4 @@ +# Dockerfile for Cryptpad + +This was an experiment but is not used or maintained currently. +The docker image we use is the one build using nix; see the `build/` directory. diff --git a/cluster/prod/app/cryptpad/deploy/cryptpad-debug.hcl b/cluster/prod/app/cryptpad/deploy/cryptpad-debug.hcl deleted file mode 100644 index 7788273..0000000 --- a/cluster/prod/app/cryptpad/deploy/cryptpad-debug.hcl +++ /dev/null @@ -1,80 +0,0 @@ -job "cryptpad-debug" { - datacenters = ["neptune"] - type = "service" - - group "cryptpad" { - count = 1 - - network { - port "http" { - to = 3000 - } - } - - restart { - attempts = 10 - delay = "30s" - } - - task "main" { - driver = "docker" - - constraint { - attribute = "${attr.unique.hostname}" - operator = "=" - value = "courgette" - } - - config { - image = "armael/cryptpad:2024.9.0" - ports = [ "http" ] - - volumes = [ - "/mnt/ssd/cryptpad-debug:/mnt", - "secrets/config-debug.js:/cryptpad/config.js", - ] - } - env { - CRYPTPAD_CONFIG = "/cryptpad/config.js" - } - - template { - data = file("../config/config-debug.js") - destination = "secrets/config-debug.js" - } - - /* Disabled because it requires modifications to the docker image and I do not want to invest the time yet - template { - data = file("../config/application_config-debug.js") - destination = "secrets/config-debug.js" - } - */ - - resources { - memory = 1000 - cpu = 500 - } - - service { - name = "cryptpad-debug" - port = "http" - tags = [ - "tricot pad-debug.deuxfleurs.fr", - "tricot pad-sandbox-debug.deuxfleurs.fr", - "tricot-add-header Cross-Origin-Resource-Policy cross-origin", - "tricot-add-header Cross-Origin-Embedder-Policy require-corp", - "tricot-add-header Access-Control-Allow-Origin *", - "tricot-add-header Access-Control-Allow-Credentials true", - "d53-cname pad-debug.deuxfleurs.fr", - "d53-cname pad-sandbox-debug.deuxfleurs.fr", - ] - check { - type = "http" - path = "/" - interval = "10s" - timeout = "2s" - } - } - } - } -} diff --git a/cluster/prod/app/cryptpad/deploy/cryptpad.hcl b/cluster/prod/app/cryptpad/deploy/cryptpad.hcl index 76737a6..5e19919 100644 --- a/cluster/prod/app/cryptpad/deploy/cryptpad.hcl +++ b/cluster/prod/app/cryptpad/deploy/cryptpad.hcl @@ -1,5 +1,5 @@ job "cryptpad" { - datacenters = ["neptune"] + datacenters = ["scorpio"] type = "service" group "cryptpad" { @@ -22,11 +22,11 @@ job "cryptpad" { constraint { attribute = "${attr.unique.hostname}" operator = "=" - value = "courgette" + value = "abricot" } config { - image = "kokakiwi/cryptpad:2024.9.0" + image = "armael/cryptpad:2024.12.0" ports = [ "http" ] volumes = [ |