2023-06-18 21:38:27 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# Copyright (c) 2021-2023 tteck
|
|
|
|
# Author: tteck (tteckster)
|
|
|
|
# License: MIT
|
|
|
|
# https://github.com/tteck/Proxmox/raw/main/LICENSE
|
|
|
|
|
|
|
|
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
|
|
|
|
color
|
|
|
|
verb_ip6
|
|
|
|
catch_errors
|
|
|
|
setting_up_container
|
|
|
|
network_check
|
|
|
|
update_os
|
|
|
|
|
|
|
|
msg_info "Installing Dependencies"
|
|
|
|
$STD apt-get install -y curl
|
|
|
|
$STD apt-get install -y sudo
|
|
|
|
$STD apt-get install -y mc
|
|
|
|
msg_ok "Installed Dependencies"
|
|
|
|
|
|
|
|
msg_info "Installing OpenObserve"
|
2023-06-18 22:18:10 -04:00
|
|
|
mkdir -p /opt/openobserve/data
|
2023-06-18 21:38:27 -04:00
|
|
|
LATEST=$(curl -sL https://api.github.com/repos/openobserve/openobserve/releases/latest | grep '"tag_name":' | cut -d'"' -f4)
|
2023-06-18 22:15:31 -04:00
|
|
|
tar zxvf <(curl -fsSL https://github.com/openobserve/openobserve/releases/download/$LATEST/openobserve-${LATEST}-linux-amd64.tar.gz) -C /opt/openobserve &>/dev/null
|
2023-06-18 21:38:27 -04:00
|
|
|
|
|
|
|
cat <<EOF >/opt/openobserve/data/.env
|
|
|
|
ZO_ROOT_USER_EMAIL = "admin@example.com"
|
|
|
|
ZO_ROOT_USER_PASSWORD = "$(openssl rand -base64 18 | cut -c1-13)"
|
|
|
|
ZO_DATA_DIR = "/opt/openobserve/data"
|
|
|
|
ZO_HTTP_PORT = "5080"
|
|
|
|
EOF
|
|
|
|
msg_ok "Installed OpenObserve"
|
|
|
|
|
|
|
|
msg_info "Creating Service"
|
|
|
|
cat <<EOF >/etc/systemd/system/openobserve.service
|
|
|
|
[Unit]
|
|
|
|
Description=OpenObserve
|
2023-06-18 23:06:44 -04:00
|
|
|
After=network.target
|
2023-06-18 21:38:27 -04:00
|
|
|
|
|
|
|
[Service]
|
|
|
|
Type=simple
|
|
|
|
EnvironmentFile=/opt/openobserve/data/.env
|
|
|
|
ExecStart=/opt/openobserve/openobserve
|
|
|
|
ExecStop=killall -QUIT openobserve
|
|
|
|
Restart=on-failure
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|
|
|
|
EOF
|
2023-06-18 22:24:00 -04:00
|
|
|
systemctl enable -q --now openobserve
|
2023-06-18 21:38:27 -04:00
|
|
|
msg_ok "Created Service"
|
|
|
|
|
|
|
|
motd_ssh
|
|
|
|
customize
|
|
|
|
|
|
|
|
msg_info "Cleaning up"
|
|
|
|
$STD apt-get autoremove
|
|
|
|
$STD apt-get autoclean
|
|
|
|
msg_ok "Cleaned"
|