Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mattwelke/minecraft-server-controller
https://github.com/mattwelke/minecraft-server-controller
Last synced: 21 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/mattwelke/minecraft-server-controller
- Owner: mattwelke
- License: apache-2.0
- Created: 2023-08-13T22:00:51.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-13T22:05:29.000Z (over 1 year ago)
- Last Synced: 2024-12-13T02:07:55.369Z (22 days ago)
- Language: Go
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# minecraft-server-controller
A small Go program that acts as a web server used to start and stop two Minecraft servers (one called "minecraft" and the other called "minecraft-private") Minecraft server.
File `main.go` can be modified if you want to use this software for your own purposes (e.g., only working with one server, adding more servers).
## Server setup
1. Ensure the server has a non-root user created to use to run this. The user must have sudo permission.
1. Add lines to the `sudoers` file to allow the user to start and stop the Minecraft server. This allows this server software to run the `systemctl start` and `systemctl stop` commands without having to use a password.
Example:
```
your_user ALL=(ALL) NOPASSWD: /bin/systemctl start minecraft
your_user ALL=(ALL) NOPASSWD: /bin/systemctl stop minecraft
```1. Set up a service to run this server software. This will work similar to how you set up a service to run your Minecraft server software. Ensure your service file starts this server software with the env var `SHUTDOWN_PASSWORD` set to a password the users will specify as they start and stop the server.
## Usage
1. Open `:8080` in the web browser. Follow the on screen instructions.
![image](https://github.com/mattwelke/minecraft-server-controller/assets/7719209/ec1223a1-554d-454b-a3e0-4cdaea70f528)