minecraft-server-invites/README.md

61 lines
2.5 KiB
Markdown
Raw Normal View History

2022-07-15 17:20:21 +01:00
Minecraft Server Invites [mc.gmem.ca](https://mc.gmem.ca)
===
**Generate Discord-like invites for your Minecraft server**
![Homepage screenshot](homepage.png)
2022-07-16 12:41:29 +01:00
_Looking for the frontend? See here: [~gmem/minecraft-server-invites-frontend](https://git.sr.ht/~gmem/minecraft-server-invites-frontend)_
2022-07-15 17:20:21 +01:00
2022-07-15 17:34:19 +01:00
## About
Sometimes you want to allow people to play on your Minecraft server, but you don't necessarily want to
go through the whole process of asking for their username, then manually sending the command to add them
to the whitelist*. Instead, this application offers the ability to generate a short link that directs
a user through an OAuth flow to automatically fetch their Minecraft account (assuming the account has been
migrated - I have no plans at this time to support non-migrated accounts, despite how I may personally feel
about them) and send a command over RCON to your server to add them to the whitelist. It will then give them
the address to connect to the server.
2022-07-16 12:41:29 +01:00
This is currently hosted at [mc.gmem.ca](https://mc.gmem.ca) while being developed. It's free for the time being,
and while I do want to eventually monetize this hosted version, you are more than welcome to either use the hosted
version or host your own instance (this is actually recommended if you have the ability, since it allows you to
keep RCON private). I do happily [accept donations](https://www.buymeacoffee.com/gmem) to keep running the public
hosted version!
2022-07-15 17:34:19 +01:00
*while the term "whitelist" is by and large being replaced in places, this is still the term Minecraft servers
utilise, and is therefore the term used in this application. Should it be changed, use of the term here will
also be changed.
2022-07-15 17:20:21 +01:00
## Building
```shell
# Docker
docker build . -t whitelistmanager
# Non-docker
go build -o wlm -ldflags "-s -w"
```
## Running
This project aims to be as dependency free as possible. The SQLite database will be automatically
created on first run.
[You will need to generate the keys for the Microsoft OAuth flow by following this guide](https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app).
The keys can then be saved to environment variables as follows:
```shell
AZURE_OAUTH_CLIENT_ID=<client id>
AZURE_OAUTH_CLIENT_SECRET=<client secret>
AZURE_OAUTH_CLIENT_SECRET_ID=<client secret id> # technically unused at the moment
```
```shell
# Docker
docker run whitelistmanager
2022-07-16 12:41:29 +01:00
# Non-docker, built binary
./wlm
# Non-docker, non-built
2022-07-15 17:20:21 +01:00
go run ./...
```