Package Details: cryptpad 2025.3.0-1

Git Clone URL: https://aur.archlinux.org/cryptpad.git (read-only, click to copy)
Package Base: cryptpad
Description: Realtime collaborative visual editor with zero knowlege server
Upstream URL: https://github.com/cryptpad/cryptpad
Keywords: collaborative
Licenses: AGPL-3.0-only
Submitter: anonfunc
Maintainer: buzo
Last Packager: buzo
Votes: 11
Popularity: 0.049660
First Submitted: 2019-06-08 16:40 (UTC)
Last Updated: 2025-04-03 21:11 (UTC)

Dependencies (7)

Required by (1)

Sources (4)

Latest Comments

« First ‹ Previous 1 2 3

ChrisTX commented on 2021-03-27 23:45 (UTC)

Sorry, I was really busy and couldn't do anything.

The build process wasn't really that weird, it was inspired by the Node.js packaging guidelines but this isn't quite right in this case. You should use the production dependencies, and the node cache folder is important so it doesn't pollute the .npm folder of the build user, as described in the guidelines. In the same way, the find ... line and --user root commands are explained there and why they're needed.

Furthermore, the package still makes /usr writeable for the Cryptpad data, which is obviously not wanted. I've updated my previous patch to match the latest version:

diff --git a/PKGBUILD b/PKGBUILD
index b7029fb..b0400f5 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -17,17 +17,21 @@ source=("$pkgname-$pkgver.tar.gz::https://github.com/xwiki-labs/cryptpad/archive
 sha256sums=('aefa5853981b11853aad60439071fa9e3b5e5fd0642cb48adf7cd1e8133dc8f5'
             '522851fbe4e0e41fd6ece8b2b0ed17bbae0233a58328b7994a5207aa341a635b'
             '999a271d64b75c7c447fdb21486b27463c04679677e57ea9551a3b0429c618f6'
-            'dc2207b11876160ad42b2e65aea384437c11fba82c98d74e7eb6aa84b191c49b')
+            '8e5a200747cb77142cf6d08d3490fefc0d3142f196da13c84d3e530b30f6f72b')

 build() {
     cd "$pkgname-$pkgver"
-    npm install
-    bower install
+    export NODE_ENV=production
+    npm install --user root --cache "${srcdir}/npm-cache"
+    bower install --allow-root
 }

 package() {
     cd "$pkgname-$pkgver"

+    # make sure directory permissions are acceptable
+    find . -type d -exec chmod 755 {} +
+
     # Documentation
     install -t "$pkgdir/usr/share/doc/$pkgname" -Dm 644 docs/{ARCHITECTURE.md,example.nginx.conf} CHANGELOG.md

@@ -45,6 +49,12 @@ package() {
     install -Dm 644 config/config.example.js "${pkgdir}/etc/webapps/$pkgname/config.example.js"
     ln -s "../../../etc/webapps/$pkgname" "$pkgdir/usr/share/$pkgname/config"

+    # File directories
+    ln -s "/var/lib/$pkgname/blob" "$pkgdir/usr/share/$pkgname/blob"
+    ln -s "/var/lib/$pkgname/block" "$pkgdir/usr/share/$pkgname/block"
+    ln -s "/var/lib/$pkgname/data" "$pkgdir/usr/share/$pkgname/data"
+    ln -s "/var/lib/$pkgname/datastore" "$pkgdir/usr/share/$pkgname/datastore"
+
     # systemd
     install -Dm 644 "${srcdir}"/cryptpad.sysusers "${pkgdir}"/usr/lib/sysusers.d/cryptpad.conf
     install -Dm 644 "${srcdir}"/cryptpad.service "${pkgdir}"/usr/lib/systemd/system/cryptpad.service
diff --git a/cryptpad.tmpfiles b/cryptpad.tmpfiles
index c1d145a..9926ee2 100644
--- a/cryptpad.tmpfiles
+++ b/cryptpad.tmpfiles
@@ -1,3 +1,7 @@
-d /var/lib/cryptpad 0755 cryptpad cryptpad
-Z /usr/share/cryptpad - cryptpad cryptpad
-
+d /var/lib/cryptpad
+d /var/lib/cryptpad/blob
+d /var/lib/cryptpad/block
+d /var/lib/cryptpad/data
+d /var/lib/cryptpad/datastore
+d /var/lib/cryptpad/logs
+Z /var/lib/cryptpad 0750 cryptpad cryptpad

buzo commented on 2021-03-27 18:17 (UTC)

Okay, it should be fixed now. The build process was a bit weird before.

buzo commented on 2021-03-15 13:20 (UTC)

ChrisTX: Please go ahead and fix this package. I don't have enough time currently.

ChrisTX commented on 2021-03-13 23:51 (UTC) (edited on 2021-03-13 23:56 (UTC) by ChrisTX)

No, the node_modules folder is critical, that's where the dependencies go into. Without the folder, the app cannot run.

Cryptpad doesn't support global installation seemingly, and that's what's breaking. The PKGBUILD is inconsistent in how it wants to do this, that's what caused the error.

Furthermore, don't use tmpfiles to change permissions in /usr! It's not necessary, all that's missing are symlinks to /var/lib/cryptpad/... folders and these are writable and have correct permission. Don't make /usr/share/cryptpad actually writable and the data storage location for the pads. It should also not be world-readable.

The following should fix the package, although people who already installed the last version will need to fix permissions in /usr/share/cryptpad now.

diff --git a/PKGBUILD b/PKGBUILD
index 5ea587e..460ef68 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -14,18 +14,18 @@ source=("$pkgname-$pkgver.tar.gz::https://github.com/xwiki-labs/cryptpad/archive
         "cryptpad.service"
         "cryptpad.sysusers"
         "cryptpad.tmpfiles")
-sha256sums=('a54a254f696f7aaa6e2492d6561bccd62919217c7ece3cff97179b9746802128'
+sha256sums=('0e769b0184741907bf5cdd0f5bb0488d43589435f2f102e53d7d64e666978a65'
             '522851fbe4e0e41fd6ece8b2b0ed17bbae0233a58328b7994a5207aa341a635b'
             '999a271d64b75c7c447fdb21486b27463c04679677e57ea9551a3b0429c618f6'
-            'dc2207b11876160ad42b2e65aea384437c11fba82c98d74e7eb6aa84b191c49b')
+            '8e5a200747cb77142cf6d08d3490fefc0d3142f196da13c84d3e530b30f6f72b')

 package() {
     cd "$pkgname-$pkgver"

-    npm install -g --user root --prefix "${pkgdir}"/usr --cache "${srcdir}/npm-cache"
-    bower install --allow-root
+    export NODE_ENV=production

-    rm -r "$pkgdir"/usr
+    npm install --user root --cache "${srcdir}/npm-cache"
+    bower install --allow-root

     # make sure directory permissions are acceptable
     find . -type d -exec chmod 755 {} +
@@ -35,7 +35,7 @@ package() {

     # Cryptpad
     install -Dt "$pkgdir/usr/share/$pkgname" package.json server.js
-    cp -rt "$pkgdir/usr/share/$pkgname" customize.dist lib scripts www
+    cp -rt "$pkgdir/usr/share/$pkgname" customize.dist lib node_modules scripts www
     rmdir "$pkgdir/usr/share/$pkgname/www/bower_components/codemirror/mode/rpm/changes"

     # Config
@@ -47,6 +47,12 @@ package() {
     install -Dm 644 config/config.example.js "${pkgdir}/etc/webapps/$pkgname/config.example.js"
     ln -s "../../../etc/webapps/$pkgname" "$pkgdir/usr/share/$pkgname/config"

+    # File directories
+    ln -s "/var/lib/$pkgname/blob" "$pkgdir/usr/share/$pkgname/blob"
+    ln -s "/var/lib/$pkgname/block" "$pkgdir/usr/share/$pkgname/block"
+    ln -s "/var/lib/$pkgname/data" "$pkgdir/usr/share/$pkgname/data"
+    ln -s "/var/lib/$pkgname/datastore" "$pkgdir/usr/share/$pkgname/datastore"
+
     # systemd
     install -Dm 644 "${srcdir}"/cryptpad.sysusers "${pkgdir}"/usr/lib/sysusers.d/cryptpad.conf
     install -Dm 644 "${srcdir}"/cryptpad.service "${pkgdir}"/usr/lib/systemd/system/cryptpad.service
diff --git a/cryptpad.tmpfiles b/cryptpad.tmpfiles
index c1d145a..9926ee2 100644
--- a/cryptpad.tmpfiles
+++ b/cryptpad.tmpfiles
@@ -1,3 +1,7 @@
-d /var/lib/cryptpad 0755 cryptpad cryptpad
-Z /usr/share/cryptpad - cryptpad cryptpad
-
+d /var/lib/cryptpad
+d /var/lib/cryptpad/blob
+d /var/lib/cryptpad/block
+d /var/lib/cryptpad/data
+d /var/lib/cryptpad/datastore
+d /var/lib/cryptpad/logs
+Z /var/lib/cryptpad 0750 cryptpad cryptpad

buzo commented on 2021-03-13 10:37 (UTC)

spychodelics: I have removed node_modules, but I don't have time to test it now. Hope it still works …

satcom886: done (finally :)

spychodelics commented on 2021-03-09 15:07 (UTC) (edited on 2021-03-09 15:35 (UTC) by spychodelics)

4.1.0 fails with

cp: der Aufruf von stat für 'node_modules' ist nicht möglich: Datei oder Verzeichnis nicht gefunden

removing node_modules fixes building process but breakes the functionality

k8ie commented on 2020-06-22 21:21 (UTC)

Other than that it works flawlessly (after I changed the owner of /usr/share/cryptpad to cryptpad).

k8ie commented on 2020-06-22 20:42 (UTC)

I'm getting a permission error when starting the service for the first time. I think the /usr/share/cryptpad directory should be owned by the cryptpad user.

           if (err) { throw err; }
                      ^
[Error: EACCES: permission denied, mkdir '/usr/share/cryptpad/data'] {
  errno: -13,
  code: 'EACCES',
  syscall: 'mkdir',
  path: '/usr/share/cryptpad/data'
 }

anonfunc commented on 2019-10-04 07:47 (UTC)

Update to 3.2.0 is untested, since I currently don't have access to a running instance.

Please report any issues.