bruh
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
"role": "lobby"
|
||||
},
|
||||
"redis": {
|
||||
"url": null,
|
||||
"host": "127.0.0.1",
|
||||
"port": 6379,
|
||||
"password": null,
|
||||
@@ -63,13 +64,14 @@
|
||||
|
||||
| Field | Default | Meaning |
|
||||
|---|---|---|
|
||||
| `host` | `"127.0.0.1"` | Redis host |
|
||||
| `port` | `6379` | Redis port |
|
||||
| `password` | `null` | Redis AUTH password. Prefer the env var (below). |
|
||||
| `database` | `0` | Redis logical database (0-15 on stock Redis) |
|
||||
| `key_prefix` | `"network:"` | All keys NetworkCore writes start with this prefix. Server registry keys end up at `network:servers:<id>`. Change this only if you're sharing a Redis with something unrelated. |
|
||||
| `tls` | `false` | Enables TLS for the Redis connection (Lettuce `rediss://` equivalent). **Set to true whenever Redis is on a different host than the Hytale server**, since the connection crosses untrusted network. |
|
||||
| `verify_peer` | `true` | When `tls` is on, verifies the Redis server's certificate against the JVM's default trust store. Set to false only in dev / against self-signed certs. Logs a warning when disabled. |
|
||||
| `url` | `null` | Full Redis connection URI. Supports both `redis://` (plain) and `rediss://` (TLS). When set, **all other redis fields are ignored** (host, port, password, database, tls). This is what you want when your provider hands you a one-line connection string. Prefer the env var (below) over putting credentials in the file. |
|
||||
| `host` | `"127.0.0.1"` | Redis host. Only used when `url` is null. |
|
||||
| `port` | `6379` | Redis port. Only used when `url` is null. |
|
||||
| `password` | `null` | Redis AUTH password. Only used when `url` is null. Prefer the env var. |
|
||||
| `database` | `0` | Redis logical database (0-15 on stock Redis). Only used when `url` is null. |
|
||||
| `key_prefix` | `"network:"` | All keys NetworkCore writes start with this prefix. Server registry keys end up at `network:servers:<id>`. Change this only if you're sharing a Redis with something unrelated. **Applies regardless of `url`.** |
|
||||
| `tls` | `false` | Enables TLS for the Redis connection. Only used when `url` is null (the URI scheme picks TLS on/off when `url` is set). **Set to true whenever Redis is on a different host than the Hytale server**, since the connection crosses untrusted network. |
|
||||
| `verify_peer` | `true` | When TLS is on (via `tls: true` or a `rediss://` url), verifies the Redis server's certificate against the JVM's default trust store. Set to false only in dev / against self-signed certs. Logs a warning when disabled. |
|
||||
|
||||
### network
|
||||
|
||||
@@ -115,6 +117,7 @@ These take precedence over the config file at boot time. Use them for secrets so
|
||||
|
||||
| Env var | Overrides |
|
||||
|---|---|
|
||||
| `REDIS_URL` | `redis.url` (full connection URI) |
|
||||
| `REDIS_PASSWORD` | `redis.password` |
|
||||
| `NETWORK_AUTH_TOKEN` | `network.auth_token` |
|
||||
| `MYSQL_PASSWORD` | `mysql.password` |
|
||||
@@ -127,7 +130,7 @@ These take precedence over the config file at boot time. Use them for secrets so
|
||||
**Multi-server staging or production:**
|
||||
- `server.id` left null is fine if you're OK with the id changing on every boot. Set it to something stable like `lobby-prod-01` if you want logs and dashboards to keep continuity across restarts.
|
||||
- `server.role` set explicitly per server. This is what dashboards and routing use.
|
||||
- `redis.host` pointed at your shared Redis. `redis.password` not in the file; set `REDIS_PASSWORD` env var.
|
||||
- `redis.tls` **on** whenever Redis is on a different host than the Hytale server. `verify_peer` stays true unless Redis uses a self-signed cert you haven't loaded into the JVM trust store.
|
||||
- **Easiest path for hosted Redis**: set `REDIS_URL` env var to the `rediss://user:pass@host:port/0` string your provider gives you. Leave the host/port/password/database fields at defaults. The `rediss://` scheme already implies TLS - no need to touch `tls`.
|
||||
- **Alternative**: set `redis.host` / `redis.port` explicitly, put the password in `REDIS_PASSWORD`, and set `redis.tls: true`. Works the same; just more fields to keep in sync across servers.
|
||||
- `network.auth_token` not in the file; set `NETWORK_AUTH_TOKEN` env var to the same value on every server.
|
||||
- `metrics.bind` stays `127.0.0.1`. Run Prometheus on the same host (or use an SSH tunnel / reverse proxy with auth to expose it elsewhere).
|
||||
|
||||
+14
-4
@@ -4,6 +4,20 @@ Currently one in-game admin command: `/networkcore`.
|
||||
|
||||
All subcommands are run by an in-world player. Console support isn't wired up yet.
|
||||
|
||||
## Permissions
|
||||
|
||||
Every subcommand is gated by a permission node, checked via Hytale's `PermissionsModule`. Assign these to your staff/admin groups in the Hytale server's own permission config.
|
||||
|
||||
| Subcommand | Required permission |
|
||||
|---|---|
|
||||
| `/networkcore status` | `networkcore.status` |
|
||||
| `/networkcore servers` | `networkcore.servers` |
|
||||
| `/networkcore publish` | `networkcore.publish` |
|
||||
|
||||
You can grant the whole namespace with `networkcore.*` (Hytale's permission system handles wildcards). A player without the relevant node sees Hytale's standard `You do not have permission for this command.` message - the command system itself blocks execution before our code runs.
|
||||
|
||||
Permissions are wired via `AbstractCommand.requirePermission(node)` in each subcommand constructor, and `canGeneratePermission()` is overridden to false on every command (including the root) so Hytale doesn't auto-generate a different one and clash with ours.
|
||||
|
||||
## /networkcore status
|
||||
|
||||
Prints local server identity, Redis state, and the metrics endpoint.
|
||||
@@ -49,10 +63,6 @@ The JSON is parsed and wrapped in the standard envelope (with your auth token if
|
||||
|
||||
This is dangerous in production - it lets anyone with command access spoof any message on any channel. Lock it down with permissions before exposing to non-admins.
|
||||
|
||||
## Permissions
|
||||
|
||||
Subcommand permissions aren't enforced yet. If your server runs HytalePerms, gate `/networkcore` behind an admin group at the command-routing layer.
|
||||
|
||||
## Things this command does *not* do (and why)
|
||||
|
||||
- **Restart Redis / reload config.** Restart the server. Reload is fragile - half-loaded state is worse than no state.
|
||||
|
||||
Reference in New Issue
Block a user