Previous versions of HedgeDoc suffered from the problem
that changing the media backend required manipulation of
the media links in all created notes. We discussed in
#3704 that it's favourable to have an endpoint that
redirects to the image's original URL. When changing the
media backend, the link stays the same but just the
redirect changes.
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
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>
We need to use .ts only if we run inside ts-node
or other tools that use it. In all other cases, we need to
refer to the .js migration files.
Signed-off-by: David Mehren <git@herrmehren.de>
Previously, an undefined result in fetchUsernameForSessionId
was handled the same way as an error, rejecting the promise.
This fixes the behavior, only rejecting the promise if an error
is returned from the session store and properly returning
undefined if the session store returns that.
Signed-off-by: David Mehren <git@herrmehren.de>
The default log level is 'warning', so we log the final
startup message as warning to ensure it is visible by default.
Signed-off-by: David Mehren <git@herrmehren.de>
This config object was originally ported from the HD1 config,
but is not required anymore.
HD2 does not support handling TLS anymore, so it does not make
sense for it to set TLS-related headers.
The reverse proxy terminating TLS can easily set HSTS headers.
Signed-off-by: David Mehren <git@herrmehren.de>
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>
This was done as LDAPS us both the plural of LDAP and the common abbreviation for secure LDAP connections.
Fixes#4460
Signed-off-by: Philip Molares <philip.molares@udo.edu>
The setAdapter function checks if the websocket is closed.
If this is the case then an error is thrown and the whole process will be canceled. If the adapter isn't set before the realtime connection object is prepared then the connection will subscribe to all the events and THEN the process will be canceled. Because the MessageTransporter has no adapter (and won't get one), the connection will never get a disconnect event and clean up.
This causes the flood of "cant send message over closed websocket" messages.
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
While the DI and database initialization is running, NestJSs default logger is normally used. Our custom logger was only being initialized after DI setup is complete.
Errors encountered during DI setup were buffered and only printed after DI init was complete, or the app exited on error.
This led to the app not printing anything for a minute in certain cases.
This commit replaces the initial logger with our ConsoleLoggerService that logs everything.
After DI init is complete, that logger is replaced with a normal instance of ConsoleLoggerService that uses the real config from DI.
Fixes https://github.com/hedgedoc/hedgedoc/issues/4306
Signed-off-by: David Mehren <git@herrmehren.de>
sometimes we create revisions for notes that don't exist yet. If we try to persist a revision that is referring to a non-existing note the whole attempt crashes.
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>