@connectai/selfhost
Advanced tools
@@ -70,9 +70,23 @@ #!/usr/bin/env bash | ||
| local k="$1" v="$2" | ||
| if grep -q "^${k}=" "${ENV_FILE}" 2>/dev/null; then | ||
| local esc_v | ||
| esc_v=$(printf '%s' "${v}" | sed 's/[&#\\]/\\&/g') | ||
| sed -i "s#^${k}=.*#${k}=${esc_v}#" "${ENV_FILE}" | ||
| else | ||
| printf '%s=%s\n' "${k}" "${v}" >>"${ENV_FILE}" | ||
| fi | ||
| python3 - "${ENV_FILE}" "${k}" "${v}" <<'PY' | ||
| from pathlib import Path | ||
| import sys | ||
| path = Path(sys.argv[1]) | ||
| key = sys.argv[2] | ||
| value = sys.argv[3] | ||
| needle = f"{key}=" | ||
| lines = path.read_text().splitlines() | ||
| replaced = False | ||
| for index, line in enumerate(lines): | ||
| if line.startswith(needle): | ||
| lines[index] = f"{needle}{value}" | ||
| replaced = True | ||
| break | ||
| if not replaced: | ||
| lines.append(f"{needle}{value}") | ||
| path.write_text("\n".join(lines) + "\n") | ||
| PY | ||
| } | ||
@@ -79,0 +93,0 @@ |
+1
-1
| { | ||
| "name": "@connectai/selfhost", | ||
| "version": "0.1.9", | ||
| "version": "0.1.10", | ||
| "description": "One-command self-host installer for ConnectAI. Takes a clean machine (only Docker + Node) to a running, health-checked company-brain in one command, with no source clone and no local image build: `npx @connectai/selfhost run`. Bundles the image-based docker-compose stack + boot scripts, generates a strong .env (CSPRNG ENCRYPTION_SECRET + POSTGRES_PASSWORD), and boots the stack.", | ||
@@ -5,0 +5,0 @@ "type": "module", |
83287
0.28%