From f5158e5d7ca7b2528bc5433c168fdd6ad06d5ef7 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 5 Jun 2025 10:50:42 +0200 Subject: [PATCH] zot update --- ct/zot-registry.sh | 27 ++++++++++---- .../public/json/{ => deferred}/polaris.json | 0 frontend/public/json/zot-registry.json | 35 +++++++++++++++++++ install/zot-registry-install.sh | 6 ++++ 4 files changed, 62 insertions(+), 6 deletions(-) rename frontend/public/json/{ => deferred}/polaris.json (100%) create mode 100644 frontend/public/json/zot-registry.json diff --git a/ct/zot-registry.sh b/ct/zot-registry.sh index eda50bc3..c19054dd 100644 --- a/ct/zot-registry.sh +++ b/ct/zot-registry.sh @@ -23,14 +23,29 @@ function update_script() { header_info check_container_storage check_container_resources - if [[ ! -d /var ]]; then - msg_error "No ${APP} Installation Found!" + + if [[ ! -f /usr/bin/zot ]]; then + msg_error "No ${APP} installation found!" exit fi - msg_info "Updating $APP LXC" - $STD apt-get update - $STD apt-get -y upgrade - msg_ok "Updated $APP LXC" + + RELEASE=$(curl -fsSL https://api.github.com/repos/project-zot/zot/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}') + if [[ ! -f ~/.${APP} ]] || [[ "${RELEASE}" != "$(cat ~/.${APP})" ]]; then + msg_info "Stopping Zot service" + systemctl stop zot + msg_ok "Stopped Zot service" + + msg_info "Updating Zot to ${RELEASE}" + curl -fsSL "https://github.com/project-zot/zot/releases/download/${RELEASE}/zot-linux-amd64" -o /usr/bin/zot + chmod +x /usr/bin/zot + chown root:root /usr/bin/zot + echo "${RELEASE}" >~/.${APP} + systemctl restart zot + msg_ok "Updated Zot to ${RELEASE}" + else + msg_ok "Zot is already up to date (${RELEASE})" + fi + exit } diff --git a/frontend/public/json/polaris.json b/frontend/public/json/deferred/polaris.json similarity index 100% rename from frontend/public/json/polaris.json rename to frontend/public/json/deferred/polaris.json diff --git a/frontend/public/json/zot-registry.json b/frontend/public/json/zot-registry.json new file mode 100644 index 00000000..82564017 --- /dev/null +++ b/frontend/public/json/zot-registry.json @@ -0,0 +1,35 @@ +{ + "name": "Zot Registry", + "slug": "zot", + "categories": [ + 13 + ], + "date_created": "2025-06-05", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": 8080, + "documentation": "https://zotregistry.dev/docs/intro/", + "website": "https://zotregistry.dev/", + "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/zot-registry.webp", + "config_path": "/etc/zot/config.json", + "description": "Zot is a cloud-native OCI image registry focused on extensibility, maintainability, and performance. It supports advanced features such as Web UI, security scanning, authentication via htpasswd and OIDC, and more.", + "install_methods": [ + { + "type": "default", + "script": "ct/zot-registry.sh", + "resources": { + "cpu": 2, + "ram": 1024, + "hdd": 3, + "os": "Debian", + "version": "12" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [] +} diff --git a/install/zot-registry-install.sh b/install/zot-registry-install.sh index 6a4a4f5f..adbbc026 100644 --- a/install/zot-registry-install.sh +++ b/install/zot-registry-install.sh @@ -26,6 +26,12 @@ mkdir -p /etc/zot curl -fsSL https://raw.githubusercontent.com/project-zot/zot/refs/heads/main/examples/config-ui.json -o /etc/zot/config.json ZOTPASSWORD=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13) $STD htpasswd -b -B -c /etc/zot/htpasswd admin "$ZOTPASSWORD" +{ + echo "Zot-Credentials" + echo "Zot User: admin" + echo "Zot Password: $ZOTPASSWORD" +} >>~/zot.creds +echo "${RELEASE}" >~/.${APP} msg_ok "Installed Zot Registry" msg_info "Setup Service"