diff --git a/server-ce/config/settings.js b/server-ce/config/settings.js index a7e8219858..47d34fd870 100644 --- a/server-ce/config/settings.js +++ b/server-ce/config/settings.js @@ -184,7 +184,10 @@ const settings = { siteUrl: (siteUrl = process.env.OVERLEAF_SITE_URL || 'http://localhost'), // Status page URL as displayed on the maintenance/500 pages. - statusPageUrl: process.env.OVERLEAF_STATUS_PAGE_URL, + statusPageUrl: process.env.OVERLEAF_STATUS_PAGE_URL ? + // Add https:// protocol prefix if not set (Allow plain-text http:// for Server Pro/CE). + (process.env.OVERLEAF_STATUS_PAGE_URL.startsWith('http://') || process.env.OVERLEAF_STATUS_PAGE_URL.startsWith('https://')) ? process.env.OVERLEAF_STATUS_PAGE_URL : `https://${process.env.OVERLEAF_STATUS_PAGE_URL}` + : undefined, // The name this is used to describe your Overleaf Community Edition Installation appName: process.env.OVERLEAF_APP_NAME || 'Overleaf Community Edition', diff --git a/services/web/app/src/Features/Errors/HttpErrorHandler.js b/services/web/app/src/Features/Errors/HttpErrorHandler.js index c3fab886fa..0908a1b3e2 100644 --- a/services/web/app/src/Features/Errors/HttpErrorHandler.js +++ b/services/web/app/src/Features/Errors/HttpErrorHandler.js @@ -146,7 +146,7 @@ module.exports = HttpErrorHandler = { } let message = `${Settings.appName} is currently down for maintenance.` if (Settings.statusPageUrl) { - message += ` Please check https://${Settings.statusPageUrl} for updates.` + message += ` Please check ${Settings.statusPageUrl} for updates.` } switch (req.accepts(['html', 'json'])) { case 'html': diff --git a/services/web/app/views/general/400.pug b/services/web/app/views/general/400.pug index 5dad09910f..48d1fff5eb 100644 --- a/services/web/app/views/general/400.pug +++ b/services/web/app/views/general/400.pug @@ -22,7 +22,7 @@ block body | Please go back and try again. | If the problem persists, please contact us at | - a(href='mailto:' + settings.adminEmail) #{settings.adminEmail} + a(href='mailto:' + settings.adminEmail target='_blank') #{settings.adminEmail} | . p.error-actions a.error-btn(href='javascript:history.back()') Back diff --git a/services/web/app/views/general/500.pug b/services/web/app/views/general/500.pug index 22d6ceb35c..4ee242f242 100644 --- a/services/web/app/views/general/500.pug +++ b/services/web/app/views/general/500.pug @@ -10,14 +10,20 @@ block body .error-container.full-height .error-details p.error-status Something went wrong, sorry. - p.error-description Our staff are probably looking into this, but if it continues, please check our status page at + if settings.statusPageUrl + p.error-description Our staff are probably looking into this, but if it continues, please check our status page at + | + | + a(href=settings.statusPageUrl target='_blank') #{new URL(settings.statusPageUrl).hostname} + | + | or contact us at + | + a(href='mailto:' + settings.adminEmail target='_blank') #{settings.adminEmail} + | . + else + | If the problem persists, please contact us at | - | - a(href='http://' + settings.statusPageUrl) #{settings.statusPageUrl} - | - | or contact us at - | - a(href='mailto:' + settings.adminEmail) #{settings.adminEmail} + a(href='mailto:' + settings.adminEmail target='_blank') #{settings.adminEmail} | . p.error-actions a.error-btn(href='/') Home diff --git a/services/web/app/views/general/closed.pug b/services/web/app/views/general/closed.pug index 3c1196a4cc..5725e35ea6 100644 --- a/services/web/app/views/general/closed.pug +++ b/services/web/app/views/general/closed.pug @@ -10,7 +10,7 @@ block content p if settings.statusPageUrl | #{settings.appName} is currently down for maintenance. - | Please check our #[a(href='https://' + settings.statusPageUrl) status page] + | Please check our #[a(href=settings.statusPageUrl target='_blank') status page] | for updates. else | #{settings.appName} is currently down for maintenance. diff --git a/services/web/app/views/general/unsupported-browser.pug b/services/web/app/views/general/unsupported-browser.pug index 1fd2c42bdb..fbe6c218eb 100644 --- a/services/web/app/views/general/unsupported-browser.pug +++ b/services/web/app/views/general/unsupported-browser.pug @@ -15,7 +15,7 @@ block body br | If you think you're seeing this message in error, | - a(href='mailto:' + settings.adminEmail) please let us know + a(href='mailto:' + settings.adminEmail target='_blank') please let us know | . if fromURL @@ -33,7 +33,7 @@ block body p | Support for beta or developer-preview browser versions cannot be guaranteed. Please | - a(href='mailto:' + settings.adminEmail) get in touch + a(href='mailto:' + settings.adminEmail target='_blank') get in touch | | if you encounter any issues while using the service with beta or developer-preview releases of supported browsers. p @@ -41,5 +41,5 @@ block body p | If you cannot upgrade to one of the supported browsers, | - a(href='mailto:' + settings.adminEmail) please let us know + a(href='mailto:' + settings.adminEmail target='_blank') please let us know | . diff --git a/services/web/test/acceptance/config/settings.test.defaults.js b/services/web/test/acceptance/config/settings.test.defaults.js index b4a7006951..860b5e2066 100644 --- a/services/web/test/acceptance/config/settings.test.defaults.js +++ b/services/web/test/acceptance/config/settings.test.defaults.js @@ -24,7 +24,7 @@ module.exports = { ? JSON.parse(process.env.ADMIN_DOMAINS) : ['example.com'], - statusPageUrl: 'status.example.com', + statusPageUrl: 'https://status.example.com', cdn: { web: { host: 'cdn.example.com',