forked from enderofwings/NexusOS
Brings the public tree back in line with the development repo after several weeks of drift caused by a stale publish include list. New: - In-app update path: GET /update/check compares the checkout against origin/main and POST /update/apply runs `ncp upgrade` detached (pull, rebuild, restart). The sidebar shows the version, checks on click, and offers an "update available" pill. - Projects: a project workspace groups chats and RAG documents, with per-project instructions and document retrieval scoped to the active project. Replaces the standalone Documents page. - modules/: auto-discovered feature plugins (mail, network) with their frontend counterparts and tests. - Memory curation runs in-process (synapse/memory/curator.py) on the chat model when a conversation goes idle. The separate memory service on :8001 is gone, along with the launcher lines that started it. Also: the KDE theme, panel and Promethean terminal assets, the full test suite, and VERSION 1.2.0. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
63 lines
1.9 KiB
Bash
63 lines
1.9 KiB
Bash
#!/bin/bash
|
|
|
|
# Loopback by default: the backend REST API is unauthenticated, so
|
|
# binding 0.0.0.0 hands the whole admin+data plane to any host on the LAN.
|
|
# Same knob management/ncp.py uses -- set NEXUS_BIND_HOST=0.0.0.0 to opt in.
|
|
BIND_HOST="${NEXUS_BIND_HOST:-127.0.0.1}"
|
|
PROJECT_ROOT="$(cd "$(dirname "$0")" && pwd)"
|
|
PYTHON="$PROJECT_ROOT/Promethean/bin/python3"
|
|
FRONTEND_DIR="$PROJECT_ROOT/interface/web"
|
|
LOG_DIR="$PROJECT_ROOT/runtime"
|
|
|
|
mkdir -p "$LOG_DIR"
|
|
|
|
BACKEND_LOG="$LOG_DIR/backend.log"
|
|
FRONTEND_LOG="$LOG_DIR/frontend.log"
|
|
|
|
_start() {
|
|
# _start <label> <log_file> <work_dir> <cmd> [args...]
|
|
local label="$1" log_file="$2" work_dir="$3"
|
|
shift 3
|
|
: > "$log_file"
|
|
( cd "$work_dir" && exec "$@" ) >> "$log_file" 2>&1 &
|
|
echo $!
|
|
}
|
|
|
|
_check() {
|
|
local label="$1" pid="$2" log_file="$3"
|
|
if kill -0 "$pid" 2>/dev/null; then
|
|
echo "$label STARTED"
|
|
else
|
|
echo "$label FAILED TO START"
|
|
[ -s "$log_file" ] && tail -8 "$log_file" | sed 's/^/ /'
|
|
fi
|
|
}
|
|
|
|
BACKEND_PID=$(_start "NEXUS BACKEND SERVICE" "$BACKEND_LOG" "$PROJECT_ROOT" \
|
|
"$PYTHON" -m uvicorn synapse.main:sio_app --host "$BIND_HOST" --port 8000 --reload)
|
|
|
|
sleep 3
|
|
_check "NEXUS BACKEND SERVICE" "$BACKEND_PID" "$BACKEND_LOG"
|
|
|
|
# Frontend last
|
|
FRONTEND_PID=$(_start "NEXUS FRONTEND SERVICE" "$FRONTEND_LOG" "$FRONTEND_DIR" \
|
|
npm run dev)
|
|
|
|
sleep 5
|
|
_check "NEXUS FRONTEND SERVICE" "$FRONTEND_PID" "$FRONTEND_LOG"
|
|
|
|
_shutdown() {
|
|
echo ''
|
|
echo 'Stopping NexusOS...'
|
|
# First TERM the processes we directly spawned.
|
|
kill "$MEMORY_PID" "$BACKEND_PID" "$FRONTEND_PID" 2>/dev/null
|
|
# uvicorn --reload leaves a worker child holding the port and `npm run dev`
|
|
# reparents vite, so the direct kills above orphan survivors. Delegate to the
|
|
# management CLI's port-based teardown, which reliably clears all three ports.
|
|
"$PROJECT_ROOT/management/nexus-cli.sh" stop >/dev/null 2>&1
|
|
echo 'NEXUS STOPPED'
|
|
exit
|
|
}
|
|
trap _shutdown SIGINT SIGTERM SIGHUP
|
|
wait
|