diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-02-29 12:21:36 +0100 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-02-29 12:21:36 +0100 |
commit | ca246dc35c76390e26108d3c14e640f3f2d682bf (patch) | |
tree | c5f118518c3b438990c6572b12494065f104d30f /core | |
parent | 747c39195350023d78f2ae9a651fe57e6096f12f (diff) | |
download | nextcloud-server-ca246dc35c76390e26108d3c14e640f3f2d682bf.tar.gz nextcloud-server-ca246dc35c76390e26108d3c14e640f3f2d682bf.zip |
feat(settings): Migrate SSL access and URL generation check to SetupCheck API
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'core')
-rw-r--r-- | core/js/setupchecks.js | 15 | ||||
-rw-r--r-- | core/js/tests/specs/setupchecksSpec.js | 11 |
2 files changed, 0 insertions, 26 deletions
diff --git a/core/js/setupchecks.js b/core/js/setupchecks.js index 598fb541136..de1a788ee95 100644 --- a/core/js/setupchecks.js +++ b/core/js/setupchecks.js @@ -105,14 +105,6 @@ var afterCall = function(data, statusText, xhr) { var messages = []; if (xhr.status === 200 && data) { - if (window.location.protocol === 'https:' && data.reverseProxyGeneratedURL.split('/')[0] !== 'https:') { - messages.push({ - msg: t('core', 'You are accessing your instance over a secure connection, however your instance is generating insecure URLs. This most likely means that you are behind a reverse proxy and the overwrite config variables are not set correctly. Please read {linkstart}the documentation page about this ↗{linkend}.') - .replace('{linkstart}', '<a target="_blank" rel="noreferrer noopener" class="external" href="' + data.reverseProxyDocs + '">') - .replace('{linkend}', '</a>'), - type: OC.SetupChecks.MESSAGE_TYPE_WARNING - }) - } if (Object.keys(data.generic).length > 0) { Object.keys(data.generic).forEach(function(key){ Object.keys(data.generic[key]).forEach(function(title){ @@ -366,13 +358,6 @@ type: OC.SetupChecks.MESSAGE_TYPE_WARNING }); } - } else if (!/(?:^(?:localhost|127\.0\.0\.1|::1)|\.onion)$/.exec(window.location.hostname)) { - messages.push({ - msg: t('core', 'Accessing site insecurely via HTTP. You are strongly advised to set up your server to require HTTPS instead, as described in the {linkstart}security tips ↗{linkend}. Without it some important web functionality like "copy to clipboard" or "service workers" will not work!') - .replace('{linkstart}', '<a target="_blank" rel="noreferrer noopener" class="external" href="' + tipsUrl + '">') - .replace('{linkend}', '</a>'), - type: OC.SetupChecks.MESSAGE_TYPE_ERROR - }); } } else { messages.push({ diff --git a/core/js/tests/specs/setupchecksSpec.js b/core/js/tests/specs/setupchecksSpec.js index 0f042c19942..f6aa98f9b4a 100644 --- a/core/js/tests/specs/setupchecksSpec.js +++ b/core/js/tests/specs/setupchecksSpec.js @@ -160,7 +160,6 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json' }, JSON.stringify({ - reverseProxyGeneratedURL: 'https://server', generic: { network: { "Internet connectivity": { @@ -193,7 +192,6 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json' }, JSON.stringify({ - reverseProxyGeneratedURL: 'https://server', generic: { network: { "Internet connectivity": { @@ -226,7 +224,6 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json', }, JSON.stringify({ - reverseProxyGeneratedURL: 'https://server', generic: { network: { "Internet connectivity": { @@ -259,8 +256,6 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json', }, JSON.stringify({ - reverseProxyDocs: 'https://docs.nextcloud.com/foo/bar.html', - reverseProxyGeneratedURL: 'https://server', generic: { network: { "Internet connectivity": { @@ -323,7 +318,6 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json', }, JSON.stringify({ - reverseProxyGeneratedURL: 'https://server', generic: { network: { "Internet connectivity": { @@ -365,8 +359,6 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json', }, JSON.stringify({ - reverseProxyDocs: 'https://docs.nextcloud.com/foo/bar.html', - reverseProxyGeneratedURL: 'http://server', generic: { network: { "Internet connectivity": { @@ -397,8 +389,6 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json', }, JSON.stringify({ - reverseProxyDocs: 'https://docs.nextcloud.com/foo/bar.html', - reverseProxyGeneratedURL: 'http://server', generic: { network: { "Internet connectivity": { @@ -426,7 +416,6 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json', }, JSON.stringify({ - reverseProxyGeneratedURL: 'https://server', generic: { network: { "Internet connectivity": { |