Commit Graph

6962 Commits

Author SHA1 Message Date
renovate[bot] e7376aa05d chore(deps): update mariadb:11.8.5 docker digest to 345fa26
Docker / build-and-push (backend) (push) Has been cancelled
Docker / build-and-push (frontend) (push) Has been cancelled
E2E Tests / backend-sqlite (push) Has been cancelled
E2E Tests / backend-mariadb (push) Has been cancelled
E2E Tests / backend-postgres (push) Has been cancelled
Lint and check format / Lint files and check formatting (push) Has been cancelled
REUSE Compliance Check / reuse (push) Has been cancelled
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
Static Analysis / Njsscan code scanning (push) Has been cancelled
Static Analysis / CodeQL analysis (javascript) (push) Has been cancelled
Run tests & build / Test and build with NodeJS 24 (push) Has been cancelled
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-03 16:33:58 +01:00
renovate[bot] 4995f1bfa3 fix(deps): update dependency @nestjs/platform-fastify to v11.1.14 [security]
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-03 15:34:07 +01:00
renovate[bot] 89dcf618a7 chore(config): migrate config renovate.json 2026-03-03 15:32:58 +01:00
Erik Michelson aeba980ff5 fix(backend): expose backend port for non-localhost
E2E Tests / backend-sqlite (push) Has been cancelled
Docker / build-and-push (backend) (push) Has been cancelled
Docker / build-and-push (frontend) (push) Has been cancelled
Deploy HD2 docs to Netlify / Deploys to netlify (push) Has been cancelled
REUSE Compliance Check / reuse (push) Has been cancelled
E2E Tests / backend-mariadb (push) Has been cancelled
E2E Tests / backend-postgres (push) Has been cancelled
Lint and check format / Lint files and check formatting (push) Has been cancelled
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
Static Analysis / Njsscan code scanning (push) Has been cancelled
Static Analysis / CodeQL analysis (javascript) (push) Has been cancelled
Run tests & build / Test and build with NodeJS 24 (push) Has been cancelled
The current implementation restricts the backend port binding
to 127.0.0.1, since this is the default of fastify. This is a
reasonable default from a security standpoint. However, in
certain contexts like docker network, this won't work.
The new configuration option HD_BACKEND_BIND_IP allows to set
a custom IP address to which fastify binds, or setting
0.0.0.0 to bind to all interfaces.
At the same time this fix extends the Dockerfile to announce
port 3000 to be available to the docker daemon.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-02-20 19:28:38 +01:00
Erik Michelson 34e4172cb9 feat(editor): scroll to heading/element linked in URL fragment
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-02-18 23:19:32 +01:00
Philip Molares 7e071ef6bf fix(revision): change query generation
To prevent DB errors change the query so that it works

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2026-02-18 23:17:45 +01:00
Erik Michelson f57e12b85f feat(editor): add own undo/redo stack per user
This uses the yjs undo-manager and some keybindings for
CodeMirror to call that manager. The undo-manager ensures
to only undo or redo changes of the current user.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-02-18 19:37:08 +01:00
Erik Michelson 6d964c33d2 fix(database): ensure Knex reconnects after losing connection
This commit adds pooling to Knex since this seems the only reliable way to reconnect
the database after a lost connection. The pooling is only applied to MariaDB and
PostgreSQL since it makes no sense for SQLite.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-02-06 09:00:48 +01:00
Erik Michelson d585c37c7a feat(monitoring): add health check endpoint
Since the monitoring endpoints should be accessible without
requiring an API token, the token guard was removed.
For the detailed monitoring information, we might want to add
some extra monitoring token later on, or make that endpoint
dependent on some admin flag set for the user account trying
to access the endpoints.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-02-06 09:00:48 +01:00
Erik Michelson fe0b06064b chore(lint): fix some linting issues
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-02-04 22:13:07 +01:00
Erik Michelson 6b18635924 fix(test): ignore error code for ts-jest message about isolatedModules
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-02-04 22:13:07 +01:00
Erik Michelson a99f99d6ac feat(security): add rate limiting
This adds rate-limiting using the @fastify/rate-limit module with sane
default values, configuration options, the possibility to disable limits
and differentiation between logged-in users and unauthenticated requests.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-02-04 22:13:07 +01:00
Erik Michelson 66d052d611 feat(security): add CSRF protection to private API endpoints
This adds a new endpoint /api/private/csrf/token which serves a CSRF-token that
is stored in the user's session. Following requests with POST, PUT, PATCH or DELETE
request methods, need to provide this token in the CSRF-Token header. Since this
is not possible to do via HTML forms or other cross-site effects, this prevents
cross-site attacks. The frontend loads the CSRF token on app initialization and
stores it in the redux. It keeps using the token for up to one hour and then
updates the stored token from the API endpoint again.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-02-04 21:36:52 +01:00
Erik Michelson f0095cd8ec feat(config): make max upload size configurable
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-02-04 21:36:52 +01:00
Erik Michelson a326939f70 fix(config): ensure session secret is always min 32 bytes long
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-02-04 21:36:52 +01:00
Erik Michelson ac2255579f refactor(backend): switch from express to fastify
Fastify is a more modern web framework than express. Although it
shares almost the same API it has a way better performance and
supports more modern features. Several modules like csurf for
CSRF-protection aren't maintained for express anymore but there
is a Fastify replacement.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-02-04 21:36:52 +01:00
Philip Molares bb89f89af7 chore: fix types for diff
As diff uses its own types now, we need to adapt the code to use those

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2026-01-22 00:39:47 +01:00
Philip Molares c2300c09ea chore: remove @types/diff
As diff brings it own types now we don't need @types/diff not anymore

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2026-01-22 00:39:47 +01:00
renovate[bot] e252c40e3d fix(deps): update dependency diff to v8 [security]
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-22 00:39:47 +01:00
Erik Michelson 1cf3cb15af chore(docs): update ESDocs to match changes
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-01-22 00:39:20 +01:00
Erik Michelson f402757baf fix(alias): always return aliases in order from the database
This makes tests behave consistently and makes the API more
predictable. Furthermore, this could reduce the requirement
for client-side sorting in the modal.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-01-22 00:39:20 +01:00
Philip Molares 0ef59950a6 feat(realtime): add alias update message
This allows us to communicate to the clients that everybody should update their aliases.

This route allows us to get all aliases of a note

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2026-01-22 00:39:20 +01:00
Philip Molares eef4d9ed87 feat(private): add alias/:alias
This route allows us to get all aliases of a note

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2026-01-22 00:39:20 +01:00
Philip Molares 305f0afc5a feat(realtime): add permissions updated message
This allows us to communicate to the clients that everybody should update their note permissions.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2026-01-22 00:39:20 +01:00
Philip Molares dbf102efe7 feat(private): add notes/:noteAlias/metadata/permissions route
This route should be used to get only the permissions of a specific note.
It's useful when we update the permissions and only want to get an update for that.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2026-01-22 00:39:20 +01:00
Erik Michelson 97ed67292d fix(register): do not show invalid "You can log in now" message
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-01-21 22:19:35 +01:00
Erik Michelson 8fce75edd9 fix(login): right error messages on login failures
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-01-21 22:19:35 +01:00
Erik Michelson 3c668d0ba6 refactor(login): use one common username/password login component
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-01-21 22:19:35 +01:00
Erik Michelson 4099c4aa4e fix(register): fallback image in user avatar selection
Previously, the method to generate the fallback image returned the
image given by the auth provider, if existing. It now includes a
new flag to foce the generation of a fallback image.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-01-21 22:19:35 +01:00
Erik Michelson f999dd31e2 fix(oidc): use correct username field name
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-01-21 22:19:35 +01:00
Erik Michelson 398d1d5169 fix(register): show info about min password length
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-01-21 22:19:35 +01:00
renovate[bot] a023f4a3cc fix(deps): update i18next
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-21 19:17:40 +01:00
Philip Molares d58ac4b454 refactor: showErrorNotification is actually a builder
This function actually takes an error and builds the notification.
This new name makes the usage of the function more clear.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2026-01-15 01:35:58 +01:00
Philip Molares 05a2d2657a fix(permissions): add more detailed error messages
The user should be informed what went wrong instead of just "an error occurred"

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2026-01-15 01:35:58 +01:00
Philip Molares 741d4d7239 refactor(permissions): clear username after adding permissions
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2026-01-15 01:35:58 +01:00
Philip Molares dcd7b77cd5 fix: add cancel button to media delete dialog
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2026-01-15 01:27:50 +01:00
Philip Molares 705b74183d fix(imports): api/notes
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2026-01-14 21:48:08 +01:00
Philip Molares d27ea8381f fix(changePassword): improve error messages
The user should understand what they did wrong

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2026-01-14 21:48:08 +01:00
Philip Molares b70f5e5919 feat: add auth constants
This adds constants for
- MIN_USERNAME_LENGTH
- MAX_USERNAME_LENGTH
- MIN_PASSWORD_LENGTH

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2026-01-14 21:48:08 +01:00
Philip Molares ec134101a4 chore: add docker compose for auth provider
Add ldap tes server to allow to easily work with that

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2026-01-14 21:22:11 +01:00
Erik Michelson 77dc9f731e fix(ci): update workflow for oxlint and oxfmt usage
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-01-14 19:46:27 +01:00
Erik Michelson 5574d23889 chore(format): reformat using oxfmt
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-01-14 19:46:27 +01:00
Erik Michelson 5b0f3a1c55 chore(format): migrate from prettier to oxfmt
oxfmt is a project from the OXC toolchain, similar to OXLint.
It is based on the Rust-built 'oxidation compiler' and has
increased performance compared to Prettier which is built
in plain JS.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-01-14 19:46:27 +01:00
Erik Michelson 13cdaf066e chore(ide): add OXC plugin to WebStorm IDE project plugin list
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-01-14 19:46:27 +01:00
Erik Michelson 5abc428903 chore(lint): fixes according to stricter lint rules
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-01-14 19:46:27 +01:00
Erik Michelson a880864b2c chore(lint): replace ESLint with OXLint for performance
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-01-14 19:46:27 +01:00
Erik Michelson 51407598d9 fix(test): remove warning about isolatedModules in ts-jest diagnostics
This warning spams the output and currently is not critical to us.
Setting `isolatedModules: true` in the tsconfig.json as suggested breaks
the module resolution and imports.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-01-12 18:34:31 +01:00
Erik Michelson 69ba5c5b8b fix(config): remove invalid logger, that causes a crash in Node 24
This logger statement contains the complete noteConfig.error object which includes
circular object dependencies. Since Node 24 has a rewritten implementation of
console.log that does not silently ignore such errors anymore, we have to remove
this statement. It probably was a leftover from debugging anyways, since the proper
error message is constructed later on and then displayed.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-01-12 18:34:31 +01:00
Erik Michelson 936b583b12 fix(tsconfig): revert to ES2023 instead of ES2024 for ts-jest compatibility
The updated @tsconfig/node24 package uses ES2024 as default feature set for
ECMAScript. Since ts-jest and probably also @typescript-eslint/parser do not
support ES2024 yet, this is a simple fix. We didn't use any ES2024 features
anyways.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-01-12 18:34:31 +01:00
Erik Michelson 941cf87c86 chore(deps): upgrade better-sqlite3 to v12
This is required since better-sqlite3 added support
for Node 24 since version 12.0.0

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-01-12 18:34:31 +01:00