Commit graph

45 commits

Author SHA1 Message Date
Erik Michelson
d6549a1d0b chore(deps): upgrade dependencies for commons
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2024-11-01 17:31:27 +01:00
Erik Michelson
7f665fae4b feat(auth): refactor auth, add oidc
Thanks to all HedgeDoc team members for the time discussing,
helping with weird Nest issues, providing feedback
and suggestions!

Co-authored-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2024-09-11 21:29:49 +02:00
Philip Molares
02a5f62d27 fix: frontmatter headline
If one wrote a frontmatter the incomplete ending dashes where interpreted as a headline and therefore the last line in the frontmatter was handled as the first heading of the document.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2024-09-11 20:46:38 +02:00
renovate[bot]
2ab59b750c chore(deps): update linters
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: David Mehren <git@herrmehren.de>
2023-12-08 09:10:43 +01:00
Philip Molares
723f3f611c feat(realtime): add disconnect reason
The frontend now doesn't try to reconnect, when the disconnection happened because of a lack of permissions

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2023-10-23 22:39:21 +02:00
Tilman Vatteroth
8a745f3f32 fix: improve deep partial type used in tests
The deep partial type from redux had the problem that it could only be applied to records. This caused problems with primitive types and arrays.

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-09-07 21:25:56 +02:00
Tilman Vatteroth
09755272e6 fix: correct interval type
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-08-19 10:42:36 +00:00
Tilman Vatteroth
dccd58f0c1 fix: remove subpath support for HD_BASE_URL
With this commit we drop the subpath support which results in the constraint that HedgeDoc must always run on the root of a domain. This makes a lot of things in testing, rendering and security much easier.

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-08-13 20:38:53 +02:00
Tilman Vatteroth
34bf8f16b1 fix: format code
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-07-19 12:36:32 +02:00
Tilman Vatteroth
eeef0ea025 test: add mocked message transporter
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-07-06 12:07:03 +02:00
Tilman Vatteroth
233fb263c7 fix: don't allow message sending before both sides are ready
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-07-06 12:07:03 +02:00
Tilman Vatteroth
57f7734f7f fix: add docs to sendMessage
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-07-06 12:07:03 +02:00
Tilman Vatteroth
823b8e5ad5 fix: don't block message receiving even despite the ready state
This shouldn't be handled here. If both sides are following the protocol then there shouldn't be any messages before this side hasn't sent the ready answer.

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-07-06 12:07:03 +02:00
Tilman Vatteroth
e99a9f4855 fix: increase resend interval of READY_REQUEST
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-07-06 12:07:03 +02:00
Tilman Vatteroth
930e91195c fix: send one ready request immediately
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-07-06 12:07:03 +02:00
Tilman Vatteroth
9f1e0e48e3 fix: clear interval variable after deleting timer
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-07-06 12:07:03 +02:00
Tilman Vatteroth
ad04bb78a2 refactor: clean up y-doc sync adapter code
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-07-06 12:07:03 +02:00
Tilman Vatteroth
25ee20c15d refactor: rename ready function to match its intent
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-07-06 12:07:03 +02:00
Tilman Vatteroth
f4a1999a8b fix(communication): send ready event when both sides are ready
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-06-28 21:50:48 +02:00
Tilman Vatteroth
20197d36df refactor(commons): remove redundant method
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-06-20 11:44:38 +02:00
Tilman Vatteroth
753c6e593f refactor: remove isomorphic-ws
The package caused some issues while working on other features.
Mostly because bundlers have been unable to determine the correct
websocket constructor.
So I replaced it with a more object-oriented approach.

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-06-02 17:40:25 +02:00
Tilman Vatteroth
4d9792bcb9 refactor: reorganize files in commons package
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-05-31 23:42:46 +02:00
Tilman Vatteroth
e5911b09c1 refactor: reorder commons index.ts
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-05-30 09:17:05 +02:00
Tilman Vatteroth
0b06bcf67b fix: correct iso6391
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-05-30 09:17:05 +02:00
Tilman Vatteroth
db43e1db3f refactor: move frontmatter parser into commons package
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-05-30 09:17:05 +02:00
Tilman Vatteroth
4d0a2cb79e refactor: change return type of frontmatter extractor to use undefined
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-05-30 09:17:05 +02:00
Tilman Vatteroth
77f858bff8 fix: remove redundant note detail props
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-05-30 09:17:05 +02:00
Tilman Vatteroth
d29e840bc6 fix(realtime): allow realtime user status updates from users that have read-only access
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-05-09 20:33:23 +02:00
Tilman Vatteroth
eebbb79d08 fix: retrieve read-only state for y-doc-sync-server-adapter from connection
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-05-09 12:33:09 +02:00
Tilman Vatteroth
3962cafa5d feat: move title extraction into commons package
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-04-16 20:05:24 +02:00
Philip Molares
c2f41118b6 feat: check permissions in realtime code and frontend
Signed-off-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-04-06 22:54:50 +02:00
Tilman Vatteroth
598fc8ee11 feat(realtime): synchronize and show realtime activity state
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-03-29 01:16:43 +02:00
Tilman Vatteroth
ef699a9123 fix: disconnect websocket if trying to send over closed connection
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-03-26 17:36:25 +02:00
Philip Molares
8e57188ab5 refactor(common): extract frontmatter code into commons
Signed-off-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-03-26 14:58:38 +02:00
Philip Molares
8bd7fd1be8 refactor(common): extract frontmatter code into commons
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2023-03-26 14:58:38 +02:00
Tilman Vatteroth
a78ac5f097 fix: use correct callback on websocket error
the error event of the websocket occurs if the connection is already closed.
Therefore, the disconnect call does nothing and the transporter won't throw the disconnected event.

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-03-26 12:25:40 +02:00
Philip Molares
4956a99ced refactor(frontend/commons): rename .test files to .spec
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2023-03-25 15:02:29 +01:00
Tilman Vatteroth
24b7514e25 feat: submit own style index on realtime user state set
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-03-25 13:11:40 +01:00
Tilman Vatteroth
a826677225 refactor: save ydoc state in the database, so it can be restored easier
By storing the ydoc state in the database we can reconnect lost clients easier
and enable offline editing because we continue using the crdt data that has been
used by the client before the connection loss.

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-03-24 16:03:55 +01:00
Tilman Vatteroth
3a06f84af1 refactor: reimplement realtime-communication
This commit refactors a lot of things that are not easy to separate.
It replaces the binary protocol of y-protocols with json.
It introduces event based message processing.
It implements our own code mirror plugins for synchronisation of content and remote cursors

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-03-24 14:06:03 +01:00
Tilman Vatteroth
11c2f57e4b fix(commons): extract name of markdown content yjs channel into the commons package
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-02-09 15:43:59 +01:00
Tilman Vatteroth
5e1fdbe81d fix(config): Replace HD_DOMAIN and HD_EDITOR_BASE_URL with HD_BASE_URL
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-02-05 22:32:31 +01:00
Tilman Vatteroth
d76714f2a2 fix(commons): Move "wait for other promises to finish" util to commons
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-02-05 18:38:32 +01:00
Tilman Vatteroth
1eeb1dadc4 fix(commons): Fix array creation in awareness state request
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2022-12-28 17:22:40 +01:00
Tilman Vatteroth
7320fe2ac1 feat(packages): add commons package
This is an import of 166ca8da12
with some changes to make it fit into the mono repo.
- TypedEventEmitter has been replaced with EventEmitter2 because EventEmitter2 is faster and TypedEventEmitter had some troubles with the new way of compiling.
- tsc-esm has been replaced with microbundle. The problems that lib0 doesn't export its types correctly has been solved using yarn patch.

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2022-12-11 23:09:10 +01:00