minetest-go / mtui

management web ui for minetest
Other
17 stars 1 forks source link

Running mtui and minetest in different containers? #379

Closed zakimano closed 1 month ago

zakimano commented 1 month ago

Hi! I like this project a lot, looks very promising.

However, I would like to run minetest and mtui in separate containers, for example with a docker-compose.yml like such:

services:
  minetest:
    image: lscr.io/linuxserver/minetest:latest
    container_name: minetest
    restart: unless-stopped
    environment:
      - PUID=1001
      - PGID=1001
      - TZ=Etc/CET
      - "CLI_ARGS=--gameid mineclone2 --worldname world --logfile /config/.minetest/server.log"
    ports:
      - 30000:30000/udp
    volumes:
      - ./data:/config/.minetest

  mtui:
    image: ghcr.io/minetest-go/mtui:master
    container_name: minetest-mtui
    restart: unless-stopped
    environment:
      - WORLD_DIR=/data/worlds/world
      - MINETEST_CONFIG=/data/.minetest/minetest.conf
      - DEFAULT_THEME="darkly"
      - ENABLE_FEATURES="shell,luashell,minetest_config,modmanagement,signup,chat"
      - INSTALL_MTUI_MOD="true"
    ports:
      - 8080:8080/tcp # TODO: route through reverse proxy (+auth)
    volumes:
      - ./data:/data

I didn't explore all the options fully, but this configuration seems broken, for example mtui doesn't seem to recognize any of the mods installed, players online, ect.

What should I modify to achieve this? I can only guess that mtui perhaps needs IPC or HTTP access to minetest?

I would like to keep the game server and web ui in separate containers for both security and maintenance reasons, and as such granting a service running in a container access to the docker socket is an obvious dealbreaker for me. (Aka. I don't want / need the built-in docker management functionality, I do that externally)

Thank you!

BuckarooBanzay commented 1 month ago

I didn't explore all the options fully, but this configuration seems broken, for example mtui doesn't seem to recognize any of the mods installed, players online, ect.

I haven't really gotten around to writing any real docs yet, sorry.

About the mod-database: this info about installed mods and versions is done entirely within the mtui bounds, it can't detect outside mods as of yet, the mod-management is experimental too, just saying :wink:

I can only guess that mtui perhaps needs IPC or HTTP access to minetest?

Online player infos and chat- / lua-commands into the engine are sent/received over http, you might have to add a setting for that, for example:

mtui.url = http://ui:8080
mtui.key = {{mtui_key}}

(for a working example, see here: https://github.com/pandorabox-io/pandorabox.io/blob/master/minetest.conf#L120-L121)

I would like to keep the game server and web ui in separate containers for both security and maintenance reasons, and as such granting a service running in a container access to the docker socket is an obvious dealbreaker for me. (Aka. I don't want / need the built-in docker management functionality, I do that externally)

This should work too, i'm even using it myself on some servers that i've set up using docker-compose and don't want the ui to interfere

zakimano commented 1 month ago

Thanks for the clarification!