Format the repository with Prettier
CI has been running `prettier --check` against a tree that was never formatted, so the check reported 63 files and failed every run. Nothing here is a behaviour change: `pnpm lint` and the four typecheck builds pass exactly as before. conduit-bringup-artifacts is added to .prettierignore instead. Those files are captured bring-up reports, not maintained sources; reflowing them would only churn a record of what happened.
This commit is contained in:
+57
-47
@@ -1,6 +1,7 @@
|
||||
# Installation Guide
|
||||
|
||||
This guide covers three deployment methods:
|
||||
|
||||
1. **Development Setup** — for local development
|
||||
2. **Docker Production** — single-command deployment with Docker Compose
|
||||
3. **Manual Production** — step-by-step on Ubuntu 22.04+
|
||||
@@ -10,10 +11,12 @@ This guide covers three deployment methods:
|
||||
## Prerequisites
|
||||
|
||||
### All Methods
|
||||
|
||||
- Git
|
||||
- A PostgreSQL 16+ database (or use the included Docker Compose)
|
||||
|
||||
### Development
|
||||
|
||||
- **Node.js** 20+ ([nodejs.org](https://nodejs.org))
|
||||
- **pnpm** 9.15+ (`corepack enable && corepack prepare pnpm@9.15.4 --activate`)
|
||||
- **Rust** 1.83+ ([rustup.rs](https://rustup.rs))
|
||||
@@ -21,6 +24,7 @@ This guide covers three deployment methods:
|
||||
- **Docker** — for running PostgreSQL and Redis locally
|
||||
|
||||
### Docker Production
|
||||
|
||||
- **Docker** 24+ with Docker Compose v2
|
||||
- At least **2 GB RAM** and **10 GB disk** for the panel itself
|
||||
- Additional resources for game servers on daemon nodes
|
||||
@@ -77,6 +81,7 @@ All three steps are idempotent, so re-running them after a `git pull` is the
|
||||
normal way to pick up schema and default-game changes.
|
||||
|
||||
After seeding, you'll have:
|
||||
|
||||
- **Admin account**: `admin@gamepanel.local` / `admin123`
|
||||
- **Games**: Minecraft Java & Bedrock, CS2, Terraria, Rust, Satisfactory,
|
||||
FiveM, ARK: Survival Evolved
|
||||
@@ -155,14 +160,14 @@ Then open `http://<server-ip>:80` and sign in with
|
||||
|
||||
### 2.2 What gets started
|
||||
|
||||
| Service | Port | Description |
|
||||
|---------|------|-------------|
|
||||
| `postgres` | internal | PostgreSQL database |
|
||||
| `redis` | internal | Rate limiting & cache |
|
||||
| `migrate` | — | Applies the schema + seed, then exits |
|
||||
| `api` | internal | Fastify REST API |
|
||||
| `web` | `WEB_PORT` (80) | nginx + React SPA, proxies `/api` and `/socket.io` |
|
||||
| `daemon` | `DAEMON_GRPC_PORT` (50051) | Rust gRPC daemon |
|
||||
| Service | Port | Description |
|
||||
| ---------- | -------------------------- | -------------------------------------------------- |
|
||||
| `postgres` | internal | PostgreSQL database |
|
||||
| `redis` | internal | Rate limiting & cache |
|
||||
| `migrate` | — | Applies the schema + seed, then exits |
|
||||
| `api` | internal | Fastify REST API |
|
||||
| `web` | `WEB_PORT` (80) | nginx + React SPA, proxies `/api` and `/socket.io` |
|
||||
| `daemon` | `DAEMON_GRPC_PORT` (50051) | Rust gRPC daemon |
|
||||
|
||||
Only `web` and `daemon` publish ports. Postgres, Redis and the API stay on the
|
||||
internal Compose network.
|
||||
@@ -174,11 +179,11 @@ The `migrate` service runs on every `docker compose up`; all three of its steps
|
||||
|
||||
In the panel, create a node with:
|
||||
|
||||
| Field | Value |
|
||||
|-------|-------|
|
||||
| FQDN | `host.docker.internal` (or the host's IP/hostname) |
|
||||
| gRPC port | the `DAEMON_GRPC_PORT` from `.env` |
|
||||
| Daemon token | the `DAEMON_TOKEN` from `.env` |
|
||||
| Field | Value |
|
||||
| ------------ | -------------------------------------------------- |
|
||||
| FQDN | `host.docker.internal` (or the host's IP/hostname) |
|
||||
| gRPC port | the `DAEMON_GRPC_PORT` from `.env` |
|
||||
| Daemon token | the `DAEMON_TOKEN` from `.env` |
|
||||
|
||||
### 2.4 Where game server files live
|
||||
|
||||
@@ -550,12 +555,12 @@ but nothing in it is panel-specific.
|
||||
`.github/workflows/ci.yml` pushes four images to this Gitea instance's own
|
||||
container registry on every `v*` tag:
|
||||
|
||||
| Image | Contents |
|
||||
|---|---|
|
||||
| `gamepanel-api` | Fastify API |
|
||||
| Image | Contents |
|
||||
| ------------------- | -------------------------------------------------------------------- |
|
||||
| `gamepanel-api` | Fastify API |
|
||||
| `gamepanel-migrate` | The API Dockerfile's `migrate` stage, run once before the API starts |
|
||||
| `gamepanel-web` | SPA + nginx, built with `VITE_API_URL=/api` |
|
||||
| `gamepanel-daemon` | Rust daemon |
|
||||
| `gamepanel-web` | SPA + nginx, built with `VITE_API_URL=/api` |
|
||||
| `gamepanel-daemon` | Rust daemon |
|
||||
|
||||
Add a `REGISTRY_TOKEN` repository secret with package write scope, then:
|
||||
|
||||
@@ -578,14 +583,14 @@ the node. If the panel has a file manager, both steps can be done from it.
|
||||
|
||||
Paste `docker-compose.panel.yml` into the panel's custom-compose screen and set:
|
||||
|
||||
| Variable | Example | Notes |
|
||||
|---|---|---|
|
||||
| `REGISTRY` | `gits.hibna.com.tr/hibna` | Namespace holding the four images |
|
||||
| `TAG` | `v0.1.0` | The tag you pushed |
|
||||
| `HOST_PORT` | `8096` | **Not 80** if the panel's own web server owns it |
|
||||
| `DB_PASSWORD`, `REDIS_PASSWORD` | `openssl rand -hex 24` | |
|
||||
| `JWT_SECRET`, `JWT_REFRESH_SECRET` | `openssl rand -hex 64` | |
|
||||
| `CORS_ORIGIN` | `https://panel.example.com` | Must match the address the browser uses |
|
||||
| Variable | Example | Notes |
|
||||
| ---------------------------------- | --------------------------- | ------------------------------------------------ |
|
||||
| `REGISTRY` | `gits.hibna.com.tr/hibna` | Namespace holding the four images |
|
||||
| `TAG` | `v0.1.0` | The tag you pushed |
|
||||
| `HOST_PORT` | `8096` | **Not 80** if the panel's own web server owns it |
|
||||
| `DB_PASSWORD`, `REDIS_PASSWORD` | `openssl rand -hex 24` | |
|
||||
| `JWT_SECRET`, `JWT_REFRESH_SECRET` | `openssl rand -hex 64` | |
|
||||
| `CORS_ORIGIN` | `https://panel.example.com` | Must match the address the browser uses |
|
||||
|
||||
The published port is called `HOST_PORT` because panels commonly reverse-proxy
|
||||
"the" port of an installation and need to know which one that is when a stack
|
||||
@@ -657,25 +662,30 @@ Then add the node in the panel with the remote machine's FQDN.
|
||||
## Troubleshooting
|
||||
|
||||
### API won't start
|
||||
|
||||
- Check `DATABASE_URL` is correct and PostgreSQL is running
|
||||
- Ensure migrations have been applied: `pnpm db:migrate`
|
||||
- Check logs: `journalctl -u gamepanel-api -f` or `docker compose logs api`
|
||||
|
||||
### Daemon can't connect
|
||||
|
||||
- Verify `api_url` in daemon config points to the API
|
||||
- Check `node_token` matches what's stored in the panel's nodes table
|
||||
- Ensure the daemon's gRPC port (50051) is open
|
||||
|
||||
### Web shows blank page
|
||||
|
||||
- Build the SPA: `pnpm --filter @source/web build`
|
||||
- Check nginx config: `sudo nginx -t`
|
||||
- Verify API proxy is working: `curl http://localhost:3000/api/health`
|
||||
|
||||
### Docker permission denied
|
||||
|
||||
- Ensure the daemon user is in the `docker` group: `usermod -aG docker <user>`
|
||||
- Or run the daemon with appropriate privileges
|
||||
|
||||
### protoc not found (daemon build)
|
||||
|
||||
- Ubuntu: `sudo apt install protobuf-compiler`
|
||||
- macOS: `brew install protobuf`
|
||||
- Or download from [github.com/protocolbuffers/protobuf/releases](https://github.com/protocolbuffers/protobuf/releases)
|
||||
@@ -718,24 +728,24 @@ sudo systemctl reload nginx
|
||||
|
||||
## Environment Variables Reference
|
||||
|
||||
| Variable | Default | Description |
|
||||
|----------|---------|-------------|
|
||||
| `DATABASE_URL` | — | PostgreSQL connection string |
|
||||
| `DB_USER` | `gamepanel` | PostgreSQL username (Docker) |
|
||||
| `DB_PASSWORD` | `gamepanel` | PostgreSQL password (Docker) |
|
||||
| `DB_NAME` | `gamepanel` | Database name (Docker) |
|
||||
| `DB_PORT` | `5432` | PostgreSQL exposed port |
|
||||
| `REDIS_URL` | — | Redis connection string |
|
||||
| `REDIS_PASSWORD` | `gamepanel` | Redis password |
|
||||
| `PORT` | `3000` | API listen port |
|
||||
| `HOST` | `0.0.0.0` | API listen host |
|
||||
| `NODE_ENV` | `development` | Environment mode |
|
||||
| `JWT_SECRET` | — | **Required.** Access token signing key |
|
||||
| `JWT_REFRESH_SECRET` | — | **Required.** Refresh token signing key |
|
||||
| `CORS_ORIGIN` | `http://localhost:5173` | Allowed CORS origin |
|
||||
| `RATE_LIMIT_MAX` | `100` | Max requests per window |
|
||||
| `RATE_LIMIT_WINDOW_MS` | `60000` | Rate limit window (ms) |
|
||||
| `WEB_PORT` | `80` | Web nginx exposed port |
|
||||
| `API_PORT` | `3000` | API exposed port (Docker) |
|
||||
| `DAEMON_CONFIG` | `/etc/gamepanel/config.yml` | Daemon config file path |
|
||||
| `DAEMON_GRPC_PORT` | `50051` | Daemon gRPC exposed port |
|
||||
| Variable | Default | Description |
|
||||
| ---------------------- | --------------------------- | --------------------------------------- |
|
||||
| `DATABASE_URL` | — | PostgreSQL connection string |
|
||||
| `DB_USER` | `gamepanel` | PostgreSQL username (Docker) |
|
||||
| `DB_PASSWORD` | `gamepanel` | PostgreSQL password (Docker) |
|
||||
| `DB_NAME` | `gamepanel` | Database name (Docker) |
|
||||
| `DB_PORT` | `5432` | PostgreSQL exposed port |
|
||||
| `REDIS_URL` | — | Redis connection string |
|
||||
| `REDIS_PASSWORD` | `gamepanel` | Redis password |
|
||||
| `PORT` | `3000` | API listen port |
|
||||
| `HOST` | `0.0.0.0` | API listen host |
|
||||
| `NODE_ENV` | `development` | Environment mode |
|
||||
| `JWT_SECRET` | — | **Required.** Access token signing key |
|
||||
| `JWT_REFRESH_SECRET` | — | **Required.** Refresh token signing key |
|
||||
| `CORS_ORIGIN` | `http://localhost:5173` | Allowed CORS origin |
|
||||
| `RATE_LIMIT_MAX` | `100` | Max requests per window |
|
||||
| `RATE_LIMIT_WINDOW_MS` | `60000` | Rate limit window (ms) |
|
||||
| `WEB_PORT` | `80` | Web nginx exposed port |
|
||||
| `API_PORT` | `3000` | API exposed port (Docker) |
|
||||
| `DAEMON_CONFIG` | `/etc/gamepanel/config.yml` | Daemon config file path |
|
||||
| `DAEMON_GRPC_PORT` | `50051` | Daemon gRPC exposed port |
|
||||
|
||||
Reference in New Issue
Block a user