feat: add config option to disable external link warning

Since it is heavily requested by users, this adds a new config option
to disable the previously introduced external link warning.
Be aware however, that disabling this config option weakens the
security of your HedgeDoc instance and is therefore only recommended
for closed trustworthy user groups.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
Erik Michelson
2026-07-05 00:28:59 +02:00
committed by Philip Molares
parent d20619315e
commit 0ebf0dbc6b
7 changed files with 32 additions and 23 deletions

View File

@@ -193,5 +193,6 @@ module.exports = {
// 3rd appearance: "31-good-morning-my-friend---do-you-have-5-2"
linkifyHeaderStyle: 'keep-case',
enableStatsApi: true,
externalLinkWarning: true,
externalLinkWhitelist: []
}

View File

@@ -167,5 +167,6 @@ module.exports = {
openID: toBooleanConfig(process.env.CMD_OPENID),
linkifyHeaderStyle: process.env.CMD_LINKIFY_HEADER_STYLE,
enableStatsApi: toBooleanConfig(process.env.CMD_ENABLE_STATS_API),
externalLinkWarning: toBooleanConfig(process.env.CMD_EXTERNAL_LINK_WARNING, true),
externalLinkWhitelist: toArrayConfig(process.env.CMD_EXTERNAL_LINK_WHITELIST)
}

View File

@@ -113,6 +113,7 @@ statusRouter.get('/config', function (req, res) {
linkifyHeaderStyle: config.linkifyHeaderStyle,
cookiePolicy: config.cookiePolicy,
enableUploads: config.enableUploads,
externalLinkWarning: config.externalLinkWarning,
externalLinkWhitelist: config.externalLinkWhitelist,
userToken: req.user ? req.user.deleteToken : ''
}