Previously the hardcoded colors only made a contrast of 3.39 to the
background. Furthermore changing the overall theme variables wouldn't
change the colors for the table-of-contents as well. This commit
changes that to use the theme variables, therefore ensuring better
maintainability and contrast (now 7.29)
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
Apparently, opening a link from a sandboxed iframe enabled the
sandbox mode for the opened new tab as well. For most pages,
this is not a problem since these pages don't depend on anything
special. However when clicking a link to a PDF file, Chromium-
based browsers don't open the tab, since the built-in PDF viewer
is not compatible with the sandboxing.
The attribute `allow-popups-to-escape-sandbox` allows pages opened
from the sandbox into a new tab to be not sandboxed. Since we don't
have opener access there, this is no risk to HedgeDoc and can safely
be enabled and therefore fix PDF links.
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
Previously, the cleanup algorithm let to data-loss as it could
delete the only remaining revision of a note when it was older
than the retention period. The new cleanup algorithm strictly
differentiates between cases where only one revision exists at
all, where multiple revisions exists older than the retention
period but no newer one (compacting them properly) as well as
where both revisions older than the retention period and ones
newer than that period exist (cleaning up the old ones).
This should prevent data loss by clean ups.
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
The generated SQL from Knex contained ambigous column names, resulting
in failure in the real-world since these queries were rejected by the
SQLite library. This patch fixes the problem by properly making all
column names explicit.
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This fixes a reported security vulnerability where one use could
retrieve revisions of another note where they don't have access
to. This was possible, because the URL included both the note alias
and the revision UUID, the backend then checked the user's permissions
for the note alias but fetched and returned the revision by its UUID
without checking whether the revision belongs to that note.
Credits for finding and reporting this vulnerability to:
- The Raw (https://github.com/therawdev)
- Vishal (https://github.com/shukla304)
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
We did not implement this functionality yet and won't for some time so in order for HedgeDoc 2 to become release ready, this button will be removed.
Fixes#6478
Signed-off-by: Philip Molares <philip.molares@udo.edu>
The test checked the wrong error code, that was thrown because we don't provide the correct request body. The test never failed because of the forbidden alias
Signed-off-by: Philip Molares <philip.molares@udo.edu>
The notification key 'editor.modal.permissions.error' was meant to be used with the ErrorToI18nKeyMapper as a base
which gets different suffixes added depending on the error code and not as a normal error code by itself.
Signed-off-by: Philip Molares <philip.molares@udo.edu>
This is a moderate increase from about 2 req/minute to 2.6 req/minute
with an increase of the window to 15 minutes. Switching between
accounts a few times should be covered by the higher rate limit.
At the same time, the window increase reduces the attack/abuse chance
again.
Fixes#6471
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
The frontmatter validator was still the one left place that used Joi instead
of the now widely used zod in HedgeDoc. Since zod can do validation, coercion
and providing types based on the schema, the code could be drastically reduced
compared to the old frontmatter validator.
At the same time, the validator is now less strict. Custom fields are still
allowed for people that want to add their own frontmatter tags which are
unrelated to HedgeDoc. Furthermore, we now allow the complete set of
RevealOptions for the slideOptions key instead of only a few handpicked
ones.
Fixes#5946
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
Signed-off-by: Philip Molares <philip.molares@udo.edu>
oxlint now includes support for TypeScript-aware linting by using
the oxlint-tsgolint package. While this increases the chance of
finding bugs early, it requires a few changes to the TypeScript
configuration, especially the explicit declaration of CSS imports
and changing the moduleResolution to bundler mode.
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This method updates the backend and changes the redux state in one call, instead of just calling the backend.
With this the state get's updated, and the user see that they pinned a note immediately.
Fixes#6484
Signed-off-by: Philip Molares <philip.molares@udo.edu>
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
We had two different approcaches to the redirect after the login / registration.
Because of this there were race conditions, and we sometimes got stuck on the redirect page.
Fixes#6467
Signed-off-by: Philip Molares <philip.molares@udo.edu>
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
The backend end-to-end tests run with many parallel workers that
each start a full NestJS application including database connection
pools, HTTP server and so on. This can easily result in performance
bottlenecks - which is even the reason why we added the --runInBand
option for the CI. The performance can be improved by constraining
the number of workers and memory allocated per worker in our jest
config. Furthermore, we can forcefully close open HTTP connections
in the test cleanup. This terminates connections with a keepalive
flag, that would persist for a while longer otherwise. The following
`this.app.close()` waits for keepalive requests, so this reduces the
wait time.
Signed-off-by: Erik Michelson <github@erik.michelson.eu>