mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-05-24 01:24:44 +00:00
IronClaw: Extra configuration during install to ensure Web Gateway can run (#14635)
* configure gateway during install for best chance of it not getting disabled * add missing dbus-run-session on service * add back chmod to .env file * remove extra character * add back mkdir for /root/.ironclaw * remove erroneous msg blocks, service env values and tab in post completion gateway line
This commit is contained in:
committed by
GitHub
parent
599e841e1a
commit
a73aefa8fd
@@ -35,20 +35,41 @@ fetch_and_deploy_gh_release "ironclaw-bin" "nearai/ironclaw" "prebuild" "latest"
|
||||
"ironclaw-$(uname -m)-unknown-linux-musl.tar.gz"
|
||||
chmod +x /usr/local/bin/ironclaw
|
||||
|
||||
msg_info "Configuring IronClaw"
|
||||
mkdir -p /root/.ironclaw
|
||||
msg_info "Configuring Environment"
|
||||
GATEWAY_TOKEN=$(openssl rand -hex 32)
|
||||
mkdir -p /root/.ironclaw
|
||||
{
|
||||
echo "Gateway-Token"
|
||||
echo "Token: $GATEWAY_TOKEN"
|
||||
} >> /root/.ironclaw/gateway.creds
|
||||
|
||||
mkdir -p /root/.ironclaw
|
||||
cat <<EOF >/root/.ironclaw/.env
|
||||
DATABASE_BACKEND=postgres
|
||||
DATABASE_URL=postgresql://ironclaw:${PG_PASS}@localhost:5432/ironclaw?sslmode=disable
|
||||
GATEWAY_ENABLED=true
|
||||
GATEWAY_HOST=0.0.0.0
|
||||
GATEWAY_PORT=3000
|
||||
GATEWAY_AUTH_TOKEN=${GATEWAY_TOKEN}
|
||||
CLI_ENABLED=false
|
||||
AGENT_NAME=ironclaw
|
||||
RUST_LOG=ironclaw=info,tower_http=info
|
||||
EOF
|
||||
chmod 600 /root/.ironclaw/.env
|
||||
msg_ok "Configured Environment"
|
||||
|
||||
msg_info "Configuring IronClaw"
|
||||
# Set values in the database since it is typically the true source of truth and ensures values are set correctly on first run before the service starts.
|
||||
/usr/local/bin/ironclaw --no-onboard config set database_backend postgres >/dev/null
|
||||
/usr/local/bin/ironclaw --no-onboard config set database_url "postgresql://ironclaw:${PG_PASS}@localhost:5432/ironclaw?sslmode=disable" >/dev/null
|
||||
/usr/local/bin/ironclaw --no-onboard config set channels.gateway_enabled true >/dev/null
|
||||
/usr/local/bin/ironclaw --no-onboard config set channels.gateway_host 0.0.0.0 >/dev/null
|
||||
/usr/local/bin/ironclaw --no-onboard config set channels.gateway_port 3000 >/dev/null
|
||||
/usr/local/bin/ironclaw --no-onboard config set channels.gateway_auth_token "${GATEWAY_TOKEN}" >/dev/null
|
||||
/usr/local/bin/ironclaw --no-onboard config set channels.cli_enabled false >/dev/null
|
||||
/usr/local/bin/ironclaw --no-onboard config set secrets_master_key_source none >/dev/null
|
||||
# Running ironclaw defaults to use env for secrets and creates this entry, but we want to set that during onboard.
|
||||
sleep 5
|
||||
sed -i '/SECRETS_MASTER_KEY/d' /root/.ironclaw/.env
|
||||
msg_ok "Configured IronClaw"
|
||||
|
||||
msg_info "Creating Service"
|
||||
|
||||
Reference in New Issue
Block a user