diff --git a/README.md b/README.md index 633fb0c..270b94e 100644 --- a/README.md +++ b/README.md @@ -9,11 +9,16 @@ The web UI is accessible at `https://agent0.glitch.university` via a persistent ## Day 1 setup ```bash -git clone -cd Agent0 +git clone https://ramanujan.glitch.university/glitch-university/agent0.git +cd agent0 bash bootstrap.sh ``` +> **Note:** This repo must be **public** on Gitea for the clone to work on a fresh machine +> before SSH keys exist. Set it in Gitea → Settings → Make Public. +> If you prefer to keep it private, clone with a token instead: +> `git clone https://:@ramanujan.glitch.university/glitch-university/agent0.git` + The script handles everything it can automatically. When it finishes, it prints two SSH public keys and two copy-paste commands — that's all that's left to do manually. --- diff --git a/bootstrap.sh b/bootstrap.sh index 1a305c9..d2f99a3 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -55,15 +55,28 @@ if command -v ollama >/dev/null 2>&1; then else info "Installing Ollama..." curl -fsSL https://ollama.com/install.sh | sh - info "Ollama installed and started as systemd service" fi -# Verify the systemd service is running -if systemctl is-active --quiet ollama 2>/dev/null; then - info "Ollama service running" +# Ensure the Ollama server is running +if [[ "$OS" == "Linux" ]]; then + if systemctl is-active --quiet ollama 2>/dev/null; then + info "Ollama service running" + else + info "Starting Ollama service..." + sudo systemctl enable --now ollama + fi else - info "Starting Ollama service..." - sudo systemctl enable --now ollama + # macOS — check if server is already answering, otherwise start in background + if curl -sf http://localhost:11434/api/tags >/dev/null 2>&1; then + info "Ollama server already running" + else + info "Starting Ollama server..." + ollama serve >/tmp/ollama.log 2>&1 & + sleep 2 + curl -sf http://localhost:11434/api/tags >/dev/null 2>&1 \ + && info "Ollama server started" \ + || echo " Warning: Ollama server didn't respond — start it manually with: ollama serve" + fi fi echo ""