Feasibility-study draft showing the openproject-side consumer changes that go with op-blocknote-extensions v0.1.0 (opf/op-blocknote-extensions PRs #133 and #134, not yet merged): frontend - @blocknote/{core,mantine,react}: ^0.44.2 → ^0.51.0 - op-blocknote-extensions: v0.0.26 → v0.1.0 (URL not live yet) - OpBlockNoteEditor.tsx: BlockNote 0.51 tightened CollaborationOptions — omit the whole `collaboration` block when no hocuspocusProvider is wired up; cast the provider at the boundary because Hocuspocus's `awareness: Awareness | null` doesn't match BlockNote's `Awareness | undefined`. hocuspocus (extensions/op-blocknote-hocuspocus) - @blocknote/server-util: ^0.44.2 → ^0.51.0 - @blocknote/core (dev): ^0.44.2 → ^0.51.0 - op-blocknote-extensions: v0.0.18 → v0.1.0 - openProjectApi.ts: import the static specs from the new `op-blocknote-extensions/server` subpath (keeps @blocknote/react out of Node); align schema key with the post-refactor block type ("openProjectWorkPackage" → "openProjectWorkPackageBlock"); register the inline static spec so inline work-package chips survive the markdown export. Lockfiles intentionally not regenerated: the v0.1.0 GitHub URL doesn't resolve yet. Reviewers should treat this PR as a feasibility study, not a mergeable artefact. Refs: https://community.openproject.org/wp/74654 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
op-blocknote-hocuspocus
A real-time collaborative editing server for OpenProject documents, powered by Yjs and Hocuspocus.
Installation
From Source
# Clone the OpenProject repository
git clone https://github.com/opf/openproject.git
cd openproject/extensions/op-blocknote-hocuspocus
# Install dependencies
npm install
# Start the server with the appropriate environment variables setup
SECRET=secret12345 npm run start
The SECRET environment variable is a shared value between this application and OpenProject. Make sure to configure the same value in OpenProject - Settings Hocuspocus secret and in the SECRET environment variable of this project.
Using Docker
docker pull openproject/hocuspocus:latest
docker run -d \
-p 1234:1234 \
-e SECRET=secret12345 \
openproject/hocuspocus:latest
Configuration & Usage
Configuration
OPENPROJECT_URL (default undefined)
This is the base URL hocuspocus will use to connect to OpenProject. It is undefined by default, in which case the URL is derived from the edited resources (e.g. documents) in OpenProject.
This can fail in some cases where hocuspocus cannot reach the host under the given URL,
for instance when using the docker compose setup with localhost for the OpenProject host.
In this case hocuspocus would try to connect to itself.
To fix that you can configure OPENPROJECT_URL to 'rebase' the resource URLs to the given value.
For instance, in the case of docker compose:
OPENPROJECT_URL=http://web
Where web is the DNS name for the OpenProject container in the docker compose setup.
When overriding the base URL like this, you also need to set
OPENPROJECT_ADDITIONAL__HOST__NAMESon the OpenProject side. In the example above you would set it toweb.
When using
httpas the protocol as shown in the example, you also MUST set theOPENPROJECT_HTTPSoption (see below) totrue.
OPENPROJECT_HTTPS (default undefined)
This option only applies when using OPENPROJECT_URL.
It is a direct reflection of the HTTPS setting in OpenProject.
If this is true, hocuspocus will add the X-Forwarded-Proto header to its requests to prevent running into
https redirects.
OPENPROJECT_HTTPS=true
Starting the Server
# Development Mode (with hot reload):
npm run dev
# Production Mode
npm run start
# Debug Mode (with Node.js inspector):
npm run debug
# Run tests
npm run test
# Lint code
npm run lint
Links
Maintained by the OpenProject team