feat: 交互式输入数据库配置

This commit is contained in:
Sens 2026-02-21 00:03:42 +08:00
parent b125424e8f
commit fd94057e2b
1 changed files with 17 additions and 2 deletions

View File

@ -18,8 +18,23 @@ PROJECT_DIR="/opt/neural-sync"
# 1Panel PostgreSQL 默认配置
DB_USER="root"
DB_PASSWORD="postgres"
DB_HOST=${1:-"localhost"}
# 交互式获取数据库配置
if [ -z "$1" ]; then
echo ""
echo -e "${YELLOW}请输入 PostgreSQL 数据库主机地址:${NC}"
echo " (本地请直接回车,默认: localhost)"
read -p "主机地址 [localhost]: " DB_HOST
DB_HOST=${DB_HOST:-localhost}
echo -e "${YELLOW}请输入 PostgreSQL 端口:${NC}"
read -p "端口 [5432]: " DB_PORT
DB_PORT=${DB_PORT:-5432}
else
DB_HOST=$1
DB_PORT=${2:-5432}
fi
GIT_REPO=${3:-""}
# 检查是否为 root 用户