fix: 서버 git 자동 인증 + 최초 설치 스크립트

- start-server.sh: git remote URL에 인증정보 포함 (비밀번호 입력 생략)
- setup-server.sh: 서버 최초 설치용 (clone + 디렉토리 생성)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
chpark
2026-03-27 01:09:58 +09:00
parent 52b1c40132
commit d6f15c81f0
2 changed files with 61 additions and 1 deletions
+51
View File
@@ -0,0 +1,51 @@
#!/bin/bash
# ==========================================
# Crawl Manager 서버 최초 설치 스크립트
# 사용법: 서버에서 이 스크립트만 실행하면 됨
#
# curl -O http://chpark:chpark@39.117.244.52:3000/chpark/admin_st/raw/branch/main/setup-server.sh
# chmod +x setup-server.sh && ./setup-server.sh
# ==========================================
GIT_USER="chpark"
GIT_PASS="chpark"
GIT_REPO="39.117.244.52:3000/chpark/admin_st.git"
GIT_URL="http://${GIT_USER}:${GIT_PASS}@${GIT_REPO}"
INSTALL_DIR="/home/crawl-manager"
echo ""
echo "=========================================="
echo " Crawl Manager 최초 설치"
echo "=========================================="
echo ""
# 디렉토리 생성
mkdir -p "$INSTALL_DIR"
cd "$INSTALL_DIR"
# 이미 git repo가 있으면 pull, 없으면 clone
if [ -d ".git" ]; then
echo "[INFO] 기존 저장소 발견. 최신 소스로 업데이트..."
git remote set-url origin "$GIT_URL" 2>/dev/null
git fetch origin
git reset --hard origin/main
else
echo "[INFO] 저장소 클론 중..."
git clone "$GIT_URL" .
fi
echo "[OK] 소스 준비 완료"
# 데이터 디렉토리
mkdir -p "$INSTALL_DIR/postgres_data"
mkdir -p "$INSTALL_DIR/app_data"
# 실행 권한
chmod +x start-server.sh
echo ""
echo "=========================================="
echo " 설치 완료!"
echo " 실행: cd $INSTALL_DIR && ./start-server.sh"
echo "=========================================="