Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 10 additions & 51 deletions ct/openviking.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,24 @@ source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_

APP="OpenViking"
var_tags="${var_tags:-ai;memory;rag}"
var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-2048}"
var_disk="${var_disk:-8}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
var_arm64="${var_arm64:-yes}"
var_unprivileged="${var_unprivileged:-1}"
if [[ -z "${var_os:-}" ]] && command -v pveversion >/dev/null 2>&1; then
var_os=$(msg_menu "Choose the container OS" \
"debian" "Debian 13 (recommended)" \
"alpine" "Alpine 3.24 (smaller footprint)")
fi

if [[ "${var_os:-}" == "alpine" ]]; then
var_cpu="${var_cpu:-1}"
var_ram="${var_ram:-1024}"
var_disk="${var_disk:-8}"
var_version="${var_version:-3.24}"
else
var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-2048}"
var_disk="${var_disk:-8}"
var_version="${var_version:-13}"
fi

header_info "$APP"
variables
color
catch_errors

update_deb_based() {
function update_script() {
header_info
check_container_storage
check_container_resources

if [[ ! -d /opt/openviking ]]; then
msg_error "No ${APP} Installation Found!"
exit
Expand All @@ -62,39 +54,6 @@ update_deb_based() {
msg_ok "Started Service"
msg_ok "Updated successfully!"
fi
}

update_alpine() {
if [[ ! -d /opt/openviking ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi

msg_info "Updating Alpine Packages"
$STD apk -U upgrade
msg_ok "Updated Alpine Packages"

if check_for_gh_release "openviking-server" "volcengine/OpenViking"; then
msg_info "Stopping Service"
$STD rc-service openviking stop
msg_ok "Stopped Service"

msg_info "Updating ${APP}"
$STD uv pip install --python /opt/openviking/bin/python --upgrade openviking
msg_ok "Updated ${APP}"

msg_info "Starting Service"
$STD rc-service openviking start
msg_ok "Started Service"
msg_ok "Updated successfully!"
fi
}

function update_script() {
header_info
check_container_storage
check_container_resources
run_os_update
exit
}

Expand Down
69 changes: 12 additions & 57 deletions install/openviking-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,28 +63,27 @@ EOF

_ov_wait_ready() {
local ready=0
for _ in {1..30}; do
for _ in {1..60}; do
if curl -fsS -o /dev/null "http://127.0.0.1:1933/health"; then
ready=1
break
fi
sleep 2
done
if [[ "$ready" -ne 1 ]]; then
msg_error "OpenViking did not become healthy within 60 seconds — check 'systemctl status openviking' (Debian) or 'rc-service openviking status' (Alpine)"
msg_error "OpenViking did not become healthy within 120 seconds — check 'systemctl status openviking'"
exit 1
fi
}

setup_deb_based() {
msg_info "Installing Dependencies"
$STD apt install -y openssl
msg_ok "Installed Dependencies"
msg_info "Installing Dependencies"
$STD apt install -y openssl
msg_ok "Installed Dependencies"

_ov_install_server
_ov_install_server
Comment thread
mfelipe marked this conversation as resolved.
Outdated

msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/openviking.service
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/openviking.service
[Unit]
Description=OpenViking HTTP Server
After=network.target
Expand All @@ -101,53 +100,9 @@ RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now openviking
_ov_wait_ready
msg_ok "Created Service"
}

setup_alpine() {
msg_info "Installing Dependencies"
$STD apk add openssl
msg_ok "Installed Dependencies"

_ov_install_server

msg_info "Creating Service"
cat <<'EOF' >/etc/init.d/openviking
#!/sbin/openrc-run
name="OpenViking"
description="OpenViking - a self-evolving context database for AI agents"

command="/opt/openviking/bin/openviking-server"
command_user="root"
supervisor=supervise-daemon
output_log="/var/log/openviking.log"
error_log="/var/log/openviking.log"
pidfile="/run/${RC_SVCNAME}.pid"
respawn_delay=10

depend() {
need net
after firewall
}

start_pre() {
checkpath -d -m 0750 -o root:root /opt/openviking_data
checkpath -f -m 0640 "$output_log"
}
EOF
chmod +x /etc/init.d/openviking
cat <<EOF >/etc/conf.d/openviking
export OPENVIKING_CONFIG_FILE=/opt/openviking_data/ov.conf
EOF
$STD rc-update add openviking default
$STD rc-service openviking start
_ov_wait_ready
msg_ok "Created Service"
}

run_os_setup
systemctl enable -q --now openviking
_ov_wait_ready
Comment thread
mfelipe marked this conversation as resolved.
Outdated
msg_ok "Created Service"

msg_info "Running OpenViking Doctor"
if OPENVIKING_CONFIG_FILE=/opt/openviking_data/ov.conf /opt/openviking/bin/openviking-server doctor >/dev/null 2>&1; then
Expand All @@ -158,4 +113,4 @@ fi

motd_ssh
customize
cleanup_lxc
cleanup_lxc
12 changes: 0 additions & 12 deletions json/openviking.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,6 @@
"os": "Debian",
"version": "13"
}
},
{
"type": "alpine",
"script": "ct/openviking.sh",
"config_path": "/opt/openviking_data/ov.conf",
"resources": {
"cpu": 1,
"ram": 1024,
"hdd": 8,
"os": "Alpine",
"version": "3.24"
}
}
],
"default_credentials": {
Expand Down
Loading