Ancestors

Toot

Written by Dust0741@lemmy.world on 2024-12-16 at 21:17

Desktop as alternative Minecraft server

https://lemmy.world/post/23216599

=> More informations about this toot | More toots from Dust0741@lemmy.world

Descendants

Written by sugar_in_your_tea@sh.itjust.works on 2024-12-16 at 21:26

Yeah, I think Syncthing + maybe a port forward should work. So you’d always access it at serverIP:port, but the traffic could be tunneled to your desktop instead if that’s where it’s running. Basically, the process would be:

Then later, reverse the process.

=> More informations about this toot | More toots from sugar_in_your_tea@sh.itjust.works

Written by Dust0741@lemmy.world on 2024-12-16 at 21:33

I’m using tailscale for remote connection, so no port forwarding.

=> More informations about this toot | More toots from Dust0741@lemmy.world

Written by sugar_in_your_tea@sh.itjust.works on 2024-12-16 at 21:56

Use a reverse proxy, like nginx, HAProxy, etc. It’ll listen on your MC server’s port and forward all data to your desktop. Then run either your MC server or the reverse proxy on your server.

=> More informations about this toot | More toots from sugar_in_your_tea@sh.itjust.works

Written by Dust0741@lemmy.world on 2024-12-16 at 23:21

I have nginx proxy manager already, can I use it for Minecraft? I don’t know which protocol it uses.

=> More informations about this toot | More toots from Dust0741@lemmy.world

Written by sugar_in_your_tea@sh.itjust.works on 2024-12-16 at 23:28

Do both TCP and UDP.

=> More informations about this toot | More toots from sugar_in_your_tea@sh.itjust.works

Written by sun_is_ra@sh.itjust.works on 2024-12-16 at 21:28

yes Syncthing should work just fine just make sure to only sync the save directory to minimize bandwidth.

rsync is another common tool (at least for Linux) that does same job through command line. making it easier to automate the syncing tasks through bash scripts

=> More informations about this toot | More toots from sun_is_ra@sh.itjust.works

Written by LiveLM on 2024-12-16 at 23:59

I’d love to see this seamless switching between hosts work reliably, but it seems a bit hard…

Have you considered pre-generating the world chunks on your beefy desktop with a mod like Chunky then transferring the world over to the server?

I’ve done this before and it works wonders on low-end devices, though it is a trade: you’re exchanging disk space for smoother performance.

Finding the sweet spot can be a bit hard.

=> More informations about this toot | More toots from LiveLM@lemmy.zip

Written by Dust0741@lemmy.world on 2024-12-17 at 14:07

Chunky is amazing. I do have a good bit of free space on my server, so this might just be the best option

=> More informations about this toot | More toots from Dust0741@lemmy.world

Written by cerothem on 2024-12-17 at 01:13

So, one thing that’s not clear here. Is the server and your desktop both at the same location? If they are I see no reason why you couldn’t just leave all the files on the server, have an NFS or Samba share then just stop it on the server and start it (over the network share) on your desktop. It would be functionally seamless, would require no effort to keep the files in sync, and would ensure your running things in the box you want.

=> More informations about this toot | More toots from Cerothen@lemmy.ca

Written by Possibly linux on 2024-12-17 at 01:15

Syncthing is entirely the wrong thing to use.

Anyway what you are describing is possible but it will take some work. I think it is likely not worth the effort. However, I’ll leave that up to you.

To do what you are describing you need to first have a way to send data back and forth between devices and then a way to shutdown and start containers.

To do this I would use Ansible. To start you are going to need to setup an Ansible service user on the server. Makes sure that it is configured so that it can run sudo without a password and is in the docker group. Once you have the service user you need to add it to the hosts file on your desktop.

Next, create two different playbooks. The first playbook will be the one that pulls the container over. First have it connect to the server and stop the container. Then have it run rsync to pull the data down to your local machine. Once the data is pulled have it start the container on your machine.

For the second playbook have it first stop the container on your desktop and then rsync the data over. Once the data is synced have it bring up the container on the server.

For safety you probably should add some check to make sure that you don’t mistakenly run the wrong playbook. You should add a check to make sure that the container is really running where it is expected. It is pretty easy to have Ansible run a check.

You technically could do this will pure scripting but I wouldn’t recommend it.

Ansible plugins:

docs.ansible.com/…/docker_compose_module.html

docs.ansible.com/…/synchronize_module.html

=> More informations about this toot | More toots from possiblylinux127@lemmy.zip

Written by Dust0741@lemmy.world on 2024-12-17 at 14:08

I’ve been wanting to start ansible, maybe this will push me over the edge

=> More informations about this toot | More toots from Dust0741@lemmy.world

Written by johntash@eviltoast.org on 2024-12-27 at 20:57

Syncthing should work, just make sure you don’t run the server on both systems at the same time. Also make sure it finishes syncing.

If your server is always on, you could also expose a network share and mount that on your desktop.

For dns, you could make a simple script that changes what ip mc.domain points to. Just set the ttl to a low value to avoid waiting on dns cache to expire.

=> More informations about this toot | More toots from johntash@eviltoast.org

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113664581474807626
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
310.517596 milliseconds
Gemini-to-HTML Time
4.196278 milliseconds

This content has been proxied by September (3851b).