Files
creator-hub/scripts/install-native-browser-gateway.sh
T
rogee d9e57c4900 feat(gateway)!: drop HTTP listener, run outbound agent only
- delete GatewayHTTPServer/GatewayHandler, create_server, /healthz and
  /v1/channel; event_channel module removed
- load_config now requires CREATOR_PLATFORM_URL + CREATOR_GATEWAY_KEY
- run() wires Gateway into OutboundAgent; SIGINT/SIGTERM stop the agent
- deploy env example, install script, systemd unit docs and deployment
  docs updated to the outbound model; NATIVE_GATEWAY_ENDPOINT dead dev
  config removed
2026-10-09 08:25:27 +08:00

27 lines
953 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
if [[ "$(id -u)" == 0 ]]; then
echo "run this installer as the non-root gateway user" >&2
exit 1
fi
project_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
env_file="${HOME}/.config/creatorhub/browser-gateway.env"
unit_dir="${HOME}/.config/systemd/user"
unit_file="${unit_dir}/creatorhub-browser-gateway.service"
if [[ ! -f "${env_file}" ]]; then
echo "missing ${env_file}; copy deploy/browser-gateway.env.example and set CREATOR_PLATFORM_URL, CREATOR_GATEWAY_KEY and BROWSER_PATH" >&2
exit 1
fi
install -d -m 0700 "${unit_dir}"
sed "s|@PROJECT_DIR@|${project_dir}|g" \
"${project_dir}/deploy/creatorhub-browser-gateway.service.in" > "${unit_file}.tmp"
chmod 0600 "${unit_file}.tmp"
mv -f "${unit_file}.tmp" "${unit_file}"
systemctl --user daemon-reload
systemctl --user enable --now creatorhub-browser-gateway.service
systemctl --user --no-pager --full status creatorhub-browser-gateway.service