diff --git a/roles/zomboid/tasks/main.yml b/roles/zomboid/tasks/main.yml index 61bca4e..cac74ce 100644 --- a/roles/zomboid/tasks/main.yml +++ b/roles/zomboid/tasks/main.yml @@ -51,6 +51,8 @@ - /usr/share/zoneinfo/America/Denver:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro ports: + # Steam query ports (8766/8767) required for public server-list visibility; harmless when private + - "8766-8767:8766-8767/udp" - "16261-16276:16261-16276/udp" - "27015:27015/tcp" network: @@ -69,5 +71,5 @@ PUBLIC: "{{ zomboid_public }}" MEMORY: "{{ zomboid_memory }}" SERVERPRESET: "{{ zomboid_preset }}" - FORCEUPDATE: "true" + FORCEUPDATE: "{{ zomboid_force_update }}" LANG: "en_US.UTF-8" \ No newline at end of file diff --git a/roles/zomboid/templates/zomboid.ini.j2 b/roles/zomboid/templates/zomboid.ini.j2 index 4062e96..508d49a 100644 --- a/roles/zomboid/templates/zomboid.ini.j2 +++ b/roles/zomboid/templates/zomboid.ini.j2 @@ -9,4 +9,7 @@ MaxPlayers={{ zomboid_max_players }} PVP={{ zomboid_pvp | lower }} PauseEmpty={{ zomboid_pause_empty | lower }} RCONPassword={{ zomboid_rcon_password }} -RCONPort=27015 \ No newline at end of file +RCONPort=27015 +# Steam networking follows the visibility mode: public servers use the Steam +# backend (browser listing + relay), private ones fall back to plain UDP direct-connect. +UseSteamNetworking={{ 'true' if zomboid_public|lower == 'true' else 'false' }} \ No newline at end of file diff --git a/vars.yml b/vars.yml index c1d1150..ed09379 100755 --- a/vars.yml +++ b/vars.yml @@ -95,11 +95,14 @@ minecraft_plugins: ## same as mc.boxswapper.io / vpn.boxswapper.io). Router MUST forward UDP 16261-16276 + TCP 27015 (RCON) ## -> 10.10.0.46. Server ini is rendered from roles/zomboid/templates/zomboid.ini.j2 on deploy; the ## published UDP range (16261-16276) covers zomboid_max_players=16 (game 16261 + query 16262 + per-slot ports). +## PUBLIC mode (zomboid_public: "true") also requires router forwards UDP 8766-8767 (Steam query) and +## publishes them; PRIVATE mode (the original design) needs only 16261-16276 — clients direct-connect +## (server browser never lists private servers). zomboid_host: zomboid.boxswapper.io zomboid_ip: 10.10.0.46 zomboid_image: docker.io/danixu86/project-zomboid-dedicated-server:latest ## SERVERNAME becomes the config folder/file name — must NOT contain spaces or special characters. -zomboid_servername: zomboid +zomboid_servername: Boxswapper zomboid_displayname: "Boxswapper Zomboid Server" zomboid_admin_username: admin ## CHANGE THESE before first deploy — ADMINPASSWORD is mandatory on first startup (server fails to boot without it), @@ -108,7 +111,7 @@ zomboid_admin_username: admin zomboid_admin_password: 9QmvIhCPOUcWeV9W zomboid_rcon_password: lnaScHaCnB2z8k7D zomboid_password: DOvNml9VCyeXlJx2 -zomboid_public: "false" +zomboid_public: "true" ## Server ini is rendered from roles/zomboid/templates/zomboid.ini.j2 on every deploy — ## vars.yml is the source of truth for the ini, so edits to these vars re-apply on re-run. ## MaxPlayers must fit the published/forwarded UDP range (16261-16276 = 16 slots); raise the range @@ -116,6 +119,9 @@ zomboid_public: "false" zomboid_max_players: 16 zomboid_pvp: "true" zomboid_pause_empty: "true" +## "true" makes the container re-verify the full 7.2GB Steam install on EVERY start (slow boots). +## Leave "false" for fast boots; flip to "true" when a new PZ build drops and re-run once. +zomboid_force_update: "false" zomboid_memory: 8g -zomboid_preset: apocalypse +zomboid_preset: Apocalypse