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:
committed by
Philip Molares
parent
d20619315e
commit
0ebf0dbc6b
@@ -5,6 +5,7 @@
|
||||
### Enhancements
|
||||
|
||||
- Added external link whitelist setting (`externalLinkWhitelist` in config.json or `CMD_EXTERNAL_LINK_WHITELIST`) to skip warning page for certain domains
|
||||
- Added external link warning setting (`externalLinkWarning` in config.json or `CMD_EXTERNAL_LINK_WARNING`) to disable the external link warning page entirely
|
||||
- Enabled `.webp` for file uploads (for all backends but `imgur`, since it does not support it)
|
||||
|
||||
### Bugfixes
|
||||
|
||||
@@ -592,6 +592,9 @@ window.postProcess = postProcess
|
||||
|
||||
// rewrite external links to go through the /_link warning page
|
||||
export function rewriteExternalLinks (view) {
|
||||
if (window.externalLinkWarning === false) {
|
||||
return
|
||||
}
|
||||
const whitelist = window.externalLinkWhitelist || []
|
||||
view.find('a[href]').each((index, linkTag) => {
|
||||
const anchor = $(linkTag)
|
||||
|
||||
@@ -8,6 +8,7 @@ window.allowedUploadMimeTypes = <%- JSON.stringify(allowedUploadMimeTypes) %>
|
||||
|
||||
window.linkifyHeaderStyle = '<%- linkifyHeaderStyle %>'
|
||||
|
||||
window.externalLinkWarning = <%- JSON.stringify(externalLinkWarning) %>
|
||||
window.externalLinkWhitelist = <%- JSON.stringify(externalLinkWhitelist) %>
|
||||
|
||||
window.DROPBOX_APP_KEY = '<%- DROPBOX_APP_KEY %>'
|
||||
|
||||
Reference in New Issue
Block a user