diff --git a/README.md b/README.md index 0cecf96..4360623 100644 --- a/README.md +++ b/README.md @@ -20,8 +20,8 @@ docker compose --profile production up -d bun run setup && bun run dev # Using LXC Containers -# For Proxmox VE (online) -curl -fsSL https://raw.githubusercontent.com/arunavo4/gitea-mirror/main/scripts/gitea-mirror-lxc-proxmox.sh | bash +# For Proxmox VE (online) - Community script by Tobias ([CrazyWolf13](https://github.com/CrazyWolf13)) +curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/install/gitea-mirror-install.sh | bash # For local testing (offline-friendly) sudo LOCAL_REPO_DIR=~/Development/gitea-mirror ./scripts/gitea-mirror-lxc-local.sh @@ -175,8 +175,9 @@ Gitea Mirror offers two deployment options for LXC containers: ```bash # One-command installation on Proxmox VE -# Optional env overrides: CTID HOSTNAME STORAGE DISK_SIZE CORES MEMORY BRIDGE IP_CONF -curl -fsSL https://raw.githubusercontent.com/arunavo4/gitea-mirror/main/scripts/gitea-mirror-lxc-proxmox.sh | bash +# Uses the community-maintained script by Tobias ([CrazyWolf13](https://github.com/CrazyWolf13)) +# at [community-scripts/ProxmoxVED](https://github.com/community-scripts/ProxmoxVED) +curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/install/gitea-mirror-install.sh | bash ``` **2. Local testing (offline-friendly, works on developer laptops)** diff --git a/scripts/README-lxc.md b/scripts/README-lxc.md index 4ba71df..c3fc75c 100644 --- a/scripts/README-lxc.md +++ b/scripts/README-lxc.md @@ -18,17 +18,18 @@ Run **Gitea Mirror** in an isolated LXC container, either: ### One-command install ```bash -# optional env overrides: CTID HOSTNAME STORAGE DISK_SIZE CORES MEMORY BRIDGE IP_CONF -sudo bash -c "$(curl -fsSL https://raw.githubusercontent.com/arunavo4/gitea-mirror/main/scripts/gitea-mirror-lxc-proxmox.sh)" +# Community-maintained script for Proxmox VE by Tobias ([CrazyWolf13](https://github.com/CrazyWolf13)) +# at [community-scripts/ProxmoxVED](https://github.com/community-scripts/ProxmoxVED) +sudo bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/install/gitea-mirror-install.sh)" ``` What it does: -* Creates **privileged** CT `$CTID` with nesting enabled -* Installs curl / git / Bun (official installer) +* Uses the community-maintained script from ProxmoxVED +* Installs dependencies and Bun runtime * Clones & builds `arunavo4/gitea-mirror` -* Writes a root-run systemd service and starts it -* Prints the container IP + random `JWT_SECRET` +* Creates a systemd service and starts it +* Sets up a random `JWT_SECRET` for security Browse to: diff --git a/scripts/README.md b/scripts/README.md index e0d0fef..1e313e2 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -107,9 +107,11 @@ bun scripts/make-events-old.ts ### LXC Container Deployment -Two scripts are provided for deploying Gitea Mirror in LXC containers: +Two deployment options are available for LXC containers: -1. **gitea-mirror-lxc-proxmox.sh**: For online deployment on a Proxmox VE host +1. **Proxmox VE (online)**: Using the community-maintained script by Tobias ([CrazyWolf13](https://github.com/CrazyWolf13)) + - Author: Tobias ([CrazyWolf13](https://github.com/CrazyWolf13)) + - Available at: [community-scripts/ProxmoxVED](https://github.com/community-scripts/ProxmoxVED/blob/main/install/gitea-mirror-install.sh) - Pulls everything from GitHub - Creates a privileged container with the application - Sets up systemd service diff --git a/scripts/gitea-mirror-lxc-proxmox.sh b/scripts/gitea-mirror-lxc-proxmox.sh deleted file mode 100755 index d242a2e..0000000 --- a/scripts/gitea-mirror-lxc-proxmox.sh +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/env bash -# gitea-mirror-lxc-proxmox.sh -# Fully online installer for a Proxmox LXC guest running Gitea Mirror + Bun. - -set -euo pipefail - -# ────── adjustable defaults ────────────────────────────────────────────── -CTID=${CTID:-106} # container ID -HOSTNAME=${HOSTNAME:-gitea-mirror} -STORAGE=${STORAGE:-local-lvm} # where rootfs lives -DISK_SIZE=${DISK_SIZE:-8G} -CORES=${CORES:-2} -MEMORY=${MEMORY:-2048} # MiB -BRIDGE=${BRIDGE:-vmbr0} -IP_CONF=${IP_CONF:-dhcp} # or "192.168.1.240/24,gw=192.168.1.1" - -PORT=4321 -JWT_SECRET=$(openssl rand -hex 32) - -REPO="https://github.com/arunavo4/gitea-mirror.git" -# ───────────────────────────────────────────────────────────────────────── - -TEMPLATE='ubuntu-22.04-standard_22.04-1_amd64.tar.zst' -TEMPLATE_PATH="/var/lib/vz/template/cache/${TEMPLATE}" - -echo "▶️ Ensuring template exists…" -if [[ ! -f $TEMPLATE_PATH ]]; then - pveam update >/dev/null - pveam download "$STORAGE" "$TEMPLATE" -fi - -echo "▶️ Creating container $CTID (if missing)…" -if ! pct status "$CTID" &>/dev/null; then - pct create "$CTID" "$TEMPLATE_PATH" \ - --rootfs "$STORAGE:$DISK_SIZE" \ - --hostname "$HOSTNAME" \ - --cores "$CORES" --memory "$MEMORY" \ - --net0 "name=eth0,bridge=$BRIDGE,ip=$IP_CONF" \ - --features nesting=1 \ - --unprivileged 0 -fi - -pct start "$CTID" - -echo "▶️ Installing base packages inside CT $CTID…" -pct exec "$CTID" -- bash -c 'apt update && apt install -y curl git build-essential openssl sqlite3 unzip' - -echo "▶️ Installing Bun runtime…" -pct exec "$CTID" -- bash -c ' - export BUN_INSTALL=/opt/bun - curl -fsSL https://bun.sh/install | bash -s -- --yes - ln -sf /opt/bun/bin/bun /usr/local/bin/bun - ln -sf /opt/bun/bin/bun /usr/local/bin/bunx - bun --version -' - -echo "▶️ Cloning & building Gitea Mirror…" -pct exec "$CTID" -- bash -c " - git clone --depth=1 '$REPO' /opt/gitea-mirror || (cd /opt/gitea-mirror && git pull) - cd /opt/gitea-mirror - bun install - bun run build - bun run manage-db init -" - -echo "▶️ Creating systemd service…" -pct exec "$CTID" -- bash -c " -cat >/etc/systemd/system/gitea-mirror.service <