mirror of
https://github.com/Joxit/docker-registry-ui.git
synced 2025-04-26 23:19:54 +03:00
[app] unify error message for blocked access on Docker-Content-Digest
Signed-off-by: Jakob Ackermann <das7pad@outlook.com>
This commit is contained in:
parent
a2e81ac12c
commit
48aba129ce
5 changed files with 12 additions and 7 deletions
2
dist/scripts/docker-registry-ui-static.js
vendored
2
dist/scripts/docker-registry-ui-static.js
vendored
File diff suppressed because one or more lines are too long
2
dist/scripts/docker-registry-ui.js
vendored
2
dist/scripts/docker-registry-ui.js
vendored
File diff suppressed because one or more lines are too long
|
@ -92,6 +92,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
registryUI.errorSnackbar = function(message) {
|
||||
return registryUI.snackbar(message, true);
|
||||
};
|
||||
registryUI.showErrorCanNotReadContentDigest = function() {
|
||||
registryUI.errorSnackbar(
|
||||
'Access on registry response was blocked. Try adding the header ' +
|
||||
'`Access-Control-Expose-Headers: Docker-Content-Digest`' +
|
||||
' to your proxy or registry: ' +
|
||||
'https://docs.docker.com/registry/configuration/#http'
|
||||
);
|
||||
};
|
||||
registryUI.cleanName = function() {
|
||||
const url = registryUI.pullUrl || (registryUI.url() && registryUI.url().length > 0 && registryUI.url()) || window.location.host;
|
||||
return registryUI.stripHttps(url);
|
||||
|
|
|
@ -37,10 +37,7 @@
|
|||
|
||||
this.copy = function () {
|
||||
if (!self.dockerCmd) {
|
||||
registryUI.errorSnackbar(
|
||||
'Your browser has no SHA256 support. As a workaround your registry ' +
|
||||
' can set the header `Access-Control-Expose-Headers: Docker-Content-Digest`.'
|
||||
);
|
||||
registryUI.showErrorCanNotReadContentDigest();
|
||||
return;
|
||||
}
|
||||
const copyText = this.refs['input'];
|
||||
|
|
|
@ -38,7 +38,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
registryUI.taglist.go(name);
|
||||
if (this.status == 200) {
|
||||
if (!this.hasHeader('Docker-Content-Digest')) {
|
||||
registryUI.errorSnackbar('You need to add Access-Control-Expose-Headers: [\'Docker-Content-Digest\'] in your server configuration.');
|
||||
registryUI.showErrorCanNotReadContentDigest();
|
||||
return;
|
||||
}
|
||||
const digest = this.getResponseHeader('Docker-Content-Digest');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue