mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-20 07:43:12 +09:00
Assign game port from host configured port ranges
Add host.factorio_port_range config to hosts that specify a pool of ports that gets automatically assigned to instances which do not have a game_port set on them. This allows setting up a port range that's forwarded to the host on the router and then configure that port range on the host and have instances automatically get assigned an available port when they start up. Resolves: #448
This commit is contained in:
1 parent
9742eb1645
commit
8733575255
5 files changed
+76
-6
No files matched your search
@@ -158,6 +158,7 @@ export interface HostConfigFields {
|
||||
"host.controller_token": string;
|
||||
"host.tls_ca": string | null;
|
||||
"host.public_address": string;
|
||||
"host.factorio_port_range": string;
|
||||
"host.max_reconnect_delay": number;
|
||||
}
|
||||
|
||||
@@ -220,6 +221,14 @@ export class HostConfig extends classes.Config<HostConfigFields> {
|
||||
type: "string",
|
||||
initialValue: "localhost",
|
||||
},
|
||||
"host.factorio_port_range": {
|
||||
title: "Factorio port range",
|
||||
description:
|
||||
"Range of UDP ports to use for game connections. Supports both comma separated values and " +
|
||||
"ranges separated with a dash.",
|
||||
type: "string",
|
||||
initialValue: "34100-34199",
|
||||
},
|
||||
"host.max_reconnect_delay": {
|
||||
title: "Max Reconnect Delay",
|
||||
description: "Maximum delay to wait before attempting to reconnect WebSocket",
|
||||
@@ -237,6 +246,7 @@ export interface InstanceConfigFields {
|
||||
|
||||
"factorio.version": string;
|
||||
"factorio.game_port": number | null;
|
||||
"factorio.host_assigned_game_port": number | null;
|
||||
"factorio.rcon_port": number | null;
|
||||
"factorio.rcon_password": string | null;
|
||||
"factorio.player_online_autosave_slots": number;
|
||||
@@ -286,11 +296,16 @@ export class InstanceConfig extends classes.Config<InstanceConfigFields> {
|
||||
initialValue: "latest",
|
||||
},
|
||||
"factorio.game_port": {
|
||||
description: "UDP port to run game on, uses a random port if null",
|
||||
description: "UDP port to run game on, uses a port in host.factorio_port_range if null",
|
||||
restartRequired: true,
|
||||
type: "number",
|
||||
optional: true,
|
||||
},
|
||||
"factorio.host_assigned_game_port": {
|
||||
access: ["host"],
|
||||
type: "number",
|
||||
optional: true,
|
||||
},
|
||||
"factorio.rcon_port": {
|
||||
description: "TCP port to run RCON on, uses a random port if null",
|
||||
restartRequired: true,
|
||||
|
||||
Reference in new issue
Block a user