commit 4
This commit is contained in:
11
install.sh
11
install.sh
@@ -1,7 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
REPO="ssomvk/sso-service"
|
||||
REPO="lendry/sso-service"
|
||||
GIT_HOST="git.lendry.ru"
|
||||
BRANCH="main"
|
||||
INSTALL_DIR="${INSTALL_DIR:-$HOME/sso-service}"
|
||||
SKIP_PREREQS="${SKIP_PREREQS:-false}"
|
||||
@@ -15,7 +16,7 @@ step() { echo -e "\n${CYAN}━━━ $1 ━━━${NC}"; }
|
||||
echo -e "${CYAN}"
|
||||
echo " ╔══════════════════════════════════════════════╗"
|
||||
echo " ║ SSO Service — Auto Installer ║"
|
||||
echo " ║ https://github.com/${REPO} ║"
|
||||
echo " ║ https://${GIT_HOST}/${REPO} ║"
|
||||
echo " ╚══════════════════════════════════════════════╝"
|
||||
echo -e "${NC}"
|
||||
|
||||
@@ -128,10 +129,10 @@ if [ -d "$INSTALL_DIR/.git" ]; then
|
||||
else
|
||||
mkdir -p "$INSTALL_DIR"
|
||||
if command -v git &>/dev/null; then
|
||||
git clone --depth 1 "https://github.com/$REPO.git" "$INSTALL_DIR" 2>&1
|
||||
git clone --depth 1 "https://$GIT_HOST/$REPO.git" "$INSTALL_DIR" 2>&1
|
||||
else
|
||||
warn "git not found, downloading archive..."
|
||||
curl -fsSL "https://github.com/$REPO/archive/refs/heads/$BRANCH.tar.gz" | tar xz --strip=1 -C "$INSTALL_DIR"
|
||||
curl -fsSL "https://$GIT_HOST/$REPO/archive/$BRANCH.tar.gz" | tar xz --strip=1 -C "$INSTALL_DIR"
|
||||
fi
|
||||
info "Downloaded to $INSTALL_DIR"
|
||||
fi
|
||||
@@ -238,7 +239,7 @@ echo -e " ${YELLOW}Log file:${NC} $INSTALL_DIR/sso.log"
|
||||
echo ""
|
||||
echo -e " ${YELLOW}Stop:${NC} $(command -v pm2 &>/dev/null && echo 'pm2 stop sso-service' || echo "kill \$(cat $INSTALL_DIR/.sso.pid)")"
|
||||
echo -e " ${YELLOW}Update:${NC} cd $INSTALL_DIR && git pull && npm ci && npm run build && npm run start:prod"
|
||||
echo -e " ${YELLOW}Re-run:${NC} curl -fsSL https://github.com/${REPO}/raw/${BRANCH}/install.sh | bash"
|
||||
echo -e " ${YELLOW}Re-run:${NC} curl -fsSL https://${GIT_HOST}/${REPO}/raw/branch/${BRANCH}/install.sh | bash"
|
||||
echo ""
|
||||
echo -e " ${GREEN}Open http://localhost:${PORT:-3000} in your browser${NC}"
|
||||
echo ""
|
||||
|
||||
Reference in New Issue
Block a user