Refactor: OpenObserve (#10279)

This commit is contained in:
Slaviša Arežina
2025-12-25 15:22:24 +01:00
committed by GitHub
parent 97211b41b7
commit e6ee6e66bf
2 changed files with 15 additions and 10 deletions
+10 -7
View File
@@ -27,13 +27,16 @@ function update_script() {
msg_error "No ${APP} Installation Found!" msg_error "No ${APP} Installation Found!"
exit exit
fi fi
msg_info "Updating $APP"
systemctl stop openobserve if check_for_gh_release "openobserve" "openobserve/openobserve"; then
LATEST=$(curl -fsSL https://api.github.com/repos/openobserve/openobserve/releases/latest | grep '"tag_name":' | cut -d'"' -f4) msg_info "Updating OpenObserve"
$STD tar zxvf <(curl -fsSL https://downloads.openobserve.ai/releases/openobserve/$LATEST/openobserve-$LATEST-linux-amd64.tar.gz) -C /opt/openobserve systemctl stop openobserve
systemctl start openobserve RELEASE=$(get_latest_github_release "openobserve/openobserve")
msg_ok "Updated $APP" tar zxf <(curl -fsSL https://downloads.openobserve.ai/releases/openobserve/v$RELEASE/openobserve-v$RELEASE-linux-amd64.tar.gz) -C /opt/openobserve
msg_ok "Updated successfully!" systemctl start openobserve
msg_ok "Updated OpenObserve"
msg_ok "Updated successfully!"
fi
exit exit
} }
+5 -3
View File
@@ -15,15 +15,17 @@ update_os
msg_info "Installing OpenObserve" msg_info "Installing OpenObserve"
mkdir -p /opt/openobserve/data mkdir -p /opt/openobserve/data
LATEST=$(curl -fsSL https://api.github.com/repos/openobserve/openobserve/releases/latest | grep '"tag_name":' | cut -d'"' -f4) RELEASE=$(get_latest_github_release "openobserve/openobserve")
$STD tar zxvf <(curl -fsSL https://downloads.openobserve.ai/releases/openobserve/$LATEST/openobserve-$LATEST-linux-amd64.tar.gz) -C /opt/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 <<EOF >/opt/openobserve/data/.env cat <<EOF >/opt/openobserve/data/.env
ZO_ROOT_USER_EMAIL = "admin@example.com" 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_DATA_DIR = "/opt/openobserve/data"
ZO_HTTP_PORT = "5080" ZO_HTTP_PORT = "5080"
EOF EOF
echo "${RELEASE}" >>~/.openobserve
msg_ok "Installed OpenObserve" msg_ok "Installed OpenObserve"
msg_info "Creating Service" msg_info "Creating Service"