From 7b6490ebcd28c67a7aef74b24eaf5848b93d4912 Mon Sep 17 00:00:00 2001 From: BBQ Date: Fri, 13 Feb 2026 17:49:00 +0800 Subject: [PATCH] chore: update install script and docs to reference main branch --- DEPLOYMENT.md | 2 +- README.md | 4 ++-- scripts/install.sh | 49 ++++++++++++++++++++++++++++++++++++++-------- 3 files changed, 44 insertions(+), 11 deletions(-) diff --git a/DEPLOYMENT.md b/DEPLOYMENT.md index ff07a7bc..09ae1d9c 100644 --- a/DEPLOYMENT.md +++ b/DEPLOYMENT.md @@ -3,7 +3,7 @@ ## One-Click Install ```bash -curl -fsSL https://raw.githubusercontent.com/memohai/Memoh/feat/containerd-in-docker/scripts/install.sh | sh +curl -fsSL https://raw.githubusercontent.com/memohai/Memoh/main/scripts/install.sh | sh ``` Or manually: diff --git a/README.md b/README.md index af638804..03415c22 100644 --- a/README.md +++ b/README.md @@ -30,13 +30,13 @@ Memoh is a AI agent system platform. Users can create their own AI bots and chat One-click install (requires Docker): ```bash -curl -fsSL https://raw.githubusercontent.com/memohai/Memoh/feat/containerd-in-docker/scripts/install.sh | sh +curl -fsSL https://raw.githubusercontent.com/memohai/Memoh/main/scripts/install.sh | sh ``` Or manually: ```bash -git clone -b feat/containerd-in-docker --depth 1 https://github.com/memohai/Memoh.git +git clone --depth 1 https://github.com/memohai/Memoh.git cd Memoh docker compose up -d ``` diff --git a/scripts/install.sh b/scripts/install.sh index fc3954a7..1924c63d 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -7,7 +7,7 @@ RED='\033[0;31m' NC='\033[0m' REPO="https://github.com/memohai/Memoh.git" -BRANCH="feat/containerd-in-docker" +BRANCH="main" DIR="Memoh" SILENT=false @@ -51,16 +51,42 @@ gen_secret() { fi } -# Configuration defaults +# Configuration defaults (expand ~ for paths) +WORKSPACE_DEFAULT="${HOME:-/tmp}/memoh" +MEMOH_DATA_DIR_DEFAULT="${HOME:-/tmp}/memoh/data" ADMIN_USER="admin" ADMIN_PASS="admin123" JWT_SECRET="$(gen_secret)" PG_PASS="memoh123" +WORKSPACE="$WORKSPACE_DEFAULT" +MEMOH_DATA_DIR="$MEMOH_DATA_DIR_DEFAULT" if [ "$SILENT" = false ]; then echo "Configure Memoh (press Enter to use defaults):" > /dev/tty echo "" > /dev/tty + printf " Workspace (install and clone here) [%s]: " "~/memoh" > /dev/tty + read -r input < /dev/tty || true + if [ -n "$input" ]; then + case "$input" in + ~) WORKSPACE="${HOME:-/tmp}" ;; + ~/*) WORKSPACE="${HOME:-/tmp}${input#\~}" ;; + *) WORKSPACE="$input" ;; + esac + fi + + printf " Data directory (bind mount for containerd/memoh data) [%s]: " "$WORKSPACE/data" > /dev/tty + read -r input < /dev/tty || true + if [ -n "$input" ]; then + case "$input" in + ~) MEMOH_DATA_DIR="${HOME:-/tmp}" ;; + ~/*) MEMOH_DATA_DIR="${HOME:-/tmp}${input#\~}" ;; + *) MEMOH_DATA_DIR="$input" ;; + esac + else + MEMOH_DATA_DIR="$WORKSPACE/data" + fi + printf " Admin username [%s]: " "$ADMIN_USER" > /dev/tty read -r input < /dev/tty || true [ -n "$input" ] && ADMIN_USER="$input" @@ -80,13 +106,17 @@ if [ "$SILENT" = false ]; then echo "" > /dev/tty fi +# Enter workspace (all operations run here) +mkdir -p "$WORKSPACE" +cd "$WORKSPACE" + # Clone or update if [ -d "$DIR" ]; then - echo "Updating existing installation..." + echo "Updating existing installation in $WORKSPACE..." cd "$DIR" git pull --ff-only 2>/dev/null || true else - echo "Cloning Memoh..." + echo "Cloning Memoh into $WORKSPACE..." git clone --depth 1 -b "$BRANCH" "$REPO" "$DIR" cd "$DIR" fi @@ -100,8 +130,11 @@ sed -i.bak "s|password = \"memoh123\"|password = \"${PG_PASS}\"|" config.toml export POSTGRES_PASSWORD="${PG_PASS}" rm -f config.toml.bak -# Use generated config +# Use generated config and data dir +INSTALL_DIR="$(pwd)" export MEMOH_CONFIG=./config.toml +export MEMOH_DATA_DIR +mkdir -p "$MEMOH_DATA_DIR" echo "" echo "${GREEN}Starting services (first build may take a few minutes)...${NC}" @@ -119,8 +152,8 @@ echo "" echo " Admin login: ${ADMIN_USER} / ${ADMIN_PASS}" echo "" echo "Commands:" -echo " cd ${DIR} && docker compose ps # Status" -echo " cd ${DIR} && docker compose logs -f # Logs" -echo " cd ${DIR} && docker compose down # Stop" +echo " cd ${INSTALL_DIR} && docker compose ps # Status" +echo " cd ${INSTALL_DIR} && docker compose logs -f # Logs" +echo " cd ${INSTALL_DIR} && docker compose down # Stop" echo "" echo "${YELLOW}First startup may take 1-2 minutes, please be patient.${NC}"