Private
Public Access
1
0

Add colored output to install.sh, update all URLs to Gitea

Color system: green checkmarks for success, orange bold for info/hints,
cyan section headers, bold white title headers, yellow warnings, red
errors. Rolling progress preview lines shown in dim. UFW "Rules updated"
noise suppressed.

Updated all repository URLs from github.com/websitebox/websitebox to
git.constantprojects.xyz/tankadmin/websitebox across install.sh,
guide.md, and README.md.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
constantprojects
2026-02-24 08:49:13 -07:00
parent 9ec246cb65
commit eca351057b
3 changed files with 72 additions and 63 deletions

View File

@@ -31,7 +31,7 @@ A Docker-based, self-hosted WordPress deployment system. Provision a VPS, run th
1. **SSH into your VPS** and run the installer: 1. **SSH into your VPS** and run the installer:
```bash ```bash
curl -fsSL https://raw.githubusercontent.com/websitebox/websitebox/main/install.sh | bash curl -fsSL https://git.constantprojects.xyz/tankadmin/websitebox/raw/branch/main/install.sh | bash
``` ```
2. **Answer the setup wizard** prompts (domain, admin credentials, etc.) 2. **Answer the setup wizard** prompts (domain, admin credentials, etc.)

View File

@@ -165,7 +165,7 @@ If you get "Connection refused" or "Connection timed out," wait a minute — you
Now for the easy part. Copy and paste this single command into your terminal and press Enter: Now for the easy part. Copy and paste this single command into your terminal and press Enter:
[code:bash] [code:bash]
curl -fsSL https://raw.githubusercontent.com/websitebox/websitebox/main/install.sh | bash curl -fsSL https://git.constantprojects.xyz/tankadmin/websitebox/raw/branch/main/install.sh | bash
[/code] [/code]
[callout:tip] [callout:tip]
@@ -173,7 +173,7 @@ curl -fsSL https://raw.githubusercontent.com/websitebox/websitebox/main/install.
[/callout] [/callout]
[callout:info] [callout:info]
**What does this command do?** `curl` is a tool that downloads files from the internet. The URL points to the WebsiteBox install script on [GitHub](https://github.com/websitebox/websitebox) (where the project's code is publicly hosted). The `| bash` part tells your server to run the downloaded script. The entire install script is [open source](https://github.com/websitebox/websitebox/blob/main/install.sh) — you can read every line of it before running it if you want to verify what it does. **What does this command do?** `curl` is a tool that downloads files from the internet. The URL points to the WebsiteBox install script on [our Git server](https://git.constantprojects.xyz/tankadmin/websitebox) (where the project's code is publicly hosted). The `| bash` part tells your server to run the downloaded script. The entire install script is [open source](https://git.constantprojects.xyz/tankadmin/websitebox/src/branch/main/install.sh) — you can read every line of it before running it if you want to verify what it does.
[/callout] [/callout]
This one command does everything needed to prepare your server: This one command does everything needed to prepare your server:
@@ -246,7 +246,7 @@ When the "WebsiteBox Setup Wizard" header appears, the installer is done and the
[callout:warning] [callout:warning]
**If you get a "permission denied" error**, your server may need administrator privileges. Try this version instead: **If you get a "permission denied" error**, your server may need administrator privileges. Try this version instead:
`sudo bash -c "$(curl -fsSL https://raw.githubusercontent.com/websitebox/websitebox/main/install.sh)"` `sudo bash -c "$(curl -fsSL https://git.constantprojects.xyz/tankadmin/websitebox/raw/branch/main/install.sh)"`
`sudo` is a command that gives you administrator access. You may be asked to enter your password again. `sudo` is a command that gives you administrator access. You may be asked to enter your password again.
[/callout] [/callout]
@@ -714,7 +714,7 @@ The installer already set up a firewall and fail2ban, which handles the vast maj
[WordPress.org's documentation](https://wordpress.org/documentation/) and [WPBeginner](https://www.wpbeginner.com/) are excellent free resources for learning how to get the most out of your site. The [WordPress block editor guide](https://wordpress.org/documentation/article/wordpress-block-editor/) is particularly helpful for learning how to create beautiful page layouts. [WordPress.org's documentation](https://wordpress.org/documentation/) and [WPBeginner](https://www.wpbeginner.com/) are excellent free resources for learning how to get the most out of your site. The [WordPress block editor guide](https://wordpress.org/documentation/article/wordpress-block-editor/) is particularly helpful for learning how to create beautiful page layouts.
**Get help:** **Get help:**
If you run into problems or have questions, you can [open an issue on GitHub](https://github.com/websitebox/websitebox/issues) — that's where the project's developers and community track bugs and feature requests. You can also browse existing issues to see if someone has already had the same question. If you run into problems or have questions, you can [open an issue on our Git repository](https://git.constantprojects.xyz/tankadmin/websitebox/issues) — that's where the project's developers and community track bugs and feature requests. You can also browse existing issues to see if someone has already had the same question.
[callout:tip] [callout:tip]
You now own your website infrastructure. Unlike hosted platforms, nobody can take your site down for content policy reasons, raise your prices unexpectedly, or lock you into their ecosystem. Your data lives on your server, and you can move it anywhere. You now own your website infrastructure. Unlike hosted platforms, nobody can take your site down for content policy reasons, raise your prices unexpectedly, or lock you into their ecosystem. Your data lives on your server, and you can move it anywhere.

View File

@@ -5,6 +5,25 @@ set -eo pipefail
# Bootstrap script: installs Docker, clones repo, runs setup wizard # Bootstrap script: installs Docker, clones repo, runs setup wizard
# Usage: curl -fsSL <url>/install.sh | bash # Usage: curl -fsSL <url>/install.sh | bash
# --- Colors and formatting ---
BOLD='\033[1m'
DIM='\033[2m'
RESET='\033[0m'
RED='\033[1;31m'
GREEN='\033[1;32m'
YELLOW='\033[1;33m'
ORANGE='\033[1;38;5;208m'
CYAN='\033[1;36m'
WHITE='\033[1;37m'
header() { printf "\n${WHITE}═══════════════════════════════════════════════════════════${RESET}\n ${BOLD}%s${RESET}\n${WHITE}═══════════════════════════════════════════════════════════${RESET}\n\n" "$1"; }
section() { printf "\n${CYAN}───────────────────────────────────────────────────────────${RESET}\n ${BOLD}%s${RESET}\n${CYAN}───────────────────────────────────────────────────────────${RESET}\n" "$1"; }
step() { printf "${GREEN}${RESET} ${BOLD}%s${RESET}\n" "$1"; }
info() { printf "${ORANGE} %s${RESET}\n" "$1"; }
ok() { printf "${GREEN} ✓ %s${RESET}\n" "$1"; }
warn() { printf "${YELLOW} ⚠ %s${RESET}\n" "$1"; }
err() { printf "${RED} ✗ %s${RESET}\n" "$1"; }
# --- Rolling preview helper --- # --- Rolling preview helper ---
# Shows last 4 lines of output in-place, then clears when done. # Shows last 4 lines of output in-place, then clears when done.
# Keeps the terminal clean while still showing live progress. # Keeps the terminal clean while still showing live progress.
@@ -20,7 +39,7 @@ show_progress() {
printf '\033[%dA' "${#buffer[@]}" 2>/dev/null || true printf '\033[%dA' "${#buffer[@]}" 2>/dev/null || true
fi fi
for l in "${buffer[@]}"; do for l in "${buffer[@]}"; do
printf '\033[2K %.60s\n' "$l" printf "\033[2K${DIM} %.60s${RESET}\n" "$l"
done done
done done
# clear preview lines when done # clear preview lines when done
@@ -31,11 +50,7 @@ show_progress() {
fi fi
} }
echo "" header "WebsiteBox Installer"
echo "═══════════════════════════════════════════════════════════"
echo " WebsiteBox Installer"
echo "═══════════════════════════════════════════════════════════"
echo ""
# --- Check for root/sudo --- # --- Check for root/sudo ---
@@ -44,7 +59,7 @@ if [ "$(id -u)" -eq 0 ]; then
ACTUAL_USER="${SUDO_USER:-root}" ACTUAL_USER="${SUDO_USER:-root}"
else else
if ! command -v sudo &>/dev/null; then if ! command -v sudo &>/dev/null; then
echo "ERROR: This script requires root or sudo access." err "This script requires root or sudo access."
exit 1 exit 1
fi fi
SUDO="sudo" SUDO="sudo"
@@ -59,27 +74,27 @@ if [ -f /etc/os-release ]; then
OS_ID="$ID" OS_ID="$ID"
OS_VERSION="$VERSION_ID" OS_VERSION="$VERSION_ID"
else else
echo "ERROR: Cannot detect OS. /etc/os-release not found." err "Cannot detect OS. /etc/os-release not found."
echo "WebsiteBox supports Ubuntu 20.04+ and Debian 11+." err "WebsiteBox supports Ubuntu 20.04+ and Debian 11+."
exit 1 exit 1
fi fi
case "$OS_ID" in case "$OS_ID" in
ubuntu) ubuntu)
if [ "${OS_VERSION%%.*}" -lt 20 ]; then if [ "${OS_VERSION%%.*}" -lt 20 ]; then
echo "ERROR: Ubuntu 20.04 or later is required (detected: ${OS_VERSION})." err "Ubuntu 20.04 or later is required (detected: ${OS_VERSION})."
exit 1 exit 1
fi fi
;; ;;
debian) debian)
if [ "${OS_VERSION%%.*}" -lt 11 ]; then if [ "${OS_VERSION%%.*}" -lt 11 ]; then
echo "ERROR: Debian 11 or later is required (detected: ${OS_VERSION})." err "Debian 11 or later is required (detected: ${OS_VERSION})."
exit 1 exit 1
fi fi
;; ;;
*) *)
echo "WARNING: Unsupported OS detected (${OS_ID} ${OS_VERSION})." warn "Unsupported OS detected (${OS_ID} ${OS_VERSION})."
echo "WebsiteBox is tested on Ubuntu 20.04+ and Debian 11+." warn "WebsiteBox is tested on Ubuntu 20.04+ and Debian 11+."
read -rp "Continue anyway? (y/N) " cont read -rp "Continue anyway? (y/N) " cont
if [ "$cont" != "y" ] && [ "$cont" != "Y" ]; then if [ "$cont" != "y" ] && [ "$cont" != "Y" ]; then
exit 1 exit 1
@@ -87,48 +102,43 @@ case "$OS_ID" in
;; ;;
esac esac
echo "Detected: ${OS_ID} ${OS_VERSION}" ok "Detected: ${OS_ID} ${OS_VERSION}"
# --- Secure the Server --- # --- Secure the Server ---
echo "" section "Securing your server"
echo "───────────────────────────────────────────────────────────"
echo " Securing your server..."
echo "───────────────────────────────────────────────────────────"
# Update system packages step "Updating system packages..."
echo "Updating system packages..." info "Downloading the latest security patches for your operating system."
echo " Downloading the latest security patches for your operating system." info "On a fresh server this can take 2-10 minutes. Sit tight."
echo " On a fresh server this can take 2-10 minutes. Sit tight."
$SUDO apt-get update -qq $SUDO apt-get update -qq
DEBIAN_FRONTEND=noninteractive $SUDO apt-get upgrade -y -o Dpkg::Options::="--force-confold" 2>&1 | show_progress DEBIAN_FRONTEND=noninteractive $SUDO apt-get upgrade -y -o Dpkg::Options::="--force-confold" 2>&1 | show_progress
echo "System packages updated." ok "System packages updated."
# Install firewall, fail2ban, and automatic updates step "Installing security tools (firewall, fail2ban, auto-updates)..."
echo "Installing security tools (firewall, fail2ban, auto-updates)..." info "These protect your server from common attacks. Usually under a minute."
echo " These protect your server from common attacks. Usually under a minute."
DEBIAN_FRONTEND=noninteractive $SUDO apt-get install -y ufw fail2ban unattended-upgrades 2>&1 | show_progress DEBIAN_FRONTEND=noninteractive $SUDO apt-get install -y ufw fail2ban unattended-upgrades 2>&1 | show_progress
# Configure firewall — allow SSH first to avoid lockout # Configure firewall — allow SSH first to avoid lockout
if ! $SUDO ufw status | grep -q "Status: active"; then if ! $SUDO ufw status | grep -q "Status: active"; then
echo "Configuring firewall..." step "Configuring firewall..."
$SUDO ufw allow OpenSSH $SUDO ufw allow OpenSSH > /dev/null 2>&1
$SUDO ufw allow 80/tcp $SUDO ufw allow 80/tcp > /dev/null 2>&1
$SUDO ufw allow 443/tcp $SUDO ufw allow 443/tcp > /dev/null 2>&1
$SUDO ufw --force enable $SUDO ufw --force enable > /dev/null 2>&1
echo "Firewall enabled: SSH, HTTP, and HTTPS allowed. All other ports blocked." ok "Firewall enabled: SSH, HTTP, and HTTPS allowed. All other ports blocked."
else else
# Firewall already active — just make sure our ports are open # Firewall already active — just make sure our ports are open
$SUDO ufw allow OpenSSH 2>/dev/null || true $SUDO ufw allow OpenSSH 2>/dev/null || true
$SUDO ufw allow 80/tcp 2>/dev/null || true $SUDO ufw allow 80/tcp 2>/dev/null || true
$SUDO ufw allow 443/tcp 2>/dev/null || true $SUDO ufw allow 443/tcp 2>/dev/null || true
echo "Firewall already active. Verified SSH, HTTP, and HTTPS are allowed." ok "Firewall already active. Verified SSH, HTTP, and HTTPS are allowed."
fi fi
# Enable fail2ban # Enable fail2ban
$SUDO systemctl enable fail2ban --quiet 2>/dev/null || true $SUDO systemctl enable fail2ban --quiet 2>/dev/null || true
$SUDO systemctl start fail2ban 2>/dev/null || true $SUDO systemctl start fail2ban 2>/dev/null || true
echo "Fail2ban enabled: brute-force SSH protection active." ok "Fail2ban enabled: brute-force SSH protection active."
# Enable automatic security updates (non-interactive) # Enable automatic security updates (non-interactive)
echo 'Unattended-Upgrade::Allowed-Origins { echo 'Unattended-Upgrade::Allowed-Origins {
@@ -143,7 +153,7 @@ Unattended-Upgrade::Remove-Unused-Dependencies "true";' | $SUDO tee /etc/apt/apt
echo 'APT::Periodic::Update-Package-Lists "1"; echo 'APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";' | $SUDO tee /etc/apt/apt.conf.d/20auto-upgrades > /dev/null APT::Periodic::Unattended-Upgrade "1";' | $SUDO tee /etc/apt/apt.conf.d/20auto-upgrades > /dev/null
echo "Automatic security updates enabled." ok "Automatic security updates enabled."
# Configure Docker log rotation (create config before Docker install) # Configure Docker log rotation (create config before Docker install)
$SUDO mkdir -p /etc/docker $SUDO mkdir -p /etc/docker
@@ -155,33 +165,32 @@ if [ ! -f /etc/docker/daemon.json ]; then
"max-file": "3" "max-file": "3"
} }
}' | $SUDO tee /etc/docker/daemon.json > /dev/null }' | $SUDO tee /etc/docker/daemon.json > /dev/null
echo "Docker log rotation configured (10MB max per log, 3 files per container)." ok "Docker log rotation configured (10MB max per log, 3 files per container)."
else else
echo "Docker daemon.json already exists. Skipping log rotation config." ok "Docker daemon.json already exists. Skipping log rotation config."
fi fi
echo "" printf "\n${GREEN} Server secured:${RESET}\n"
echo " Server secured:" printf " ${BOLD}Firewall:${RESET} active (SSH, HTTP, HTTPS only)\n"
echo " Firewall: active (SSH, HTTP, HTTPS only)" printf " ${BOLD}Fail2ban:${RESET} active (SSH brute-force protection)\n"
echo " Fail2ban: active (SSH brute-force protection)" printf " ${BOLD}Auto-updates:${RESET} enabled (daily security patches)\n"
echo " Auto-updates: enabled (daily security patches)" printf " ${BOLD}Docker log limits:${RESET} configured (30MB max per container)\n\n"
echo " Docker log limits: configured (30MB max per container)"
echo ""
# --- Install Docker if needed --- # --- Install Docker if needed ---
DOCKER_JUST_INSTALLED=false DOCKER_JUST_INSTALLED=false
if command -v docker &>/dev/null; then if command -v docker &>/dev/null; then
echo "Docker is already installed." ok "Docker is already installed."
# Restart to pick up daemon.json if it was just created # Restart to pick up daemon.json if it was just created
if [ -f /etc/docker/daemon.json ]; then if [ -f /etc/docker/daemon.json ]; then
$SUDO systemctl restart docker 2>/dev/null || true $SUDO systemctl restart docker 2>/dev/null || true
fi fi
else else
echo "Installing Docker..." section "Installing Docker"
echo " Docker packages and runs your website in isolated containers." step "Installing Docker..."
echo " This is the largest download — usually takes 1-3 minutes." info "Docker packages and runs your website in isolated containers."
info "This is the largest download — usually takes 1-3 minutes."
# Install prerequisites # Install prerequisites
$SUDO apt-get update -qq $SUDO apt-get update -qq
@@ -206,14 +215,14 @@ else
if [ "$ACTUAL_USER" != "root" ]; then if [ "$ACTUAL_USER" != "root" ]; then
$SUDO usermod -aG docker "$ACTUAL_USER" $SUDO usermod -aG docker "$ACTUAL_USER"
DOCKER_JUST_INSTALLED=true DOCKER_JUST_INSTALLED=true
echo "Docker installed. User '${ACTUAL_USER}' added to docker group." ok "Docker installed. User '${ACTUAL_USER}' added to docker group."
fi fi
# Start and enable Docker # Start and enable Docker
$SUDO systemctl start docker $SUDO systemctl start docker
$SUDO systemctl enable docker $SUDO systemctl enable docker
echo "Docker installation complete." ok "Docker installation complete."
fi fi
# --- Clone Repository --- # --- Clone Repository ---
@@ -221,14 +230,14 @@ fi
INSTALL_DIR="${HOME}/websitebox" INSTALL_DIR="${HOME}/websitebox"
if [ -d "$INSTALL_DIR" ]; then if [ -d "$INSTALL_DIR" ]; then
echo "WebsiteBox directory already exists at ${INSTALL_DIR}" ok "WebsiteBox directory already exists at ${INSTALL_DIR}"
echo "Pulling latest changes..." info "Pulling latest changes..."
cd "$INSTALL_DIR" cd "$INSTALL_DIR"
git pull || true git pull || true
else else
echo "Cloning WebsiteBox..." step "Cloning WebsiteBox..."
echo " Downloading the project files from GitHub. Just a few seconds." info "Downloading the project files. Just a few seconds."
git clone https://github.com/websitebox/websitebox.git "$INSTALL_DIR" git clone https://git.constantprojects.xyz/tankadmin/websitebox.git "$INSTALL_DIR"
cd "$INSTALL_DIR" cd "$INSTALL_DIR"
fi fi
@@ -240,13 +249,13 @@ chmod +x setup.sh install.sh scripts/*.sh
echo "" echo ""
if [ "$DOCKER_JUST_INSTALLED" = true ] && [ "$ACTUAL_USER" != "root" ]; then if [ "$DOCKER_JUST_INSTALLED" = true ] && [ "$ACTUAL_USER" != "root" ]; then
# Activate docker group for this session without requiring logout/login # Activate docker group for this session without requiring logout/login
echo "Activating Docker permissions for current session..." info "Activating Docker permissions for current session..."
sg docker -c "./setup.sh" sg docker -c "./setup.sh"
else else
./setup.sh ./setup.sh
fi fi
echo "" echo ""
echo "If 'docker compose' commands fail later, log out and back in" warn "If 'docker compose' commands fail later, log out and back in"
echo "to permanently activate Docker permissions, then try again." warn "to permanently activate Docker permissions, then try again."
echo "" echo ""