3x-ui/install.sh

321 lines
14 KiB
Bash
Raw Normal View History

2023-02-09 19:18:06 +00:00
#!/bin/bash
# Color definitions
red=''
green=''
blue=''
yellow=''
plain=''
2024-01-20 09:32:35 +00:00
# Global variables
ARCH=$(uname -m)
OS_RELEASE_ID=""
OS_RELEASE_VERSION_ID=""
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
INSTALL_DIR="/opt/3x-ui-docker"
REPO_DIR_NAME="3x-ui-source"
REPO_URL="https://github.com/MHSanaei/3x-ui.git"
2023-02-09 19:18:06 +00:00
# --- Utility Functions ---
detect_os() {
if [[ -f /etc/os-release ]]; then
source /etc/os-release
OS_RELEASE_ID=$ID
OS_RELEASE_VERSION_ID=$VERSION_ID
elif [[ -f /usr/lib/os-release ]]; then
source /usr/lib/os-release
OS_RELEASE_ID=$ID
OS_RELEASE_VERSION_ID=$VERSION_ID
else
echo -e "${red}Failed to detect the operating system!${plain}" >&2
2025-03-21 15:30:31 +00:00
exit 1
fi
echo -e "${blue}Detected OS: $OS_RELEASE_ID $OS_RELEASE_VERSION_ID${plain}"
}
check_root() {
[[ $EUID -ne 0 ]] && echo -e "${red}Fatal error: Please run this script with root privilege.${plain}" && exit 1
2025-03-21 15:30:31 +00:00
}
print_colored() {
local color="$1"
local message="$2"
echo -e "${color}${message}${plain}"
2023-02-09 19:18:06 +00:00
}
check_command() {
command -v "$1" >/dev/null 2>&1
2024-06-24 12:43:39 +00:00
}
# --- Installation Functions ---
install_dependencies() {
print_colored "$blue" "Installing essential dependencies (curl, tar, git)..."
local pkgs_to_install=""
if ! check_command curl; then pkgs_to_install+="curl "; fi
if ! check_command tar; then pkgs_to_install+="tar "; fi
if ! check_command git; then pkgs_to_install+="git "; fi
if [[ -n "$pkgs_to_install" ]]; then
case "$OS_RELEASE_ID" in
ubuntu | debian | armbian)
apt-get update -y && apt-get install -y $pkgs_to_install
;;
centos | almalinux | rocky | ol)
yum install -y $pkgs_to_install
;;
fedora)
dnf install -y $pkgs_to_install
;;
arch | manjaro)
pacman -Syu --noconfirm $pkgs_to_install
;;
*)
print_colored "$yellow" "Unsupported OS for automatic dependency installation: $OS_RELEASE_ID. Please install curl, tar, and git manually."
;;
esac
if ! check_command curl || ! check_command tar || ! check_command git; then
print_colored "$red" "Failed to install essential dependencies. Please install them manually and re-run."
exit 1
2024-10-16 11:49:56 +00:00
fi
else
print_colored "$green" "Essential dependencies are already installed."
2023-02-09 19:18:06 +00:00
fi
}
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
install_docker() {
print_colored "$blue" "Checking for Docker..."
if check_command docker; then
print_colored "$green" "Docker is already installed: $(docker --version)"
return 0
fi
2023-02-09 19:18:06 +00:00
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
print_colored "$yellow" "Docker not found. Attempting to install Docker..."
if [[ "$OS_RELEASE_ID" == "ubuntu" || "$OS_RELEASE_ID" == "debian" || "$OS_RELEASE_ID" == "armbian" ]]; then
print_colored "$blue" "Attempting Docker installation for Debian-based system..."
apt-get update -y
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
apt-get install -y apt-transport-https ca-certificates software-properties-common gnupg lsb-release
mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/${OS_RELEASE_ID}/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/${OS_RELEASE_ID} $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
apt-get update -y
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin || {
print_colored "$yellow" "Docker installation via apt failed. Trying convenience script..."
curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh
rm -f get-docker.sh
}
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
elif [[ "$OS_RELEASE_ID" == "centos" || "$OS_RELEASE_ID" == "almalinux" || "$OS_RELEASE_ID" == "rocky" || "$OS_RELEASE_ID" == "ol" ]]; then
print_colored "$blue" "Attempting Docker installation for RHEL-based system..."
yum install -y yum-utils
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
yum install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin || {
print_colored "$yellow" "Docker installation via yum failed. Trying convenience script..."
curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh
rm -f get-docker.sh
}
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
elif [[ "$OS_RELEASE_ID" == "fedora" ]]; then
print_colored "$blue" "Attempting Docker installation for Fedora..."
dnf -y install dnf-plugins-core
dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin || {
print_colored "$yellow" "Docker installation via dnf failed. Trying convenience script..."
curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh
rm -f get-docker.sh
}
else
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
print_colored "$yellow" "Unsupported OS for automatic Docker installation via package manager. Trying convenience script..."
curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh
rm -f get-docker.sh
fi
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
if ! check_command docker; then
print_colored "$red" "Docker installation failed. Please install Docker manually and re-run this script."
exit 1
fi
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
if ! systemctl is-active --quiet docker; then
systemctl start docker || print_colored "$yellow" "Failed to start Docker service via systemctl. It might need manual start."
fi
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
systemctl enable docker || print_colored "$yellow" "Failed to enable Docker service via systemctl."
print_colored "$green" "Docker installed and status confirmed: $(docker --version)"
}
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
install_docker_compose_plugin() {
print_colored "$blue" "Checking for Docker Compose plugin (v2)..."
if docker compose version &> /dev/null; then
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
print_colored "$green" "Docker Compose plugin is already installed: $(docker compose version)"
return 0
fi
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
print_colored "$yellow" "Docker Compose plugin not found."
print_colored "$blue" "Attempting to install/update docker-compose-plugin..."
if [[ -x "$(command -v apt-get)" ]]; then
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
apt-get install -y docker-compose-plugin || print_colored "$yellow" "apt: docker-compose-plugin not found or error. Trying legacy."
elif [[ -x "$(command -v yum)" ]]; then
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
yum install -y docker-compose-plugin || print_colored "$yellow" "yum: docker-compose-plugin not found or error. Trying legacy."
elif [[ -x "$(command -v dnf)" ]]; then
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
dnf install -y docker-compose-plugin || print_colored "$yellow" "dnf: docker-compose-plugin not found or error. Trying legacy."
else
print_colored "$yellow" "No known package manager for docker-compose-plugin. Will try legacy."
fi
if docker compose version &> /dev/null; then
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
print_colored "$green" "Docker Compose plugin is now available: $(docker compose version)"
return 0
fi
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
print_colored "$yellow" "Docker Compose plugin (v2) still not found. Attempting to install legacy docker-compose (v1)..."
if command -v docker-compose &>/dev/null; then
print_colored "$green" "Legacy docker-compose is already installed: $(docker-compose --version)"
return 0
fi
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
print_colored "$blue" "Downloading latest legacy docker-compose..."
LATEST_COMPOSE_VERSION=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep '"tag_name":' | cut -d'"' -f4)
if [ -z "$LATEST_COMPOSE_VERSION" ]; then
print_colored "$red" "Failed to fetch latest docker-compose version from GitHub API. Please install it manually."
exit 1
fi
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
print_colored "$blue" "Latest legacy docker-compose version: $LATEST_COMPOSE_VERSION"
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
COMPOSE_URL="https://github.com/docker/compose/releases/download/$LATEST_COMPOSE_VERSION/docker-compose-$(uname -s)-$(uname -m)"
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
INSTALL_PATH="/usr/local/bin/docker-compose"
print_colored "$blue" "Installing docker-compose to $INSTALL_PATH..."
curl -SL "$COMPOSE_URL" -o "$INSTALL_PATH"
if [ $? -ne 0 ]; then
print_colored "$red" "Download failed from $COMPOSE_URL. Please check the URL or install manually."
INSTALL_PATH_ALT="/usr/bin/docker-compose"
print_colored "$blue" "Attempting alternative installation to $INSTALL_PATH_ALT..."
curl -SL "$COMPOSE_URL" -o "$INSTALL_PATH_ALT"
if [ $? -ne 0 ]; then
print_colored "$red" "Download to $INSTALL_PATH_ALT also failed. Please install docker-compose manually."
exit 1
fi
chmod +x "$INSTALL_PATH_ALT"
2023-02-09 19:18:06 +00:00
else
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
chmod +x "$INSTALL_PATH"
fi
if command -v docker-compose &>/dev/null; then
print_colored "$green" "Legacy docker-compose installed successfully: $(docker-compose --version)"
else
print_colored "$red" "Installation of legacy docker-compose failed or it's not in PATH. Please install it manually."
exit 1
fi
}
2024-10-04 12:31:15 +00:00
# --- Main Installation Logic ---
main() {
check_root
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
detect_os
print_colored "$blue" "Starting 3X-UI New Frontend Docker-based Installation..."
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
install_dependencies
install_docker # Corrected function name
install_docker_compose_plugin # Corrected function name
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
local user_install_dir # Made variables local where appropriate
read -rp "Enter installation directory (default: $INSTALL_DIR): " user_install_dir
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
INSTALL_DIR=${user_install_dir:-$INSTALL_DIR}
print_colored "$blue" "Panel will be installed in: $INSTALL_DIR"
mkdir -p "$INSTALL_DIR"
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
local REPO_PATH="$INSTALL_DIR/$REPO_DIR_NAME"
if [ -d "$REPO_PATH" ] && [ -d "$REPO_PATH/.git" ]; then
print_colored "$yellow" "Existing repository found at $REPO_PATH. Attempting to update..."
cd "$REPO_PATH" || { print_colored "$red" "Failed to cd to $REPO_PATH"; exit 1; }
git fetch --all
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
print_colored "$yellow" "Checking out and pulling latest 'main' branch..."
2025-06-04 19:47:48 +00:00
current_branch=$(git rev-parse --abbrev-ref HEAD)
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
if [ "\$current_branch" != "main" ] && [ "\$current_branch" != "master" ]; then
if git show-ref --verify --quiet refs/heads/main; then
git checkout main
elif git show-ref --verify --quiet refs/heads/master; then
git checkout master
else
print_colored "$red" "Could not find main or master branch to checkout."
# exit 1 # Or proceed with current branch
fi
fi
2025-06-04 19:50:57 +00:00
git reset --hard origin/$(git rev-parse --abbrev-ref HEAD)
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
git pull
cd "$INSTALL_DIR"
else
print_colored "$blue" "Cloning repository from $REPO_URL into $REPO_PATH..."
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
rm -rf "$REPO_PATH"
git clone --depth 1 "$REPO_URL" "$REPO_PATH" || { print_colored "$red" "Failed to clone repository."; exit 1; }
fi
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
if [ ! -d "$REPO_PATH" ]; then
print_colored "$red" "Failed to clone or find repository at $REPO_PATH. Aborting."
exit 1
fi
cd "$REPO_PATH"
if [ ! -f "docker-compose.yml" ] || [ ! -f "new-frontend/Dockerfile" ] || [ ! -f "Dockerfile.backend" ]; then
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
print_colored "$red" "Essential Docker configuration files not found in the repository ($REPO_PATH). Aborting."
exit 1
fi
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
print_colored "$blue" "Creating data directories (db, cert) if they don't exist in $REPO_PATH..."
mkdir -p db
mkdir -p cert
local DEFAULT_FRONTEND_PORT=3000
local DEFAULT_BACKEND_PANEL_PORT=2053
local HOST_FRONTEND_PORT
local HOST_BACKEND_PANEL_PORT
local INTERNAL_BACKEND_PORT=2053
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
local USER_API_URL
local NEXT_PUBLIC_API_BASE_URL
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
print_colored "$yellow" "Configuring .env file in $REPO_PATH..."
read -rp "Enter HOST port for Frontend (default: $DEFAULT_FRONTEND_PORT): " HOST_FRONTEND_PORT
HOST_FRONTEND_PORT=\${HOST_FRONTEND_PORT:-$DEFAULT_FRONTEND_PORT}
read -rp "Enter HOST port for Backend Panel (default: $DEFAULT_BACKEND_PANEL_PORT): " HOST_BACKEND_PANEL_PORT
HOST_BACKEND_PANEL_PORT=\${HOST_BACKEND_PANEL_PORT:-$DEFAULT_BACKEND_PANEL_PORT}
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
DEFAULT_API_URL="http://backend:$INTERNAL_BACKEND_PORT"
read -rp "Enter API Base URL for Frontend (default: $DEFAULT_API_URL, press Enter to use default): " USER_API_URL
NEXT_PUBLIC_API_BASE_URL=\${USER_API_URL:-$DEFAULT_API_URL}
cat << EOF_ENV > .env
# .env for 3x-ui docker-compose
FRONTEND_HOST_PORT=$HOST_FRONTEND_PORT
BACKEND_HOST_PORT=$HOST_BACKEND_PANEL_PORT
BACKEND_INTERNAL_PORT=$INTERNAL_BACKEND_PORT
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
NEXT_PUBLIC_API_BASE_URL=$NEXT_PUBLIC_API_BASE_URL
XRAY_VMESS_AEAD_FORCED=false
XUI_ENABLE_FAIL2BAN=true
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
# XUI_USERNAME=admin
# XUI_PASSWORD=admin
EOF_ENV
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
print_colored "$green" ".env file configured in $REPO_PATH."
print_colored "$yellow" "Note: Frontend will be accessible on host at port $HOST_FRONTEND_PORT."
print_colored "$yellow" "Backend panel (API) will be accessible on host at port $HOST_BACKEND_PANEL_PORT."
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
print_colored "$blue" "Building and starting services with Docker Compose (from $REPO_PATH)..."
print_colored "$yellow" "This may take a few minutes for the first build..."
if docker compose up -d --build --remove-orphans; then
print_colored "$green" "3X-UI services (new frontend & backend) started successfully!"
print_colored "$green" "Frontend should be accessible at: http://<your_server_ip>:$HOST_FRONTEND_PORT"
print_colored "$yellow" "Please allow a moment for services to initialize fully."
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
print_colored "$blue" "To manage services, navigate to '$REPO_PATH' and use 'docker compose' commands (e.g., docker compose logs -f, docker compose stop)."
else
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
print_colored "$red" "Failed to start services with Docker Compose. Please check logs above and run 'docker compose logs' in '$REPO_PATH' for details."
exit 1
fi
print_colored "$green" "Installation finished."
2023-02-09 19:18:06 +00:00
}
# --- Script Execution ---
feat: Complete frontend rebuild, Docker setup, and new install script This commit delivers a fully rebuilt frontend using React/Next.js and a new Docker-based deployment strategy. Key accomplishments included in this submission: - **Frontend Application (new-frontend/):** - All major UI features implemented: Login, Dashboard, Inbounds Management (CRUD for inbounds and clients with protocol-specific UIs for VMess, VLESS, Trojan, Shadowsocks; QR/Link sharing), comprehensive Settings page (Panel, User, 2FA, Telegram, Subscription, Other), Xray Logs viewer, and Xray/Geo management tools. - Dark mode support reviewed. - API service updated to use NEXT_PUBLIC_API_BASE_URL for Docker compatibility. - Frontend project successfully builds with default Next.js output. - Dynamic pages restored to full functionality. - **Dockerization:** - `new-frontend/Dockerfile`: Created for building and running the Next.js frontend. - `Dockerfile.backend`: Created for building and running the Go backend. - `docker-compose.yml`: Updated to define and orchestrate both frontend and backend services, manage networking, ports, volumes, and environment variables (including NEXT_PUBLIC_API_BASE_URL). - **Installation Script (`install.sh`):** - Completely refactored to support the new Docker-based deployment. - Includes functions to check for/install Docker and Docker Compose. - Clones/updates the project repository. - Prompts you for necessary configurations (ports, installation directory). - Creates a `.env` file for `docker-compose`. - Uses `docker compose up -d --build` to launch the panel. - Syntax errors you reported have been fixed. - **Documentation (`README.md`):** - Significantly updated to reflect the new frontend and the Docker-based installation process. - Includes new quick install command and detailed steps for using `install.sh` and managing services with `docker compose`. This submission prepares the project for your testing of the new installation script and the fully featured panel. You can now pull this branch and run the `install.sh` script from the repository root to set up the panel.
2025-06-04 19:30:18 +00:00
main "$@"
exit 0