diff --git a/install_beyond.sh b/install_beyond.sh index 99a8505..c2c9e3d 100644 --- a/install_beyond.sh +++ b/install_beyond.sh @@ -66,25 +66,6 @@ echo read -rp "¿El repositorio es PRIVADO en GitHub y necesitas token? [s/N]: " IS_PRIVATE IS_PRIVATE=${IS_PRIVATE:-N} -GIT_CLONE_URL="$REPO_URL" -#if [[ "$IS_PRIVATE" =~ ^[sS]$ ]]; then -# echo "Introduce un Personal Access Token (PAT) de GitHub con permiso de lectura del repo." -# read -rsp "GitHub PAT: " GITHUB_TOKEN -# echo -# if [ -z "$GITHUB_TOKEN" ]; then -# echo "El token no puede estar vacío si el repo es privado." -# exit 1 -# fi -# -# # Construimos una URL del tipo: https://TOKEN@github.com/usuario/repo.git -# if [[ "$REPO_URL" =~ ^https:// ]]; then -# GIT_CLONE_URL="https://${GITHUB_TOKEN}@${REPO_URL#https://}" -# else -# echo "La URL del repositorio debe empezar por https:// para usar el token." -# exit 1 -# fi -#fi -# echo echo "Resumen de configuración:" echo " Dominio: $DOMAIN" @@ -107,61 +88,7 @@ if [[ ! "$CONFIRM" =~ ^[sS]$ ]]; then exit 0 fi -############################################### -# 2. INSTALAR DOCKER + DOCKER COMPOSE + CERTBOT -############################################### -#step "Instalando Docker, docker compose plugin y certbot" -# -#apt-get update -y -# -## Dependencias para repositorio Docker -#apt-get install -y \ -# ca-certificates \ -# curl \ -# gnupg \ -# lsb-release -# -## Clave GPG de Docker -#if [ ! -f /etc/apt/keyrings/docker.gpg ]; then -# install -m 0755 -d /etc/apt/keyrings -# curl -fsSL https://download.docker.com/linux/ubuntu/gpg | \ -# gpg --dearmor -o /etc/apt/keyrings/docker.gpg -#fi -# -## Repo Docker estable -#if [ ! -f /etc/apt/sources.list.d/docker.list ]; then -# echo \ -# "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ -# $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ -# tee /etc/apt/sources.list.d/docker.list > /dev/null -#fi -# -#apt-get update -y -# -#apt-get install -y \ -# docker-ce \ -# docker-ce-cli \ -# containerd.io \ -# docker-buildx-plugin \ -# docker-compose-plugin \ -# git \ -# certbot -# -#systemctl enable docker -#systemctl start docker -# -## Abrimos puertos en ufw si está activo -#if command -v ufw >/dev/null 2>&1; then -# if ufw status | grep -q "Status: active"; then -# step "Configurando firewall (ufw) para permitir 80 y 443" -# ufw allow 80/tcp || true -# ufw allow 443/tcp || true -# fi -#fi -# -################################################ -# 3. CLONAR / ACTUALIZAR REPO -############################################### +# COMENZAMOS ... step "Descargando/actualizando el repositorio en $INSTALL_DIR" eval $(ssh-agent -s) @@ -173,7 +100,8 @@ if [ -d "$INSTALL_DIR/.git" ]; then else rm -rf "$INSTALL_DIR" echo "Clonando repositorio..." - git clone "$GIT_CLONE_URL" "$INSTALL_DIR" +# git clone "$GIT_CLONE_URL" "$INSTALL_DIR" + git clone -b proxy "$GIT_CLONE_URL" "$INSTALL_DIR" fi cd "$INSTALL_DIR" @@ -200,7 +128,7 @@ if ! grep -q "XXX" docker-compose.yml; then else sed -i "s/XXX/\"$SUBDOMAIN\"/" docker-compose.yml fi -if $DOMAIN==$SUBDOMAIN; then +if [[$DOMAIN == $SUBDOMAIN]]; then DOMAIN=$DOMAIN".analytics.beyondcx.org" fi if ! grep -q "DDD" docker-compose.yml; then