diff --git a/README.md b/README.md index e4c1575..09c39af 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ This web user interface use [Riot](https://github.com/Riot/riot) the react-like * List all tags for a repository/image * Sort the tag list * One interface for many registry + * Use a secured docker registry ## Getting Started ### Basic @@ -60,3 +61,19 @@ To run the docker and see the website on your 8080 port, try this : ```sh docker run -d -p 8080:8080 joxit/docker-registry-ui ``` + +## Using CORS + +Your server should be configured to accept CORS. + +If your docker registry does not need credentials, you will need to send this HEADER : +``` +Access-Control-Allow-Origin: '*' +``` + +If your docker registry need credentials, you will need to send these HEADERS : +``` +Access-Control-Allow-Origin: '' +Access-Control-Allow-Credentials: true +Access-Control-Allow-Methods: ['HEAD', 'GET', 'OPTIONS'] # Optional +``` diff --git a/catalog.tag b/catalog.tag index 2f44473..ad3a64c 100644 --- a/catalog.tag +++ b/catalog.tag @@ -72,7 +72,7 @@ registryUI.catalog.instance.update(); }); oReq.open('GET', registryUI.url() + '/v2/_catalog'); - oReq.withCredentials = false; + oReq.withCredentials = true; oReq.send(); }; this.on('updated', function () { diff --git a/taglist.tag b/taglist.tag index ee0f0c1..a1f18f7 100644 --- a/taglist.tag +++ b/taglist.tag @@ -85,7 +85,7 @@ registryUI.taglist.instance.update(); }); oReq.open('GET', registryUI.url() + '/v2/' + name + '/tags/list'); - oReq.withCredentials = false; + oReq.withCredentials = true; oReq.send(); } };