Release v1.1.0: Add PULL_URL option for docker pull customisation

Closes: #71
This commit is contained in:
Joxit 2019-02-12 23:06:46 +01:00
parent 14ca668d7f
commit 8ac91180d7
No known key found for this signature in database
GPG key ID: F526592B8E012263
7 changed files with 9 additions and 5 deletions

View file

@ -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 history (see #58)
- Display image/tag count - Display image/tag count
- Image aggregation (see #56) - Image aggregation (see #56)
- Customise docker pull command on static registry UI (see #71)
## Getting Started ## Getting Started
@ -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`) - `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). - `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. - `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. Example with `URL` option.

View file

@ -2,6 +2,7 @@
$@ $@
sed -i "s,\${URL},${URL}," scripts/docker-registry-ui.js 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,\${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 if [ -z "${DELETE_IMAGES}" ] || [ "${DELETE_IMAGES}" = false ] ; then
sed -i -r "s/(isImageRemoveActivated[:=])[^,;]*/\1false/" scripts/docker-registry-ui.js sed -i -r "s/(isImageRemoveActivated[:=])[^,;]*/\1false/" scripts/docker-registry-ui.js

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,6 +1,6 @@
{ {
"name": "docker-registry-ui", "name": "docker-registry-ui",
"version": "1.0.2", "version": "1.1.0",
"scripts": { "scripts": {
"build": "./node_modules/gulp/bin/gulp.js build" "build": "./node_modules/gulp/bin/gulp.js build"
}, },

View file

@ -21,6 +21,7 @@ registryUI.url = function() {
registryUI.name = function() { registryUI.name = function() {
return '${REGISTRY_TITLE}' || registryUI.url(); return '${REGISTRY_TITLE}' || registryUI.url();
}; };
registryUI.pullUrl = '${PULL_URL}';
registryUI.isImageRemoveActivated = true; registryUI.isImageRemoveActivated = true;
registryUI.catalog = {}; registryUI.catalog = {};
registryUI.taglist = {}; registryUI.taglist = {};

View file

@ -93,7 +93,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
return registryUI.snackbar(message, true); return registryUI.snackbar(message, true);
}; };
registryUI.cleanName = function() { 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) { if (url) {
return url.startsWith('http') ? url.replace(/https?:\/\//, '') : url; return url.startsWith('http') ? url.replace(/https?:\/\//, '') : url;
} }