From 83c33e9d059123feaa8d2a0323dbf7d74064ae9e Mon Sep 17 00:00:00 2001 From: Lukas Engelter Date: Sat, 8 Nov 2025 01:22:51 +0100 Subject: [PATCH] feat: add `DOCKER_REGISTRY_UI_TITLE` and `ENABLE_VERSION_NOTIFICATION` (#369) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feature: link title to main view this way it is possible to go back to the main view, even if two layers deep, i.e. in the history view. * feature: allow the customization of the title shown in the logo section we already have REGISTRY_TITLE, but it is used as a reference to where the images come from: "Repositories of …". The UI however does not need to be used in a 1:1 context of the registry. Therefore, the project would benefit from this feature: We therefore introduce "DOCKER_REGISTRY_UI_TITLE" as a new option, that optionally allows to change the title for more advanced customization and to enable more use cases for this software. If it is not set, everything will stay the same as prior to this commit and the title will remain "Docker Registry UI" Note, that the footer will always contain a reference to this project. I think it doesn't need to referenced twice, and makes room for some more customization. * feature: allow to optionally disable the version check Note: The default remains to have the version check enabled. It is though sometimes useful to disable it, in the context of customers or open source interests of your software not to bother with version updates to Docker Registry UI. For example, if you use something like watchtower anyway, there is no need to bother with update notifications to anyone else other then the admin of the server. * fix: wrongly named environment variable in error template The environment variables named in the CATALOG_BRANCHING_CONFIGURATION error were wrong. During that find, i found out that one needs to set both min and max to 0 to disable branching. I tried to make this clear in the README.md file. * feat: update title and version notification options Version check done every week instead of every days --------- Co-authored-by: Joxit --- README.md | 6 ++++-- bin/90-docker-registry-ui.sh | 2 ++ src/components/docker-registry-ui.riot | 15 +++++++++++++-- src/components/error-page.riot | 2 +- src/components/version-notification.riot | 2 +- src/index.html | 4 ++++ 6 files changed, 25 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index a712d6f..d2a505d 100644 --- a/README.md +++ b/README.md @@ -115,12 +115,14 @@ Some env options are available for use this interface for **only one server** (w - `THEME_*`: See table in [Theme options](#theme-options) section (see [#283](https://github.com/Joxit/docker-registry-ui/pull/283)). Since 2.4.0 - `TAGLIST_ORDER`: Set the default order for the taglist page, could be `num-asc;alpha-asc`, `num-desc;alpha-asc`, `num-asc;alpha-desc`, `num-desc;alpha-desc`, `alpha-asc;num-asc`, `alpha-asc;num-desc`, `alpha-desc;num-asc` or `alpha-desc;num-desc` (see [#307](https://github.com/Joxit/docker-registry-ui/pull/307)). (default: `alpha-asc;num-desc`). Since 2.5.0 - `CATALOG_DEFAULT_EXPANDED`: Expand by default all repositories in catalog (see [#302](https://github.com/Joxit/docker-registry-ui/issues/302)). (default: `false`). Since 2.5.0 -- `CATALOG_MIN_BRANCHES`: Set the minimum repository/namespace to expand (e.g. `joxit/docker-registry-ui` `joxit/` is the repository/namespace). Can be 0 to disable branching. (see [#319](https://github.com/Joxit/docker-registry-ui/pull/319)). (default: `1`). Since 2.5.0 -- `CATALOG_MAX_BRANCHES`: Set the maximum repository/namespace to expand (e.g. `joxit/docker-registry-ui` `joxit/` is the repository/namespace). Can be 0 to disable branching. (see [#319](https://github.com/Joxit/docker-registry-ui/pull/319)). (default: `1`). Since 2.5.0 +- `CATALOG_MIN_BRANCHES`: Set the minimum repository/namespace to expand (e.g. `joxit/docker-registry-ui` `joxit/` is the repository/namespace). Branching can be disabled if min and max are set to 0. (see [#319](https://github.com/Joxit/docker-registry-ui/pull/319)). (default: `1`). Since 2.5.0 +- `CATALOG_MAX_BRANCHES`: Set the maximum repository/namespace to expand (e.g. `joxit/docker-registry-ui` `joxit/` is the repository/namespace). Branching can be disabled if min and max are set to 0. (see [#319](https://github.com/Joxit/docker-registry-ui/pull/319)). (default: `1`). Since 2.5.0 - `TAGLIST_PAGE_SIZE`: Set the number of tags to display in one page. (default: `100`). Since 2.5.0 - `REGISTRY_SECURED`: By default, the UI will check on every requests if your registry is secured or not (you will see `401` responses in your console). Set to `true` if your registry uses Basic Authentication and divide by two the number of call to your registry. (default `false`). Since 2.5.0 - `SHOW_TAG_HISTORY`: Whether to show the tag history feature or not. Allows to simplify the user interface by hiding it form the tag list if set to `false`. (default: `true`). There are some examples with [docker-compose](https://docs.docker.com/compose/) and docker-registry-ui as proxy [here](https://github.com/Joxit/docker-registry-ui/tree/main/examples/ui-as-proxy/) or docker-registry-ui as standalone [here](https://github.com/Joxit/docker-registry-ui/tree/main/examples/ui-as-standalone/). +- `DOCKER_REGISTRY_UI_TITLE`: Set a custom title displayed in the header bar. (default: `Docker Registry UI`). +- `ENABLE_VERSION_NOTIFICATION`: Display notification when a new version of Docker Registry UI is available. This is a weekly check. (default: `true`). ### Theme options diff --git a/bin/90-docker-registry-ui.sh b/bin/90-docker-registry-ui.sh index 65c53d6..85baa5e 100755 --- a/bin/90-docker-registry-ui.sh +++ b/bin/90-docker-registry-ui.sh @@ -1,5 +1,6 @@ #!/bin/sh +sed -i "s~\${DOCKER_REGISTRY_UI_TITLE}~${DOCKER_REGISTRY_UI_TITLE}~" index.html sed -i "s~\${REGISTRY_URL}~${REGISTRY_URL}~" index.html sed -i "s~\${REGISTRY_TITLE}~${REGISTRY_TITLE}~" index.html sed -i "s~\${PULL_URL}~${PULL_URL}~" index.html @@ -18,6 +19,7 @@ sed -i "s~\${CATALOG_MIN_BRANCHES}~${CATALOG_MIN_BRANCHES}~" index.html sed -i "s~\${CATALOG_MAX_BRANCHES}~${CATALOG_MAX_BRANCHES}~" index.html sed -i "s~\${TAGLIST_PAGE_SIZE}~${TAGLIST_PAGE_SIZE}~" index.html sed -i "s~\${REGISTRY_SECURED}~${REGISTRY_SECURED}~" index.html +sed -i "s~\${ENABLE_VERSION_NOTIFICATION}~${ENABLE_VERSION_NOTIFICATION}~" index.html grep -o 'THEME[A-Z_]*' index.html | while read e; do sed -i "s~\${$e}~$(printenv $e)~" index.html diff --git a/src/components/docker-registry-ui.riot b/src/components/docker-registry-ui.riot index 5357cae..3f04850 100644 --- a/src/components/docker-registry-ui.riot +++ b/src/components/docker-registry-ui.riot @@ -18,8 +18,12 @@ along with this program. If not, see .