MinetestServer Web Gui

Post Reply
SonoMichele
New member
Posts: 4
Joined: Thu Nov 12, 2020 14:19
GitHub: xMicky24GIT
In-game: SonoMichele
Contact:

MinetestServer Web Gui

by SonoMichele » Post

Hi, I'm working on a minetest web gui (written in Python using Flask) that will allow users to manage their minetest server using a web app. My idea is to give them the ability to upload and download files via ftp directly from the webapp and visualize the server console's logs and to execute commands from the console.

I'm trying to implement the console system and I was able to get to stream content from the server process to the web page (route /) in real time.
My problem now is the execution of commands. When using the terminal directly I can execute commands just by typing /command.
So I created a route /test which should execute the command /status on the minetest server console but it doesn't execute it. I also tried to execute the command /kick SonoMichele (which is my in game name) but it doesn't kick me so I'm sure the command doesn't get executed.
The problems are that the command doesn't get executed and that the connection with the process get closed after the line

Code: Select all

SERVER_PROCESS.stdin.write(b"/status")
so my

Code: Select all

SERVER_PROCESS
will be

Code: Select all

NoneType
after some seconds but the minetest server is still running.
I also tried using

Code: Select all

SERVER_PROCESS.communicate(input=b"/status")
but I get the same result.

Here is my code (it's a Flask web app which I run on start.py using

Code: Select all

app = create_app()
and then

Code: Select all

app.run()
).

I don't know if it is relevant but when I run the command

Code: Select all

minetestserver —terminal
it uses an ncurses console as said here.

Here you can find the pypi page of the shelljob library.

Hope you can help me with my problems and thank you in advance.

SonoMichele
New member
Posts: 4
Joined: Thu Nov 12, 2020 14:19
GitHub: xMicky24GIT
In-game: SonoMichele
Contact:

Re: MinetestServer Web Gui

by SonoMichele » Post

Nevermind I was able to do it and is now open source on my gitlab account here

SonoMichele
New member
Posts: 4
Joined: Thu Nov 12, 2020 14:19
GitHub: xMicky24GIT
In-game: SonoMichele
Contact:

Re: MinetestServer Web Gui

by SonoMichele » Post

I decided to not work on the commands execution from the webapp since I don't have all this time to work only on getting this feature to work. I'll work on other features for the moment but if someone wants to help feel free to. You can just open an issue or pull request, contact me from my website or you can find me on Telegram @sonomichelequellostrano

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Majestic-12 [Bot] and 7 guests