linuxserver / docker-minetest

GNU General Public License v3.0
51 stars 33 forks source link

Cant change Port - always defaults to 30.000 #43

Closed KingBBQ closed 2 years ago

KingBBQ commented 2 years ago

Expected Behavior

Current Behavior

Server always starts up under 30000

Steps to Reproduce

  1. add port to docker-compose.yaml under "CLI port=30001"
  2. docker-compose up

Result: 2022-04-28 12:15:12: ACTION[Main]: Server for gameid="xxxx" listening on 0.0.0.0:30000.

Environment

OS: Ubuntu CPU architecture: x86_64

Command used to create docker container (run/create/compose/screenshot)


---
version: "2.1"
services:
  minetest-augsburg-demo:
    image: ghcr.io/linuxserver/minetest
    container_name: minetest-augsburg-demo
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Berlin
      # - CLI_ARGS=" --worldname ConnectionLost"
      - CLI_ARGS=" --world worlds --worldname NewAuxburg --port 30001"
      #- CLI_ARGS=" --worldname winter --world worlds"
      # - CLI_ARGS=" --worldname Montagsbauer --world worlds"
    volumes:
      - /opt/minetest/Augsburg2099-Demo/:/config/.minetest
    ports:
      - 30001:30001/udp
    restart: unless-stopped

Docker logs


minetest-augsburg-demo    | 2022-04-28 12:15:12: ACTION[Server]: Announcing start to servers.minetest.net
minetest-augsburg-demo    |         .__               __                   __
minetest-augsburg-demo    |   _____ |__| ____   _____/  |_  ____   _______/  |_
minetest-augsburg-demo    |  /     \|  |/    \_/ __ \   __\/ __ \ /  ___/\   __\
minetest-augsburg-demo    | |  Y Y  \  |   |  \  ___/|  | \  ___/ \___ \  |  |
minetest-augsburg-demo    | |__|_|  /__|___|  /\___  >__|  \___  >____  > |__|
minetest-augsburg-demo    |       \/        \/     \/          \/     \/
minetest-augsburg-demo    | 2022-04-28 12:15:12: ACTION[Main]: World at [/config/.minetest/worlds/NewAuxburg]
minetest-augsburg-demo    | 2022-04-28 12:15:12: ACTION[Main]: Server for gameid="antigrief" listening on 0.0.0.0:30000.
github-actions[bot] commented 2 years ago

Thanks for opening your first issue here! Be sure to follow the bug or feature issue templates!

drizuid commented 2 years ago

mmm we are hardcoding the port likely because no one considered things like server.minetest.net I'll work on a PR tomorrow for an envar to support changing the port on the inside.

https://github.com/linuxserver/docker-minetest/blob/50281e549a077163b30701eebdee91e9ba75fd95/root/etc/services.d/minetest/run#L4-L5

since the cli_args are checked before and the port is set after, it'll use the last entered variable which will always be 30000. We can potentially just move cli_args var to the end, or allow the internal port as a var itself. I'm more inclined to move the cli_args to the end for a quicker fix.

so something like

s6-setuidgid abc minetestserver --port 30000 \ 
 --config /config/.minetest/main-config/minetest.conf ${CLI_ARGS} 

perhaps? ill need to test

drizuid commented 2 years ago

prelim results look good

         __.               __.                 __.
  _____ |__| ____   _____ /  |_  _____  _____ /  |_
 /     \|  |/    \ /  __ \    _\/  __ \/   __>    _\
|  Y Y  \  |   |  \   ___/|  | |   ___/\___  \|  |
|__|_|  /  |___|  /\______>  |  \______>_____/|  |
      \/ \/     \/         \/                  \/
2022-05-02 11:28:36: ACTION[Main]: World at [/config/.minetest/worlds/world]
2022-05-02 11:28:36: ACTION[Main]: Server for gameid="minetest" listening on 0.0.0.0:30002.

i will submit the PR and need you guys to test and report back please.

KingBBQ commented 2 years ago

Just tested it—works perfectly - many, many thanks!!!!!