Update README.md. Remove deploy and docker. Add zip and unzip to dependencies
This commit is contained in:
+2
-1
@@ -44,4 +44,5 @@ report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
|
|||||||
.bun-sqlite
|
.bun-sqlite
|
||||||
/assets
|
/assets
|
||||||
|
|
||||||
.git
|
.git
|
||||||
|
/.tmp
|
||||||
-24
@@ -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"]
|
|
||||||
@@ -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))
|
- **Bun** 1.3.1 or later ([install](https://bun.sh/install))
|
||||||
- **SQLite** (via `@moduletrace/bun-sqlite`)
|
- **SQLite** (via `@moduletrace/bun-sqlite`)
|
||||||
- **git**
|
- **git**
|
||||||
|
- **zip** and **unzip**
|
||||||
- **Linux** (Debian, Ubuntu, Fedora, Arch, Alpine, or similar)
|
- **Linux** (Debian, Ubuntu, Fedora, Arch, Alpine, or similar)
|
||||||
- Root access (for installation script and system service setup)
|
- Root access (for installation script and system service setup)
|
||||||
|
|
||||||
@@ -51,21 +52,6 @@ The install script will:
|
|||||||
8. Install the `wg-quick` helper script
|
8. Install the `wg-quick` helper script
|
||||||
9. Set up a systemd or OpenRC service (`wgui`)
|
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)
|
### Manual (Development)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@@ -154,12 +140,8 @@ wireguard-ui/
|
|||||||
├── db/
|
├── db/
|
||||||
│ ├── schema.ts # Database schema definition
|
│ ├── schema.ts # Database schema definition
|
||||||
│ └── types/db.ts # Generated database types
|
│ └── types/db.ts # Generated database types
|
||||||
├── deploy/
|
|
||||||
│ └── deploy-prod.sh # Production deployment script (rsync + Docker)
|
|
||||||
├── public/ # Static assets served by the server
|
├── public/ # Static assets served by the server
|
||||||
├── assets/ # Project assets
|
├── assets/ # Project assets
|
||||||
├── Dockerfile # Container image (oven/bun:1.3.1-debian)
|
|
||||||
├── entrypoint.sh # Docker entrypoint
|
|
||||||
├── bun-sqlite.config.ts # Database configuration
|
├── bun-sqlite.config.ts # Database configuration
|
||||||
├── bunext.config.ts # Bunext configuration
|
├── bunext.config.ts # Bunext configuration
|
||||||
├── package.json # Dependencies and scripts
|
├── package.json # Dependencies and scripts
|
||||||
@@ -188,36 +170,6 @@ Generate types from the schema:
|
|||||||
bun run db: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 (`[email protected]:/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
|
## Admin Route Hierarchy
|
||||||
|
|
||||||
| Route Pattern | Access | Features |
|
| Route Pattern | Access | Features |
|
||||||
|
|||||||
@@ -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
|
|
||||||
@@ -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
|
|
||||||
@@ -79,16 +79,16 @@ install_deps() {
|
|||||||
debian | ubuntu | linuxmint | raspbian)
|
debian | ubuntu | linuxmint | raspbian)
|
||||||
export DEBIAN_FRONTEND=noninteractive
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
apt-get update -y
|
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)
|
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)
|
arch | manjaro | endeavouros)
|
||||||
pacman -Syu --noconfirm --needed git curl ca-certificates openssl
|
pacman -Syu --noconfirm --needed git curl ca-certificates openssl zip unzip
|
||||||
;;
|
;;
|
||||||
alpine)
|
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"
|
fail "unsupported distro: $DISTRO"
|
||||||
|
|||||||
Reference in New Issue
Block a user