From 36ffaf858df737b06d38f290a9ea16cd6a8b27d7 Mon Sep 17 00:00:00 2001 From: FluxCapacitor2 <31071265+FluxCapacitor2@users.noreply.github.com> Date: Mon, 11 Mar 2024 13:47:14 -0400 Subject: [PATCH] Add details for configuring gRPC ports on baremetal --- src/content/docs/deployment/1_baremetal.md | 18 ++++++++++++------ src/content/docs/reference/environment.md | 4 +++- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/content/docs/deployment/1_baremetal.md b/src/content/docs/deployment/1_baremetal.md index feee705..a31e481 100644 --- a/src/content/docs/deployment/1_baremetal.md +++ b/src/content/docs/deployment/1_baremetal.md @@ -15,12 +15,6 @@ This guide will walk you through the process of installing and running BlueDrago Running BlueDragon on baremetal is the simplest way to run BlueDragon software, but it's recommended that you use Docker or Kubernetes for production deployments. ::: -:::danger -This guide currently **will not work** because Komodo and Puffin run gRPC servers on the same port (50051), and Komodo connects to Puffin at a hardcoded hostname (`puffin`). - -This should be fixed soon, but in the meantime, we recommend using the Docker or Kubernetes deployment guides. -::: - ## Prerequisites - This guide assumes you're running on Linux. Other operating systems are not supported; though, you may be able to get it working on WSL. @@ -119,6 +113,9 @@ PUFFIN_MONGO_CONNECTION_STRING=mongodb://localhost:27017 PUFFIN_LUCKPERMS_URL=http://localhost:8080 PUFFIN_DEFAULT_GAMESERVER_IP=localhost PUFFIN_DEFAULT_PROXY_IP=localhost +PUFFIN_GRPC_PORT=50051 +PUFFIN_GAMESERVER_GRPC_PORT=50052 +PUFFIN_PROXY_GRPC_PORT=50053 # The amount of milliseconds in between minimum instance checks PUFFIN_INSTANCE_START_PERIOD_MS=5000 @@ -137,6 +134,13 @@ Running Puffin outside of a Docker container is not recommended. If you run into ### Proxy +First, configure environment variables: + +```properties +KOMODO_PUFFIN_URI=localhost:50051 # Connect to Puffin on port 50051 +KOMODO_GRPC_PORT=50053 # Create a gRPC server on port 50053 +``` + Komodo (the Velocity proxy plugin) reads the following configuration files: 1. `/run/proxy/plugins/komodo/proxy-config.properties` defines the MOTD: @@ -169,11 +173,13 @@ Here is an example: BLUEDRAGON_QUEUE_TYPE=IPC BLUEDRAGON_MONGO_CONNECTION_STRING=mongodb://localhost:27017 BLUEDRAGON_PUFFIN_HOSTNAME=localhost +BLUEDRAGON_PUFFIN_PORT=50051 # The port that Puffin's gRPC server runs on BLUEDRAGON_LUCKPERMS_HOSTNAME=http://localhost:8080 BLUEDRAGON_DEFAULT_GAME=lobby # This should correspond a game name found in the `game.properties` file in one of your games. BLUEDRAGON_AGONES_DISABLED=true # Agones is disabled without Kubernetes HOSTNAME=server-1 # This is the internal name of the Minecraft server. It is used to identify the server to other services, like Velocity and Puffin. PUFFIN_VELOCITY_SECRET= # Add your Velocity forwarding secret here +BLUEDRAGON_GRPC_SERVER_PORT=50052 # The port used to create a gRPC server ``` ### LuckPerms diff --git a/src/content/docs/reference/environment.md b/src/content/docs/reference/environment.md index f16983d..59a4761 100644 --- a/src/content/docs/reference/environment.md +++ b/src/content/docs/reference/environment.md @@ -13,14 +13,16 @@ If the `BLUEDRAGON_ENV_TYPE` is not set, the fallback is to check for a director ## Environment Variable Reference | Environment variable | Defaults | Description | -| ------------------------------------ | ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | +| ------------------------------------ | ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | --------------------------------- | | `BLUEDRAGON_QUEUE_TYPE` | **Dev**: `TEST`
**Prod**: `IPC` | Use "IPC" to connect to Puffin for queueing, or "TEST" for a fully-local/single-instance queue | | `BLUEDRAGON_MONGO_CONNECTION_STRING` | **Dev**: `mongodb://localhost:27017`
**Prod**: `mongodb://mongo:27017` | The hostname that resolves to a MongoDB instance | | `BLUEDRAGON_PUFFIN_HOSTNAME` | **Dev**: `localhost`
**Prod**: `puffin` | The hostname that resolves to a Puffin instance | +| `BLUEDRAGON_PUFFIN_PORT` | 50051 | 50051 | The port of Puffin's gRPC server. | | `BLUEDRAGON_LUCKPERMS_HOSTNAME` | **Dev**: `http://localhost:8080`
**Prod**: `http://luckperms:8080` | The hostname that resolves to a [standalone LuckPerms](https://luckperms.net/) instance | | `BLUEDRAGON_DEFAULT_GAME` | `lobby` | The game to automatically create on startup. Typically used to immediately initialize a lobby on each game server. | | `BLUEDRAGON_AGONES_DISABLED` | _Not set_ | If this environment variable is present with any value, Agones integration will be disabled. | | `PUFFIN_VELOCITY_SECRET` | _Not set_ | The Velocity modern forwarding secret. If not present, Velocity forwarding is disabled. | +| `BLUEDRAGON_GRPC_SERVER_PORT` | 50051 | The port to listen on for gRPC requests. | _[View ConfiguredEnvironment source code](https://github.com/BlueDragonMC/Server/blob/b05b09ad229ccf85da20130510c9c1cdf90bbeed/src/main/kotlin/com/bluedragonmc/server/queue/environments.kt#L23) for more details about server environment configuration._