From 9679e424fc45e0a683b3928dd3f5b75aba828c44 Mon Sep 17 00:00:00 2001 From: Joel Mattison Date: Thu, 25 Jun 2026 20:24:07 -0400 Subject: [PATCH] Add XUI.ONE 1.5.13 installer with self-hosted Gitea mirror Bootstrap installer that downloads the pre-patched XUI 1.5.13 package from our Gitea generic-package mirror (GitHub fallback), checksum-verifies it, and runs the bundled ./install. Includes preflight checks (root, Ubuntu 20/22/24, x86_64, RAM/disk, re-install guard). Co-Authored-By: Claude Opus 4.8 (1M context) --- .gitignore | 9 ++ README.md | 119 +++++++++++++++++++++ install_xui.sh | 191 ++++++++++++++++++++++++++++++++++ release/XUI_1.5.13.zip.sha256 | 1 + 4 files changed, 320 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100755 install_xui.sh create mode 100644 release/XUI_1.5.13.zip.sha256 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0958265 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +# Large release archive — host on CDN / private git LFS, don't commit the 661MB zip +release/*.zip +release/download.log + +# Keep the checksum so installs can be integrity-verified +!release/*.sha256 + +# Gitea credentials — never commit +.gitea/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..983ee64 --- /dev/null +++ b/README.md @@ -0,0 +1,119 @@ +# XUI.ONE 1.5.13 Installer + +A bootstrap installer for the pre-patched **XUI.ONE 1.5.13** panel, modeled on +the midesi.net `installxui.sh` wrapper. The release package is mirrored to our +own **Gitea generic-package registry** (fast, self-hosted), with the upstream +[XUIPatch](https://github.com/xuione/XUIPatch) GitHub release as an automatic +fallback. + +## What it does + +`install_xui.sh` is a thin, safe wrapper around the official XUI installer: + +1. Pre-flight checks — root, Ubuntu 20.04/22.04/24.04, x86_64, RAM/disk, re-install guard +2. Installs missing deps (`wget`, `unzip`, `tar`) +3. Downloads `XUI_1.5.13.zip` (~661 MB) from the Gitea mirror (falls back to GitHub) +4. Verifies the SHA-256 checksum (on by default) +5. Extracts `install`, `database.sql`, `xui.tar.gz` +6. Runs the bundled `./install`, which prompts for your **license key** and a + sysctl overwrite (answer **Y**) +7. Panel URL + MySQL credentials are written to `/root/credentials.txt` + +> The release is **pre-patched/pre-licensed**. You still enter a license key +> when the bundled `install` runs — that behavior comes from the XUI package +> itself, not this wrapper. + +## Usage + +On a clean Ubuntu server, as **root**: + +```bash +# One-liner — pulls the installer from our Gitea, then runs it: +bash <(wget -qO- https://git.ops01.hprx.zip/api/packages/seed/generic/xui-installer/1.0.0/install_xui.sh) + +# Or locally: +chmod +x install_xui.sh +./install_xui.sh +``` + +The script itself is published to the same Gitea generic registry. To update it, +re-PUT a new version (bump `1.0.0`) and adjust the one-liner accordingly: + +```bash +curl -X PUT -H "Authorization: token " \ + -H "Content-Type: application/octet-stream" \ + -T install_xui.sh \ + "https://git.ops01.hprx.zip/api/packages/seed/generic/xui-installer//install_xui.sh" +``` + +## Mirror (where the package lives) + +The 661 MB release is hosted on our Gitea, publicly downloadable with **no auth**: + +``` +https://git.ops01.hprx.zip/api/packages/seed/generic/xui/1.5.13/XUI_1.5.13.zip +sha256: a92e5f21a338c56190d7580f449492c970b5d4219474548ca5ec2f06bc57b2e7 +``` + +Re-uploading later (e.g. a new version) — from any box with the Gitea token: + +```bash +curl -X PUT \ + -H "Authorization: token " \ + -H "Content-Type: application/octet-stream" \ + -T XUI_1.5.13.zip \ + "https://git.ops01.hprx.zip/api/packages/seed/generic/xui//XUI_1.5.13.zip" +``` + +> `Content-Type: application/octet-stream` is **required** — Gitea's generic +> registry returns HTTP 500 ("isn't multipart/form-data") without it. + +## Configuration (env vars) + +| Variable | Default | Purpose | +|---------------------|------------------------------------------------------|------------------------------------------------------| +| `XUI_URL` | Gitea mirror URL (above) | Override the primary download source | +| `XUI_FALLBACK_URL` | GitHub XUIPatch release | Override the fallback source | +| `XUI_SHA256` | baked-in known-good hash | Override, or set to `""` to skip checksum verify | +| `XUI_WORKDIR` | `/opt/xui_install` | Where the package is downloaded/extracted | + +Example pointing at a different mirror: + +```bash +XUI_URL="https://cdn.example.com/xui/XUI_1.5.13.zip" \ +XUI_SHA256="a92e5f21a338c56190d7580f449492c970b5d4219474548ca5ec2f06bc57b2e7" \ +./install_xui.sh +``` + +## Local archive (`release/`) + +The package itself is **not** kept in this repo (661 MB, git-ignored) — the +durable copy is the Gitea mirror above. Only the checksum is tracked: + +- `release/XUI_1.5.13.zip.sha256` — feed to `XUI_SHA256` for integrity checks. + +Package contents (the three files midesi's tarball also ships): + +``` +install # the XUI installer (prompts for license + sysctl) +database.sql # initial schema +xui.tar.gz # the panel itself +``` + +To pull a local copy anytime: + +```bash +curl -L -o release/XUI_1.5.13.zip \ + "https://git.ops01.hprx.zip/api/packages/seed/generic/xui/1.5.13/XUI_1.5.13.zip" +``` + +## Credentials + +Gitea creds live in `.gitea/` (git-ignored): `token` and `url`. The token is +scoped **public-only + write:repository + write:package**. Rotate it in Gitea +(Settings → Applications) if it's ever exposed. + +## System requirements + +- Ubuntu 20.04 / 22.04 / 24.04 LTS, clean install, x86_64 +- 6+ CPU cores, 16–32 GB RAM, 480 GB+ SSD/NVMe, 1 Gbps recommended diff --git a/install_xui.sh b/install_xui.sh new file mode 100755 index 0000000..ea1b915 --- /dev/null +++ b/install_xui.sh @@ -0,0 +1,191 @@ +#!/bin/bash +# +# XUI.ONE 1.5.13 Installer (bootstrap) +# ----------------------------------- +# Downloads the pre-patched XUI.ONE 1.5.13 release, extracts it, and runs the +# bundled installer. Modeled on the midesi.net installxui.sh wrapper, but pulls +# the package directly from the XUIPatch GitHub release. +# +# Usage (as root): +# bash <(wget -qO- https://raw.githubusercontent.com//xui_installer/main/install_xui.sh) +# -- or -- +# chmod +x install_xui.sh && ./install_xui.sh +# +set -euo pipefail + +# --------------------------------------------------------------------------- +# Config +# --------------------------------------------------------------------------- +RELEASE_NAME="XUI_1.5.13.zip" + +# Primary download source: self-hosted Gitea generic-package mirror (fast, under +# our control). Override with the XUI_URL env var to point elsewhere. +DEFAULT_URL="https://git.ops01.hprx.zip/api/packages/seed/generic/xui/1.5.13/${RELEASE_NAME}" +URL="${XUI_URL:-$DEFAULT_URL}" + +# Fallback source: the upstream XUIPatch GitHub release. Tried automatically if +# the primary mirror is unreachable. Override with XUI_FALLBACK_URL. +FALLBACK_URL="${XUI_FALLBACK_URL:-https://github.com/xuione/XUIPatch/releases/download/main/${RELEASE_NAME}}" + +# Integrity check: known-good SHA-256 of XUI_1.5.13.zip. Verified before extract. +# Override/clear with the XUI_SHA256 env var (set to "" to skip). +EXPECTED_SHA256="${XUI_SHA256-a92e5f21a338c56190d7580f449492c970b5d4219474548ca5ec2f06bc57b2e7}" + +WORKDIR="${XUI_WORKDIR:-/opt/xui_install}" + +# --------------------------------------------------------------------------- +# Helpers +# --------------------------------------------------------------------------- +c_reset=$'\033[0m'; c_blue=$'\033[1;34m'; c_green=$'\033[1;32m' +c_yellow=$'\033[1;33m'; c_red=$'\033[1;31m' + +info() { printf '%s[*]%s %s\n' "$c_blue" "$c_reset" "$*"; } +ok() { printf '%s[+]%s %s\n' "$c_green" "$c_reset" "$*"; } +warn() { printf '%s[!]%s %s\n' "$c_yellow" "$c_reset" "$*"; } +die() { printf '%s[x]%s %s\n' "$c_red" "$c_reset" "$*" >&2; exit 1; } + +banner() { + cat <<'EOF' + +=============================================== + XUI.ONE 1.5.13 Installer +=============================================== + +EOF +} + +# --------------------------------------------------------------------------- +# Pre-flight checks +# --------------------------------------------------------------------------- +preflight() { + # Must be root + if [ "$(id -u)" -ne 0 ]; then + die "This installer must be run as root. Try: sudo su - then re-run." + fi + + # OS / version check (XUI 1.5.13 is tested on Ubuntu 20.04 / 22.04 / 24.04) + if [ -r /etc/os-release ]; then + # shellcheck disable=SC1091 + . /etc/os-release + if [ "${ID:-}" != "ubuntu" ]; then + warn "This package is tested on Ubuntu only (detected: ${PRETTY_NAME:-unknown})." + warn "Continuing anyway, but the install may fail." + else + case "${VERSION_ID:-}" in + 20.04|22.04|24.04) ok "Ubuntu ${VERSION_ID} detected (supported)." ;; + *) warn "Ubuntu ${VERSION_ID:-?} is untested for this build (supported: 20.04 / 22.04 / 24.04)." ;; + esac + fi + else + warn "Could not detect OS (no /etc/os-release). Proceeding cautiously." + fi + + # Architecture + arch="$(uname -m)" + [ "$arch" = "x86_64" ] || warn "Architecture is '$arch'; XUI expects x86_64." + + # Resource warnings (non-fatal) + mem_gb=$(awk '/MemTotal/ {printf "%d", $2/1024/1024}' /proc/meminfo 2>/dev/null || echo 0) + [ "${mem_gb:-0}" -ge 8 ] || warn "Only ${mem_gb}GB RAM detected; 16GB+ recommended for production." + disk_gb=$(df -BG --output=avail / 2>/dev/null | tail -1 | tr -dc '0-9' || echo 0) + [ "${disk_gb:-0}" -ge 20 ] || warn "Only ${disk_gb}GB free on /; 40GB+ recommended." + + # Re-install guard + if [ -d /home/xui ]; then + warn "/home/xui already exists — XUI may already be installed." + printf 'Continue and re-run the installer anyway? (y/N): ' + read -r ans + case "$ans" in y|Y) ;; *) die "Aborted by user." ;; esac + fi +} + +# --------------------------------------------------------------------------- +# Dependencies +# --------------------------------------------------------------------------- +ensure_deps() { + local missing=() + for bin in wget unzip tar; do + command -v "$bin" >/dev/null 2>&1 || missing+=("$bin") + done + if [ "${#missing[@]}" -gt 0 ]; then + info "Installing missing dependencies: ${missing[*]}" + export DEBIAN_FRONTEND=noninteractive + apt-get update -qq + apt-get install -y -qq "${missing[@]}" + fi +} + +# --------------------------------------------------------------------------- +# Download + verify +# --------------------------------------------------------------------------- +fetch() { + mkdir -p "$WORKDIR" + cd "$WORKDIR" + + info "Downloading XUI release package..." + info "Primary source: $URL" + if ! wget --tries=3 --timeout=60 --quiet --show-progress \ + --progress=bar:force:noscroll "$URL" -O "$RELEASE_NAME"; then + warn "Primary source failed; trying fallback: $FALLBACK_URL" + rm -f "$RELEASE_NAME" + if ! wget --tries=3 --timeout=60 --quiet --show-progress \ + --progress=bar:force:noscroll "$FALLBACK_URL" -O "$RELEASE_NAME"; then + die "Download failed from both primary and fallback sources." + fi + fi + [ -s "$RELEASE_NAME" ] || die "Downloaded file is empty: $RELEASE_NAME" + + if [ -n "$EXPECTED_SHA256" ]; then + info "Verifying checksum..." + actual=$(sha256sum "$RELEASE_NAME" | awk '{print $1}') + [ "$actual" = "$EXPECTED_SHA256" ] \ + || die "Checksum mismatch! expected=$EXPECTED_SHA256 actual=$actual" + ok "Checksum verified." + fi +} + +# --------------------------------------------------------------------------- +# Extract + run +# --------------------------------------------------------------------------- +extract_and_run() { + cd "$WORKDIR" + info "Extracting files..." + unzip -o -q "$RELEASE_NAME" || die "Extraction failed." + + [ -f install ] || die "Expected 'install' script not found in package." + + info "Cleaning up archive..." + rm -f "$RELEASE_NAME" + + info "Setting permissions..." + chmod +x install + + cat <<'EOF' + +----------------------------------------------- + Handing over to the XUI installer. + You will be prompted for: + - your license key + - sysctl overwrite (answer Y — recommended) + After it finishes, MySQL credentials are saved + to /root/credentials.txt +----------------------------------------------- + +EOF + info "Starting XUI install..." + ./install +} + +# --------------------------------------------------------------------------- +# Main +# --------------------------------------------------------------------------- +main() { + banner + preflight + ensure_deps + fetch + extract_and_run + ok "Installer finished. Check /root/credentials.txt for your panel details." +} + +main "$@" diff --git a/release/XUI_1.5.13.zip.sha256 b/release/XUI_1.5.13.zip.sha256 new file mode 100644 index 0000000..5064f87 --- /dev/null +++ b/release/XUI_1.5.13.zip.sha256 @@ -0,0 +1 @@ +a92e5f21a338c56190d7580f449492c970b5d4219474548ca5ec2f06bc57b2e7 XUI_1.5.13.zip