[Credentials] Add credentials feature

This commit is contained in:
Joxit 2016-06-12 14:12:32 +02:00
parent f92c5ceced
commit cf2db37e3a
3 changed files with 19 additions and 2 deletions

View file

@ -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: '<your docker-registry-ui url>'
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: ['HEAD', 'GET', 'OPTIONS'] # Optional
```

View file

@ -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 () {

View file

@ -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();
}
};