mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-11-13 17:56:21 +01:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6ab5b67537 |
No files matched your search
@@ -0,0 +1,65 @@
|
||||
#!/usr/bin/env bash
|
||||
_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func"
|
||||
source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func")
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: MickLesk (CanbiZ)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/spacedriveapp/spacebot
|
||||
|
||||
APP="Spacebot"
|
||||
var_tags="${var_tags:-ai;agent;chatops}"
|
||||
var_cpu="${var_cpu:-2}"
|
||||
var_ram="${var_ram:-1024}"
|
||||
var_disk="${var_disk:-6}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-13}"
|
||||
var_arm64="${var_arm64:-yes}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
|
||||
export var_llm_base_url="${var_llm_base_url:-}"
|
||||
export var_llm_api_key="${var_llm_api_key:-}"
|
||||
export var_llm_model="${var_llm_model:-}"
|
||||
|
||||
if [[ -n "$var_llm_base_url" && -z "$var_llm_model" ]]; then
|
||||
msg_error "var_llm_model is required with var_llm_base_url."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
header_info "$APP"
|
||||
variables
|
||||
color
|
||||
catch_errors
|
||||
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
|
||||
if [[ ! -d /opt/spacebot ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
if check_for_gh_release "spacebot" "spacedriveapp/spacebot"; then
|
||||
msg_info "Stopping Spacebot"
|
||||
systemctl stop spacebot
|
||||
msg_ok "Stopped Spacebot"
|
||||
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "spacebot" "spacedriveapp/spacebot" "prebuild" "latest" "/opt/spacebot" "spacebot-v*-$(arch_resolve "x86_64" "aarch64")-unknown-linux-gnu.tar.gz"
|
||||
|
||||
msg_info "Starting Spacebot"
|
||||
systemctl start spacebot
|
||||
msg_ok "Started Spacebot"
|
||||
msg_ok "Updated successfully!"
|
||||
fi
|
||||
exit
|
||||
}
|
||||
|
||||
start
|
||||
build_container
|
||||
description
|
||||
|
||||
msg_ok "Completed Successfully!\n"
|
||||
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
||||
echo -e "${INFO}${YW}Access it using the following URL:${CL}"
|
||||
echo -e "${GATEWAY}${BGN}http://${IP}:19898${CL}"
|
||||
@@ -0,0 +1,99 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: MickLesk (CanbiZ)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/spacedriveapp/spacebot
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt install -y \
|
||||
bubblewrap \
|
||||
fonts-liberation \
|
||||
libnss3 \
|
||||
libatk-bridge2.0-0t64 \
|
||||
libdrm2 \
|
||||
libxcomposite1 \
|
||||
libxdamage1 \
|
||||
libxrandr2 \
|
||||
libgbm1 \
|
||||
libasound2t64 \
|
||||
libpango-1.0-0 \
|
||||
libcairo2 \
|
||||
libcups2t64 \
|
||||
libxkbcommon0 \
|
||||
libxss1 \
|
||||
libxtst6 \
|
||||
libxfixes3
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
fetch_and_deploy_gh_release "spacebot" "spacedriveapp/spacebot" "prebuild" "latest" "/opt/spacebot" "spacebot-v*-$(arch_resolve "x86_64" "aarch64")-unknown-linux-gnu.tar.gz"
|
||||
|
||||
msg_info "Configuring Spacebot"
|
||||
mkdir -p /opt/spacebot_data
|
||||
cat <<EOF >/opt/spacebot_data/.env
|
||||
SPACEBOT_DIR=/opt/spacebot_data
|
||||
EOF
|
||||
cat <<EOF >/opt/spacebot_data/config.toml
|
||||
[api]
|
||||
bind = "0.0.0.0"
|
||||
port = 19898
|
||||
|
||||
[[agents]]
|
||||
id = "main"
|
||||
default = true
|
||||
EOF
|
||||
if [[ -n "${var_llm_base_url:-}" ]]; then
|
||||
cat <<EOF >>/opt/spacebot_data/.env
|
||||
LLM_API_KEY=${var_llm_api_key:-none}
|
||||
EOF
|
||||
cat <<EOF >>/opt/spacebot_data/config.toml
|
||||
|
||||
[llm.provider.custom]
|
||||
api_type = "openai_chat_completions"
|
||||
base_url = "${var_llm_base_url%/}"
|
||||
api_key = "env:LLM_API_KEY"
|
||||
name = "OpenAI-compatible"
|
||||
|
||||
[defaults.routing]
|
||||
channel = "custom/${var_llm_model}"
|
||||
branch = "custom/${var_llm_model}"
|
||||
worker = "custom/${var_llm_model}"
|
||||
compactor = "custom/${var_llm_model}"
|
||||
cortex = "custom/${var_llm_model}"
|
||||
EOF
|
||||
fi
|
||||
chmod 600 /opt/spacebot_data/.env /opt/spacebot_data/config.toml
|
||||
msg_ok "Configured Spacebot"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/spacebot.service
|
||||
[Unit]
|
||||
Description=Spacebot
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=/opt/spacebot_data
|
||||
EnvironmentFile=/opt/spacebot_data/.env
|
||||
ExecStart=/opt/spacebot/spacebot start --foreground
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now spacebot
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
Reference in new issue
Block a user