Skip to content

Commit

Permalink
Release v1.1.0: Add PULL_URL option for docker pull customisation
Browse files Browse the repository at this point in the history
Closes: #71
  • Loading branch information
Joxit committed Feb 12, 2019
1 parent 14ca668 commit 8ac9118
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ This web user interface uses [Riot](https://github.com/Riot/riot) the react-like
- Display image history (see #58)
- Display image/tag count
- Image aggregation (see #56)
- Customise docker pull command on static registry UI (see #71)

## Getting Started

Expand Down Expand Up @@ -108,7 +109,8 @@ Some env options are available for use this interface for only one server.
- `URL`: set the static URL to use (You will need CORS configuration). Example: `http://127.0.0.1:5000`. (`Required`)
- `REGISTRY_URL`: your docker registry URL to contact (CORS configuration is not needed). Example: `http://my-docker-container:5000`. (Can't be used with `URL`, since 0.3.2).
- `DELETE_IMAGES`: if this variable is empty or `false`, delete feature is deactivated. It is activated otherwise.
- `REGISTRY_TITLE`: Set a custom title for your user interface when using `REGISTRY_URL` (since 0.3.4)
- `REGISTRY_TITLE`: Set a custom title for your user interface when using `REGISTRY_URL` (since 0.3.4).
- `PULL_URL`: Set a custom url for the docker pull command, this is useful when you use `REGISTRY_URL` and your registry is on a different host (since 1.1.0).

Example with `URL` option.

Expand Down
1 change: 1 addition & 0 deletions bin/entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
$@
sed -i "s,\${URL},${URL}," scripts/docker-registry-ui.js
sed -i "s,\${REGISTRY_TITLE},${REGISTRY_TITLE}," scripts/docker-registry-ui.js
sed -i "s,\${PULL_URL},${PULL_URL}," scripts/docker-registry-ui.js

if [ -z "${DELETE_IMAGES}" ] || [ "${DELETE_IMAGES}" = false ] ; then
sed -i -r "s/(isImageRemoveActivated[:=])[^,;]*/\1false/" scripts/docker-registry-ui.js
Expand Down
2 changes: 1 addition & 1 deletion dist/scripts/docker-registry-ui-static.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/scripts/docker-registry-ui.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "docker-registry-ui",
"version": "1.0.2",
"version": "1.1.0",
"scripts": {
"build": "./node_modules/gulp/bin/gulp.js build"
},
Expand Down
1 change: 1 addition & 0 deletions src/scripts/static.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ registryUI.url = function() {
registryUI.name = function() {
return '${REGISTRY_TITLE}' || registryUI.url();
};
registryUI.pullUrl = '${PULL_URL}';
registryUI.isImageRemoveActivated = true;
registryUI.catalog = {};
registryUI.taglist = {};
Expand Down
2 changes: 1 addition & 1 deletion src/tags/app.tag
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
return registryUI.snackbar(message, true);
};
registryUI.cleanName = function() {
const url = (registryUI.url() && registryUI.url().length > 0 && registryUI.url()) || window.location.host;
const url = registryUI.pullUrl || (registryUI.url() && registryUI.url().length > 0 && registryUI.url()) || window.location.host;
if (url) {
return url.startsWith('http') ? url.replace(/https?:\/\//, '') : url;
}
Expand Down

0 comments on commit 8ac9118

Please sign in to comment.