From 501b99cbc8bb53c025d68ec5c414b39237443885 Mon Sep 17 00:00:00 2001 From: Benjamin Toby Date: Mon, 21 Sep 2026 04:30:51 +0100 Subject: [PATCH] Update README.md. Remove deploy and docker. Add zip and unzip to dependencies --- .gitignore | 3 ++- Dockerfile | 24 ----------------- README.md | 50 +----------------------------------- deploy/deploy-prod.sh | 32 ----------------------- entrypoint.sh | 12 --------- src/scripts/install-wg-ui.sh | 8 +++--- 6 files changed, 7 insertions(+), 122 deletions(-) delete mode 100644 Dockerfile delete mode 100755 deploy/deploy-prod.sh delete mode 100644 entrypoint.sh diff --git a/.gitignore b/.gitignore index 6bd91c3..c9d9539 100644 --- a/.gitignore +++ b/.gitignore @@ -44,4 +44,5 @@ report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json .bun-sqlite /assets -.git \ No newline at end of file +.git +/.tmp \ No newline at end of file diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index ce66006..0000000 --- a/Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -FROM oven/bun:1.3.1-debian - -RUN apt update -RUN apt install -y curl bash nano wget zip unzip mariadb-client - -ENV NODE_ENV=production - -RUN mkdir /app - -WORKDIR /app - -RUN touch /root/.bashrc -RUN echo 'alias ll="ls -laF"' >/root/.bashrc - -COPY . /app/. - -RUN bun install - -ENV NODE_ENV=production - -COPY entrypoint.sh /entrypoint.sh -RUN chmod +x /entrypoint.sh - -ENTRYPOINT ["/entrypoint.sh"] diff --git a/README.md b/README.md index c98ebe9..e2312ea 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ An admin dashboard for Wireguard — manage hosts, clients, tunnels, and IP rule - **Bun** 1.3.1 or later ([install](https://bun.sh/install)) - **SQLite** (via `@moduletrace/bun-sqlite`) - **git** +- **zip** and **unzip** - **Linux** (Debian, Ubuntu, Fedora, Arch, Alpine, or similar) - Root access (for installation script and system service setup) @@ -51,21 +52,6 @@ The install script will: 8. Install the `wg-quick` helper script 9. Set up a systemd or OpenRC service (`wgui`) -### Docker - -Build and run with the provided Dockerfile: - -```bash -docker build -t wireguard-ui . -docker run -d --name wireguard-ui \ - -p 10752:10752 \ - -v wgui-data:/app/db \ - --restart unless-stopped \ - wireguard-ui -``` - -The entrypoint (`entrypoint.sh`) installs dependencies and starts the server. - ### Manual (Development) ```bash @@ -154,12 +140,8 @@ wireguard-ui/ ├── db/ │ ├── schema.ts # Database schema definition │ └── types/db.ts # Generated database types -├── deploy/ -│ └── deploy-prod.sh # Production deployment script (rsync + Docker) ├── public/ # Static assets served by the server ├── assets/ # Project assets -├── Dockerfile # Container image (oven/bun:1.3.1-debian) -├── entrypoint.sh # Docker entrypoint ├── bun-sqlite.config.ts # Database configuration ├── bunext.config.ts # Bunext configuration ├── package.json # Dependencies and scripts @@ -188,36 +170,6 @@ Generate types from the schema: bun run db:schema ``` -## Deployment - -### Production Deployment - -The deployment script (`deploy/deploy-prod.sh`) handles production deployment: - -```bash -SOURCE_DIRECTORY=/path/to/wireguard-ui bun run deploy:prod -``` - -This will: - -1. Rsync the project files to the production server (`deploy@195.26.246.243:/docker/bunext-mariadb`) -2. SSH into the server, rebuild the Docker image, and restart the container - -### Docker Production - -The Docker image (`Dockerfile`) is based on `oven/bun:1.3.1-debian`: - -```bash -docker build -t bunext-mariadb . -docker run --name bunext-mariadb -d \ - --network cloudflare --network mariadb \ - -v server-data:/data \ - --restart unless-stopped \ - bunext-mariadb:latest -``` - -The server runs on the port defined in `SiteData.ServerPort` (default: **10752**). - ## Admin Route Hierarchy | Route Pattern | Access | Features | diff --git a/deploy/deploy-prod.sh b/deploy/deploy-prod.sh deleted file mode 100755 index 0f8673f..0000000 --- a/deploy/deploy-prod.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -SOURCE_PATH="$SOURCE_DIRECTORY" - -if [ -z "${SOURCE_PATH:-}" ] || [ "$(realpath -m "$SOURCE_PATH")" = "/" ]; then - echo "Error: SOURCE_DIRECTORY is invalid or set to root path ('/')." >&2 - exit 1 -fi - - -SERVER_IP="195.26.246.243" -SERVER_PATH="/docker/bunext-mariadb" - -cd "$SOURCE_PATH" - -rsync -avz --exclude-from=.gitignore --delete \ - "$SOURCE_PATH/" "deploy@$SERVER_IP:$SERVER_PATH/" - -ssh -i "$HOME/.ssh/deploy" "deploy@$SERVER_IP" << 'EOF' -set -e -cd /docker/bunext-mariadb -docker build -t bunext-mariadb . -docker kill bunext-mariadb 2>/dev/null || echo "Service already killed" -docker rm bunext-mariadb 2>/dev/null || echo "Container already removed" -docker run --name bunext-mariadb -d \ - --network cloudflare --network mariadb \ - -v server-data:/data \ - --restart unless-stopped \ - bunext-mariadb:latest -EOF diff --git a/entrypoint.sh b/entrypoint.sh deleted file mode 100644 index 12099ac..0000000 --- a/entrypoint.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -set -e - -echo "=== Wireguard UI ===" - -echo "✓ Starting server on port ${PORT:-3000}..." - -cd /app - -bun install - -bun src/server.ts \ No newline at end of file diff --git a/src/scripts/install-wg-ui.sh b/src/scripts/install-wg-ui.sh index 8ddcdda..5a2f90b 100755 --- a/src/scripts/install-wg-ui.sh +++ b/src/scripts/install-wg-ui.sh @@ -79,16 +79,16 @@ install_deps() { debian | ubuntu | linuxmint | raspbian) export DEBIAN_FRONTEND=noninteractive apt-get update -y - apt-get install -y git curl ca-certificates openssl + apt-get install -y git curl ca-certificates openssl zip unzip ;; fedora | rhel | centos | rocky | almalinux | ol) - dnf install -y git curl ca-certificates openssl + dnf install -y git curl ca-certificates openssl zip unzip ;; arch | manjaro | endeavouros) - pacman -Syu --noconfirm --needed git curl ca-certificates openssl + pacman -Syu --noconfirm --needed git curl ca-certificates openssl zip unzip ;; alpine) - apk add --no-cache bash curl ca-certificates-bundle git openssl + apk add --no-cache bash curl ca-certificates-bundle git openssl zip unzip ;; *) fail "unsupported distro: $DISTRO"