Jump to content

[Unix] Python web portal for dedicated DST server


Recommended Posts

HI guys,

Just thought id share the web portal I built for installing mods on a dedicated Unix DST server, (as well are restarting the service, seeing who's online and listing the cluster config) 

Could probably build kick and ban users into it as well as other features fairly easily, (feel free to branch) - however i only wanted the basics so mates could restart when it was going a little slow, (but i didn't want to provide any admin privileges or leave it to far open to abuse. )

https://github.com/wisc7/DST-Portal-

Couldn't find any API for DST- so most is done via  console commands.

DSTServerLogin.png

DSTServer.png

DSTServerMods.png

Link to comment
Share on other sites

  • Developer
7 hours ago, Wisc said:

Couldn't find any API for DST- so most is done via  console commands.

Our preferred way to control DST servers is by sending lua to them, either on stdin or via the new bidirectional mechanism released recently.

Link to comment
Share on other sites

31 minutes ago, nome said:

Our preferred way to control DST servers is by sending lua to them, either on stdin or via the new bidirectional mechanism released recently.

Thats all well and good until user's cant code, which most players can't, and i don't want them having that level of access either, or access to the console , the bidirectional mechanism sounds interesting, have you got a link to the documentation handy? might be able to enhance some of the features...

 

that said the portal is done now, and works reasonably well, for what i need it to do.

Link to comment
Share on other sites

  • Developer

Sorry, let me clarify. It's great that you made this! I just meant that when we're making tools like this we communicate between the tool and the DST server using lua as that's the most powerful and simple way for us.

Link to comment
Share on other sites

1 hour ago, nome said:

Our preferred way to control DST servers is by sending lua to them, either on stdin or via the new bidirectional mechanism released recently.

Do we have information about that new bidirectional mechanism? It could help me a lot implementing a tool to help manage multiple dedicated servers I am hosting right now.

Link to comment
Share on other sites

12 hours ago, nome said:

 I just meant that when we're making tools like this we communicate between the tool and the DST server using lua as that's the most powerful and simple way for us.

extremely interested, have you got some docco on this and the bidirectional communications? given most of it is done via functions, will be pretty easy to update the modules to use the API.

might go all in and add user roles if it allows access to additional access to additional features.

Link to comment
Share on other sites

On 6/12/2020 at 7:56 PM, nome said:

Our preferred way to control DST servers is by sending lua to them, either on stdin or via the new bidirectional mechanism released recently.

Care to elaborate a bit on this?

Link to comment
Share on other sites

  • Developer

It's a mechanism we added for the gorge IIRC, we finally made it available to regular players (linux only sadly). You write lua to one FD and get responses on another, with a bit of formatting so you can tell where one ends and the next begins. @Diabu will elaborate a little bit, though we're not ready to write up documentation yet so you'll be on your own from there.

Link to comment
Share on other sites

  • Developer

So as nome explained this a linux-only feature.
On startup, the DST dedicated server process will attempt to open the file descriptors 3, 4 and 5.

- FD 3 is where you should send Lua commands terminated by a newline character.
- FD 4 is where you can read the commands result. Once the command is finished executing, you will read the line "DST_RemoteCommandDone".
- FD 5 is where you can read messages from the dedicated server process. For instance, the server will let you know once it's ready and will send you statistics (number of player connected, etc) every now and then.

To avoid any problem, make sure you wait for the "DST_RemoteCommandDone" signal before attempting to send a new Lua command.

For it to work, you may need to pass the "-cloudserver" flag to your overworld DST process.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
×
  • Create New...