"Open in CryptPad" is a Nextcloud application that allows collaborative editing and viewing of files. For this it uses a CryptPad instance embedded into the Nextcloud web interface. Currently, only drawio diagrams are supported.
With this app, you can import images from Nextcloud into
diagrams. A copy of the image will be stored inside the .drawio file.
When using this app, the file permissions are completely handled by Nextcloud. The right's management of CryptPad is not used for Nextcloud files edited in CryptPad.
You can install this app in one of the following ways: either from the NextCloud app store, from a binary release, or by cloning this repository. Once installed, you can check CryptPad is configured correctly by checking that the url listed under Administration > CryptPad is the same as the url of your local CryptPad instance.
To embed CryptPad into Nextcloud, the "Enable remote embedding" admin setting needs to be enabled. You can find this setting on the "Administration" web interface in the "Security" tab.
- Add drawio mimetype to Nextcloud. "Open in CryptPad" depends on Nextcloud
detecting drawio files correctly. For this you have to create the following
files: (Note: do this before uploading any drawio files! The mimetype of
old files will not be updated by these changes)
-
nextcloud/config/mimetypealiases.json{ "application/x-drawio": "image" } -
nextcloud/config/mimetypemapping.json{ "drawio": ["application/x-drawio"] }
-
- Open the "Apps" page in your Nextcloud web interface and install "Open in CryptPad". You can find it in the "Integration" category.
- Configure "Open in CryptPad" in the administration settings of Nextcloud.
- Unpack
openincryptpad.tar.gzin the nextcloud/apps/ folder. You can download the latest version from the release page. - Enable the "Open in CryptPad" app in the Nextcloud admin page.
- Configure "Open in CryptPad" in the administration settings of Nextcloud.
- Add drawio mimetype to Nextcloud. "Open in CryptPad" depends on Nextcloud
detecting drawio files correctly. For this you have to create the following
files: (Note: do this before uploading any drawio files! The mimetype of
old files will not be updated by these changes)
-
nextcloud/config/mimetypealiases.json{ "application/x-drawio": "image" } -
nextcloud/config/mimetypemapping.json{ "drawio": ["application/x-drawio"] }
-
To verify the binary release you run the following command:
openssl dgst -sha512 -verify openincryptpad.pubkey -signature openincryptpad.tar.gz.signature openincryptpad.tar.gzPlace this app in nextcloud/apps/. Make sure the folder is named openincryptpad. E.g.:
cd nextcloud/apps
git clone https://github.com/cryptpad/nextcloud-open-in-cryptpad.git openincryptpadOn a Ubuntu like distribution you will need these packages:
sudo apt install php-cli composer php-xmlPrior to building, install the requisite dependencies by running:
npm ci
The app can then be built using the provided Makefile by running:
make
This requires the following things to be present:
- make
- which
- tar: for building the archive
- curl: used if phpunit and composer are not installed to fetch them from the web
- npm: for building and testing everything JS, only required if a package.json is placed inside the js/ folder
The make command will install or update Composer dependencies if a composer.json is present and also npm run build if a package.json is present in the js/ folder. The npm build script should use local paths for build systems and package managers, so people that simply want to build the app won't need to install npm libraries globally, e.g.:
package.json:
"scripts": {
"test": "node node_modules/gulp-cli/bin/gulp.js karma",
"prebuild": "npm install && node_modules/bower/bin/bower install && node_modules/bower/bin/bower update",
"build": "node node_modules/gulp-cli/bin/gulp.js"
}docker-compose.dev.yaml starts all NextCloud versions we support with openincryptpad enabled. You can start it like this:
make # openincryptpad needs to be built before NextCloud is stared
docker compose -f docker-compose.dev.yaml up --buildYou can access the different NextCloud versions via:
- http://localhost:8032 - NC32
- http://localhost:8031 - NC31
- http://localhost:8030 - NC30
There will be an admin user with the password Test1234. Do not forget to set the URL tp your CryptPad instance in the admin settings.
If you need to reset all your data, you can do it like this:
docker compose -f docker-compose.dev.yaml up --build
docker volume rm openincryptpad_nc30-config openincryptpad_nc30-data openincryptpad_nc31-config openincryptpad_nc31-dataNOTE: Make sure you placed the code into a folder named openincryptpad, as described above.
First get an account for the App Store then run:
make && make appstore
The archive is located in build/artifacts/appstore and can then be uploaded to the App Store.
You can use the provided Makefile to run all tests by using:
make test
This will run the PHP unit and integration tests and if a package.json is present in the js/ folder will execute npm run test
Of course you can also install PHPUnit and use the configurations directly:
phpunit -c phpunit.xml
or:
phpunit -c phpunit.integration.xml
for integration tests