Skip to content

Commit f3ca3a2

Browse files
committed
Merge branch 'dev' into release
2 parents 9db722d + 988fb21 commit f3ca3a2

File tree

15 files changed

+1618
-2528
lines changed

15 files changed

+1618
-2528
lines changed

.github/dependabot.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "npm"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
commit-message:
8+
prefix: "deps"
9+
labels:
10+
- "dependencies"
11+
groups:
12+
npm-minor-patch:
13+
patterns:
14+
- "*"
15+
update-types:
16+
- "minor"
17+
- "patch"

.github/workflows/docker.yml

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,16 @@ jobs:
1010
build:
1111
runs-on: ubuntu-latest
1212
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v5
1315
- name: Set SHORT_SHA
14-
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV
16+
run: |
17+
SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`
18+
echo "SHORT_SHA=$SHORT_SHA" >> $GITHUB_ENV
19+
echo "DOCKER_TAG=${{ github.ref_name }}-$SHORT_SHA" >> $GITHUB_ENV
1520
21+
# also include SHA in version string
22+
sed -ri "s/\"version\": \"(.*)\"/\"version\": \"\1-$SHORT_SHA\"/g" package.json
1623
- name: Login to Docker Hub
1724
uses: docker/login-action@v3
1825
with:
@@ -25,12 +32,41 @@ jobs:
2532
- name: Build and push
2633
uses: docker/build-push-action@v6
2734
with:
35+
context: .
2836
push: true
2937
tags: |
3038
openproject/hocuspocus:latest
31-
openproject/hocuspocus:${{ github.ref_name }}-${{ env.SHORT_SHA }}
39+
openproject/hocuspocus:${{ env.DOCKER_TAG }}
3240
cache-from: type=gha
3341
cache-to: type=gha,mode=max
3442
- name: Summarize build
3543
run: |
36-
echo "Built \`openproject/hocuspocus:${{ github.ref_name }}-${{ env.SHORT_SHA }}\`" >> $GITHUB_STEP_SUMMARY
44+
45+
- name: Generate GHA token
46+
id: generate-gha-token
47+
uses: actions/create-github-app-token@v1
48+
with:
49+
app-id: ${{ vars.DEPLOY_APP_ID }}
50+
private-key: ${{ secrets.DEPLOY_APP_PRIVATE_KEY }}
51+
owner: opf
52+
repositories: saas-deploy
53+
54+
- name: Deploy EDGE
55+
if: github.ref == 'refs/heads/dev'
56+
uses: benc-uk/workflow-dispatch@e2e5e9a103e331dad343f381a29e654aea3cf8fc
57+
with:
58+
workflow: edge-deploy-shards.yml
59+
repo: opf/saas-deploy
60+
ref: master
61+
inputs: '{ "hocuspocus_image_tag": "${{ env.DOCKER_TAG }}" }'
62+
token: "${{ steps.generate-gha-token.outputs.token }}"
63+
64+
- name: Deploy STAGE
65+
if: github.ref == 'refs/heads/release'
66+
uses: benc-uk/workflow-dispatch@e2e5e9a103e331dad343f381a29e654aea3cf8fc
67+
with:
68+
workflow: stage-deploy-shards.yml
69+
repo: opf/saas-deploy
70+
ref: master
71+
inputs: '{ "hocuspocus_image_tag": "${{ env.DOCKER_TAG }}" }'
72+
token: "${{ steps.generate-gha-token.outputs.token }}"

.github/workflows/test.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: test.yml
2+
on:
3+
pull_request:
4+
types: [opened, reopened, synchronize]
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
units:
11+
name: Unit tests
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v5
16+
with:
17+
fetch-depth: 0
18+
19+
- uses: actions/setup-node@v5
20+
with:
21+
node-version: '22.19'
22+
cache: npm
23+
cache-dependency-path: package-lock.json
24+
25+
- name: Install Dependencies
26+
id: npm-i
27+
run: npm i
28+
29+
- name: run tests
30+
id: npm-test
31+
run: CI=1 npm test

README.md

Lines changed: 68 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,75 @@
11
# op-blocknote-hocuspocus
22

3-
YJS provider for real time collaborative document editting in OpenProject
3+
[![Tests](https://github.com/opf/op-blocknote-hocuspocus/actions/workflows/test.yml/badge.svg)](https://github.com/opf/op-blocknote-hocuspocus/actions/workflows/test.yml)
4+
[![Docker](https://github.com/opf/op-blocknote-hocuspocus/actions/workflows/docker.yml/badge.svg)](https://github.com/opf/op-blocknote-hocuspocus/actions/workflows/docker.yml)
45

5-
Do not forget to setup the environment correctly.
6+
A real-time collaborative editing server for [OpenProject](https://www.openproject.org/) documents, powered by [Yjs](https://github.com/yjs/yjs) and [Hocuspocus](https://tiptap.dev/docs/hocuspocus/introduction).
67

8+
## Installation
9+
10+
### From Source
11+
12+
```bash
13+
# Clone the repository
14+
git clone https://github.com/opf/op-blocknote-hocuspocus.git
15+
cd op-blocknote-hocuspocus
16+
17+
# Install dependencies
18+
npm install
19+
20+
# Start the server with the appropriate environment variables setup
21+
ALLOWED_DOMAINS=your-openproject-domain.com SECRET=secret12345 npm run start
22+
```
23+
24+
For the server to be able to reach to an OpenProject instance, it is necessary to set the environment variable `ALLOWED_DOMAINS`. It is a comma-separated list of domains (and it allows subdomain matching).
25+
26+
```
27+
ALLOWED_DOMAINS=subdomain-openproject.example.com,top-level-openproject.com`
728
```
8-
ALLOWED_DOMAINS=https://your-openproject-domain.com,https://another-allowed-domain.com
29+
30+
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.
31+
32+
### Using Docker
33+
34+
```bash
35+
docker pull openproject/hocuspocus:latest
36+
37+
docker run -d \
38+
-p 1234:1234 \
39+
-e ALLOWED_DOMAINS=your-openproject-domain.com \
40+
-e SECRET=secret12345 \
41+
openproject/hocuspocus:latest
942
```
1043

44+
## Usage
45+
46+
### Starting the Server
47+
48+
```bash
49+
# Development Mode (with hot reload):
50+
npm run dev
51+
52+
# Production Mode
53+
npm run start
54+
55+
# Debug Mode (with Node.js inspector):
56+
npm run debug
57+
58+
# Run tests
59+
npm run test
60+
61+
# Lint code
62+
npm run lint
63+
```
64+
65+
## Links
66+
67+
- [OpenProject](https://www.openproject.org/)
68+
- [Hocuspocus Documentation](https://tiptap.dev/docs/hocuspocus/introduction)
69+
- [Yjs Documentation](https://docs.yjs.dev/)
70+
- [BlockNote Editor](https://www.blocknotejs.org/)
71+
- [Repository Issues](https://github.com/opf/op-blocknote-hocuspocus/issues)
72+
73+
---
74+
75+
**Maintained by the OpenProject team**

0 commit comments

Comments
 (0)