#!/usr/bin/env bash # thellnx Panel: fresh Ubuntu 22.04 installation, without Git. # The body is defined before execution to avoid running a partial streamed script. thellnx_install() ( set -euo pipefail if [[ "${1:-}" == "--help" || "${1:-}" == "-h" ]]; then printf '%s\n' 'thellnx Panel — Ubuntu Server 22.04 LTS' 'Usage: sudo bash install.sh [--domain panel.example.com]' 'Run on a fresh VPS. No domain required. Access via HTTPS on VPS IP, port 8888.' 'Installs tx-panel with local HTTPS. --domain optionally uses Let’s Encrypt on 443.' exit 0 fi if [[ "$EUID" -ne 0 ]]; then printf '%s\n' 'Jalankan installer dengan sudo atau root.' >&2 exit 1 fi for required in curl python3 sha256sum mktemp; do command -v "$required" >/dev/null || { printf 'Perintah belum tersedia: %s\n' "$required" >&2; exit 1; } done if [[ ! -r /dev/tty ]]; then printf '%s\n' 'Buka terminal SSH interaktif untuk mengatur username dan password.' >&2 exit 1 fi umask 077 temporary="$(mktemp -d -t thellnx-bootstrap.XXXXXXXX)" trap 'rm -f -- "$temporary/installer.py"; rmdir -- "$temporary"' EXIT printf '%s\n' 'Mengunduh installer resmi thellnx Panel...' curl --fail --silent --show-error --proto '=https' --tlsv1.2 --connect-timeout 15 --max-time 120 --retry 2 \ 'https://repos.thellnx.site/installers/thellnx-install-1.0.3-r2.py' -o "$temporary/installer.py" printf '%s %s\n' '7fdf8866554718fd567c291d7860d8baac00ccefcd7fdfdbe77d2808aa33efbd' "$temporary/installer.py" | sha256sum --check --status || { printf '%s\n' 'Verifikasi installer gagal. Instalasi dibatalkan.' >&2 exit 1 } umask 022 python3 "$temporary/installer.py" --accept-root-install "$@"