Merge pull request #17 from outis1one/claude/cleanup-setup-webui-bCgPE
Claude/cleanup setup webui b cg pe
This commit is contained in:
+24
@@ -0,0 +1,24 @@
|
|||||||
|
# Generated by setup scripts — not tracked
|
||||||
|
docker-compose.yml
|
||||||
|
.env
|
||||||
|
requirements.txt
|
||||||
|
mcp_requirements.txt
|
||||||
|
start.sh
|
||||||
|
stop.sh
|
||||||
|
status.sh
|
||||||
|
pull-models.sh
|
||||||
|
Caddyfile.example
|
||||||
|
.ufw-done
|
||||||
|
|
||||||
|
# Data directories
|
||||||
|
workspace/
|
||||||
|
repos/
|
||||||
|
papers/
|
||||||
|
index/
|
||||||
|
logs/
|
||||||
|
kiwix/
|
||||||
|
gitea/
|
||||||
|
portainer-data/
|
||||||
|
invokeai-data/
|
||||||
|
invokeai-outputs/
|
||||||
|
searxng/
|
||||||
@@ -34,7 +34,7 @@ LEVEL="moderate"
|
|||||||
DISABLE_CATS=""
|
DISABLE_CATS=""
|
||||||
DISABLE_ENGINES_EXTRA=""
|
DISABLE_ENGINES_EXTRA=""
|
||||||
ENABLE_ENGINES_EXTRA=""
|
ENABLE_ENGINES_EXTRA=""
|
||||||
BASE="${BASE:-$HOME/docker/ai-stack}"
|
BASE="${BASE:-$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)}"
|
||||||
|
|
||||||
# ── Parse arguments ───────────────────────────────────────────────────────────
|
# ── Parse arguments ───────────────────────────────────────────────────────────
|
||||||
while [[ $# -gt 0 ]]; do
|
while [[ $# -gt 0 ]]; do
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ ok() { echo -e "${GREEN}[OK]${NC} $*"; }
|
|||||||
warn() { echo -e "${YELLOW}[!!]${NC} $*"; }
|
warn() { echo -e "${YELLOW}[!!]${NC} $*"; }
|
||||||
die() { echo -e "${RED}[ERR]${NC} $*"; exit 1; }
|
die() { echo -e "${RED}[ERR]${NC} $*"; exit 1; }
|
||||||
|
|
||||||
BASE="$HOME/docker/ai-stack"
|
BASE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
COMPOSE="$BASE/docker-compose.yml"
|
COMPOSE="$BASE/docker-compose.yml"
|
||||||
|
|
||||||
[[ -f "$COMPOSE" ]] || die "docker-compose.yml not found at $BASE — run local-ai-setup.sh first"
|
[[ -f "$COMPOSE" ]] || die "docker-compose.yml not found at $BASE — run local-ai-setup.sh first"
|
||||||
|
|||||||
+25
-10
@@ -31,8 +31,8 @@ FORCE=false
|
|||||||
for arg in "$@"; do [[ "$arg" == "--force" ]] && FORCE=true; done
|
for arg in "$@"; do [[ "$arg" == "--force" ]] && FORCE=true; done
|
||||||
|
|
||||||
# ── config ────────────────────────────────────────────────────────────────────
|
# ── config ────────────────────────────────────────────────────────────────────
|
||||||
BASE="$HOME/docker/ai-stack"
|
|
||||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
BASE="$SCRIPT_DIR"
|
||||||
LOCAL_IP=$(ip route get 1.1.1.1 2>/dev/null | grep -oP 'src \K\S+' \
|
LOCAL_IP=$(ip route get 1.1.1.1 2>/dev/null | grep -oP 'src \K\S+' \
|
||||||
|| hostname -I | awk '{print $1}')
|
|| hostname -I | awk '{print $1}')
|
||||||
[[ -z "$LOCAL_IP" ]] && read -rp "Enter your LAN IP: " LOCAL_IP
|
[[ -z "$LOCAL_IP" ]] && read -rp "Enter your LAN IP: " LOCAL_IP
|
||||||
@@ -1033,8 +1033,23 @@ fi
|
|||||||
# Always written — it's the stack definition and safe to update
|
# Always written — it's the stack definition and safe to update
|
||||||
cat > "$BASE/docker-compose.yml" << COMPOSE
|
cat > "$BASE/docker-compose.yml" << COMPOSE
|
||||||
# Local AI Stack — generated $(date '+%Y-%m-%d')
|
# Local AI Stack — generated $(date '+%Y-%m-%d')
|
||||||
# Edit \$BASE/.env to add API tokens.
|
# Edit .env in this folder to add API tokens.
|
||||||
# GPU: OLLAMA_NUM_GPU=999 means "use all available VRAM" — auto-adapts to any GPU.
|
# GPU: OLLAMA_NUM_GPU=999 means "use all available VRAM" — auto-adapts to any GPU.
|
||||||
|
#
|
||||||
|
# ── Common commands (run from this folder) ─────────────────────────────────────
|
||||||
|
# Start everything: docker compose up -d
|
||||||
|
# Stop everything: docker compose down
|
||||||
|
# Restart one service: docker compose restart <service>
|
||||||
|
# Stop one service: docker compose stop <service>
|
||||||
|
# Start one service: docker compose up -d <service>
|
||||||
|
# Follow all logs: docker compose logs -f
|
||||||
|
# Follow one service logs: docker compose logs -f <service>
|
||||||
|
# Pull latest images: docker compose pull && docker compose up -d
|
||||||
|
# Show status: docker compose ps
|
||||||
|
#
|
||||||
|
# Services: ollama open-webui chromadb rag-server mcp-server
|
||||||
|
# searxng kiwix gitea invokeai portainer
|
||||||
|
# ───────────────────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
|
||||||
@@ -1392,19 +1407,19 @@ write_if_new "$BASE/Caddyfile.example" << CADDY
|
|||||||
# Replace yourdomain.com with your actual domain
|
# Replace yourdomain.com with your actual domain
|
||||||
|
|
||||||
webui.yourdomain.com {
|
webui.yourdomain.com {
|
||||||
reverse_proxy $(hostname).local:3000 {
|
reverse_proxy $LOCAL_IP:3000 {
|
||||||
header_up X-Forwarded-Proto {scheme}
|
header_up X-Forwarded-Proto {scheme}
|
||||||
header_up X-Forwarded-Host {host}
|
header_up X-Forwarded-Host {host}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
invokeai.yourdomain.com { reverse_proxy $(hostname).local:9090 }
|
invokeai.yourdomain.com { reverse_proxy $LOCAL_IP:9090 }
|
||||||
search.yourdomain.com { reverse_proxy $(hostname).local:8888 }
|
search.yourdomain.com { reverse_proxy $LOCAL_IP:8888 }
|
||||||
git.yourdomain.com { reverse_proxy $(hostname).local:3001 }
|
git.yourdomain.com { reverse_proxy $LOCAL_IP:3001 }
|
||||||
kiwix.yourdomain.com { reverse_proxy $(hostname).local:8181 }
|
kiwix.yourdomain.com { reverse_proxy $LOCAL_IP:8181 }
|
||||||
rag.yourdomain.com { reverse_proxy $(hostname).local:8001 }
|
rag.yourdomain.com { reverse_proxy $LOCAL_IP:8001 }
|
||||||
mcp.yourdomain.com { reverse_proxy $(hostname).local:8002 }
|
mcp.yourdomain.com { reverse_proxy $LOCAL_IP:8002 }
|
||||||
portainer.yourdomain.com {
|
portainer.yourdomain.com {
|
||||||
reverse_proxy https://$(hostname).local:9443 {
|
reverse_proxy https://$LOCAL_IP:9443 {
|
||||||
transport http { tls_insecure_skip_verify }
|
transport http { tls_insecure_skip_verify }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+18
-3
@@ -13,8 +13,8 @@ section() { echo -e "\n${BOLD}━━━ $* ━━━${NC}"; }
|
|||||||
FORCE=false; NO_PULL=false
|
FORCE=false; NO_PULL=false
|
||||||
for a in "$@"; do [[ "$a" == "--force" ]] && FORCE=true; [[ "$a" == "--no-pull" ]] && NO_PULL=true; done
|
for a in "$@"; do [[ "$a" == "--force" ]] && FORCE=true; [[ "$a" == "--no-pull" ]] && NO_PULL=true; done
|
||||||
|
|
||||||
BASE="$HOME/docker/ai-stack"
|
|
||||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
BASE="$SCRIPT_DIR"
|
||||||
LOCAL_IP=$(ip route get 1.1.1.1 2>/dev/null | grep -oP 'src \K\S+' || hostname -I | awk '{print $1}')
|
LOCAL_IP=$(ip route get 1.1.1.1 2>/dev/null | grep -oP 'src \K\S+' || hostname -I | awk '{print $1}')
|
||||||
[[ -z "$LOCAL_IP" ]] && read -rp "Enter LAN IP: " LOCAL_IP
|
[[ -z "$LOCAL_IP" ]] && read -rp "Enter LAN IP: " LOCAL_IP
|
||||||
|
|
||||||
@@ -669,7 +669,7 @@ def rag_health() -> str:
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
import uvicorn
|
import uvicorn
|
||||||
uvicorn.run(mcp.get_asgi_app(), host="0.0.0.0", port=8002)
|
uvicorn.run(mcp.sse_app(), host="0.0.0.0", port=8002)
|
||||||
PY
|
PY
|
||||||
|
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
@@ -720,9 +720,24 @@ fi
|
|||||||
section "Docker Compose"
|
section "Docker Compose"
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
cat > "$BASE/docker-compose.yml" << COMPOSE
|
cat > "$BASE/docker-compose.yml" << COMPOSE
|
||||||
# Local AI Stack — 2026-03-20
|
# Local AI Stack — generated $(date '+%Y-%m-%d')
|
||||||
# GPU: OLLAMA_NUM_GPU=999 uses all available VRAM automatically (V100/RTX/any)
|
# GPU: OLLAMA_NUM_GPU=999 uses all available VRAM automatically (V100/RTX/any)
|
||||||
# Context: OLLAMA_NUM_CTX= set by detected VRAM (GB)
|
# Context: OLLAMA_NUM_CTX= set by detected VRAM (GB)
|
||||||
|
#
|
||||||
|
# ── Common commands (run from this folder) ─────────────────────────────────────
|
||||||
|
# Start everything: docker compose up -d
|
||||||
|
# Stop everything: docker compose down
|
||||||
|
# Restart one service: docker compose restart <service>
|
||||||
|
# Stop one service: docker compose stop <service>
|
||||||
|
# Start one service: docker compose up -d <service>
|
||||||
|
# Follow all logs: docker compose logs -f
|
||||||
|
# Follow one service logs: docker compose logs -f <service>
|
||||||
|
# Pull latest images: docker compose pull && docker compose up -d
|
||||||
|
# Show status: docker compose ps
|
||||||
|
#
|
||||||
|
# Services: ollama open-webui chromadb rag-server mcp-server
|
||||||
|
# searxng kiwix gitea invokeai portainer
|
||||||
|
# ───────────────────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -199,5 +199,5 @@ def rag_health() -> str:
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
import uvicorn
|
import uvicorn
|
||||||
app = mcp.get_asgi_app()
|
app = mcp.sse_app()
|
||||||
uvicorn.run(app, host="0.0.0.0", port=8002)
|
uvicorn.run(app, host="0.0.0.0", port=8002)
|
||||||
|
|||||||
Reference in New Issue
Block a user