Update README.md

This commit is contained in:
2026-09-20 18:38:34 +01:00
parent acbde93494
commit bd1aa199d3
2 changed files with 34 additions and 39 deletions
+34 -38
View File
@@ -9,14 +9,14 @@ An admin dashboard for Wireguard — manage hosts, clients, tunnels, and IP rule
- **Client Rules** — Define IP table rules per client (rule type, destination, ports, protocol) - **Client Rules** — Define IP table rules per client (rule type, destination, ports, protocol)
- **Media Management** — Upload and manage media assets (images, documents, etc.) with tagging, thumbnails, and RAG ingestion - **Media Management** — Upload and manage media assets (images, documents, etc.) with tagging, thumbnails, and RAG ingestion
- **User Management** — Multi-user support with role-based access (user types) - **User Management** — Multi-user support with role-based access (user types)
- **Persistent Storage** — MariaDB-backed database with automatic schema generation - **Persistent Storage** — SQLite database with automatic schema generation
- **WebSocket Support** — Real-time updates via WebSocket connections - **WebSocket Support** — Real-time updates via WebSocket connections
- **Responsive UI** — Tailwind CSS v4 with twui design system components - **Responsive UI** — Tailwind CSS v4 with twui design system components
## Prerequisites ## Prerequisites
- **Bun** 1.3.1 or later ([install](https://bun.sh/install)) - **Bun** 1.3.1 or later ([install](https://bun.sh/install))
- **MariaDB** (or compatible SQL database) - **SQLite** (via `@moduletrace/bun-sqlite`)
- **git** - **git**
- **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)
@@ -83,12 +83,12 @@ The dev server runs on port **10752** by default.
The `.env` file (gitignored) controls runtime behavior. It is auto-generated during installation if missing: The `.env` file (gitignored) controls runtime behavior. It is auto-generated during installation if missing:
| Variable | Description | Default | | Variable | Description | Default |
| ------------------- | ------------------------------------ | -------------------- | | ----------------- | ---------------------------------------- | -------------------- |
| `NODE_ENV` | Environment (`development`/`production`) | `production` | | `NODE_ENV` | Environment (`development`/`production`) | `production` |
| `ENCRYPTION_KEY` | Encryption key for sensitive data | Auto-generated | | `ENCRYPTION_KEY` | Encryption key for sensitive data | Auto-generated |
| `ENCRYPTION_SALT` | Encryption salt for sensitive data | Auto-generated | | `ENCRYPTION_SALT` | Encryption salt for sensitive data | Auto-generated |
| `DATA_DIR` | Application data directory | `$INSTALL_DIR/.data` | | `DATA_DIR` | Application data directory | `$INSTALL_DIR/.data` |
### Database Configuration ### Database Configuration
@@ -96,10 +96,10 @@ Edit `bun-sqlite.config.ts` to change database settings:
```typescript ```typescript
const config: BunSQLiteConfig = { const config: BunSQLiteConfig = {
db_name: "wgui", // Database file name db_name: "wgui", // Database file name
db_dir: "./db", // Database directory db_dir: "./db", // Database directory
typedef_file_path: "./db/types/db.ts", // Generated types typedef_file_path: "./db/types/db.ts", // Generated types
db_schema_file_name: "schema.ts", // Schema definition db_schema_file_name: "schema.ts", // Schema definition
}; };
``` ```
@@ -116,16 +116,12 @@ export const SiteData = {
## Available Scripts ## Available Scripts
| Command | Description | | Command | Description |
| ------------------- | ------------------------------------------------ | | ------------------- | ----------------------------------------- |
| `bun run dev` | Start development server (requires root) | | `bun run dev` | Start development server (requires root) |
| `bun run start` | Start production server | | `bun run start` | Start production server |
| `bun run build` | Build with bunext | | `bun run db:schema` | Generate/update database schema and types |
| `bun run db:schema` | Generate/update database schema and types | | `bun run db:admin` | Open database admin interface |
| `bun run db:admin` | Open database admin interface |
| `bun run deploy:prod` | Deploy to production server |
| `bunx tsc --noEmit` | Type-check only (no emit) |
| `bun test <file>` | Run individual test files |
## Project Structure ## Project Structure
@@ -175,16 +171,16 @@ wireguard-ui/
The database consists of the following tables: The database consists of the following tables:
| Table | Description | | Table | Description |
| ---------------- | ---------------------------------------------- | | ----------------- | ----------------------------------------------- |
| `users` | User accounts (name, email, username, password) | | `users` | User accounts (name, email, username, password) |
| `user_types` | User type assignments per user | | `user_types` | User type assignments per user |
| `media` | Media assets (images, documents, etc.) | | `media` | Media assets (images, documents, etc.) |
| `media_paradigms`| Media paradigm classifications per media item | | `media_paradigms` | Media paradigm classifications per media item |
| `clients` | WireGuard clients per host | | `clients` | WireGuard clients per host |
| `hosts` | WireGuard host configurations | | `hosts` | WireGuard host configurations |
| `client_rules` | IP table rules for each client | | `client_rules` | IP table rules for each client |
| `variables` | Application-wide key-value variables | | `variables` | Application-wide key-value variables |
Generate types from the schema: Generate types from the schema:
@@ -209,7 +205,7 @@ This will:
### Docker Production ### Docker Production
The Docker image (`Dockerfile`) is based on `oven/bun:1.3.1-debian` with MariaDB client tools installed: The Docker image (`Dockerfile`) is based on `oven/bun:1.3.1-debian`:
```bash ```bash
docker build -t bunext-mariadb . docker build -t bunext-mariadb .
@@ -224,11 +220,11 @@ 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 |
| ------------------- | ----------------------------- | ------------------------------------------- | | ------------------- | ------------------------------- | ------------------------------------------------------------------------------------ |
| `/admin/*` | Residents | Access booking, payments, chat, dependants, notifications, events, settings, support | | `/admin/*` | Residents | Access booking, payments, chat, dependants, notifications, events, settings, support |
| `/admin/admin/*` | Admin / ExCo | User management, payment schemes, documents, chat group management | | `/admin/admin/*` | Admin / ExCo | User management, payment schemes, documents, chat group management |
| `/admin/security/*` | Security / ExCo / Manager / ACo | Gate control, guest access monitoring, dependant verification | | `/admin/security/*` | Security / ExCo / Manager / ACo | Gate control, guest access monitoring, dependant verification |
## Development ## Development
-1
View File
@@ -8,7 +8,6 @@
"build": "bunx bunext build", "build": "bunx bunext build",
"db:schema": "bunx bun-sqlite schema -t", "db:schema": "bunx bun-sqlite schema -t",
"db:admin": "bunx bun-sqlite admin", "db:admin": "bunx bun-sqlite admin",
"deploy:prod": "./deploy/deploy-prod.sh",
"start": "NODE_ENV=production bun src/server.ts" "start": "NODE_ENV=production bun src/server.ts"
}, },
"devDependencies": { "devDependencies": {