Merge pull request #10 from Joxit/credentials

[Credentials] Add credentials feature for issue #9
This commit is contained in:
Jones Magloire
2016-06-13 23:26:19 +02:00
committed by GitHub
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();
}
};