From e6ee6e66bf11fd6f0ca9cf88d7f2ac037127563b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Slavi=C5=A1a=20Are=C5=BEina?= <58952836+tremor021@users.noreply.github.com> Date: Thu, 25 Dec 2025 15:22:24 +0100 Subject: [PATCH] Refactor: OpenObserve (#10279) --- ct/openobserve.sh | 17 ++++++++++------- install/openobserve-install.sh | 8 +++++--- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/ct/openobserve.sh b/ct/openobserve.sh index 3507d6726..b3870239d 100644 --- a/ct/openobserve.sh +++ b/ct/openobserve.sh @@ -27,13 +27,16 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - msg_info "Updating $APP" - systemctl stop openobserve - LATEST=$(curl -fsSL https://api.github.com/repos/openobserve/openobserve/releases/latest | grep '"tag_name":' | cut -d'"' -f4) - $STD tar zxvf <(curl -fsSL https://downloads.openobserve.ai/releases/openobserve/$LATEST/openobserve-$LATEST-linux-amd64.tar.gz) -C /opt/openobserve - systemctl start openobserve - msg_ok "Updated $APP" - msg_ok "Updated successfully!" + + if check_for_gh_release "openobserve" "openobserve/openobserve"; then + msg_info "Updating OpenObserve" + systemctl stop openobserve + RELEASE=$(get_latest_github_release "openobserve/openobserve") + tar zxf <(curl -fsSL https://downloads.openobserve.ai/releases/openobserve/v$RELEASE/openobserve-v$RELEASE-linux-amd64.tar.gz) -C /opt/openobserve + systemctl start openobserve + msg_ok "Updated OpenObserve" + msg_ok "Updated successfully!" + fi exit } diff --git a/install/openobserve-install.sh b/install/openobserve-install.sh index cc520f84a..47f2b3363 100644 --- a/install/openobserve-install.sh +++ b/install/openobserve-install.sh @@ -15,15 +15,17 @@ update_os msg_info "Installing OpenObserve" mkdir -p /opt/openobserve/data -LATEST=$(curl -fsSL https://api.github.com/repos/openobserve/openobserve/releases/latest | grep '"tag_name":' | cut -d'"' -f4) -$STD tar zxvf <(curl -fsSL https://downloads.openobserve.ai/releases/openobserve/$LATEST/openobserve-$LATEST-linux-amd64.tar.gz) -C /opt/openobserve +RELEASE=$(get_latest_github_release "openobserve/openobserve") +tar zxf <(curl -fsSL https://downloads.openobserve.ai/releases/openobserve/v$RELEASE/openobserve-v$RELEASE-linux-amd64.tar.gz) -C /opt/openobserve +ROOT_PASS=$(openssl rand -base64 18 | cut -c1-13) cat </opt/openobserve/data/.env ZO_ROOT_USER_EMAIL = "admin@example.com" -ZO_ROOT_USER_PASSWORD = "$(openssl rand -base64 18 | cut -c1-13)" +ZO_ROOT_USER_PASSWORD = "${ROOT_PASS}" ZO_DATA_DIR = "/opt/openobserve/data" ZO_HTTP_PORT = "5080" EOF +echo "${RELEASE}" >>~/.openobserve msg_ok "Installed OpenObserve" msg_info "Creating Service"