aboutsummaryrefslogtreecommitdiff
path: root/config.py
diff options
context:
space:
mode:
Diffstat (limited to 'config.py')
-rw-r--r--config.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/config.py b/config.py
new file mode 100644
index 0000000..437b9d8
--- /dev/null
+++ b/config.py
@@ -0,0 +1,31 @@
1from typing import Literal
2
3# Port of minecraft HTTP whitelist server
4http_port = 25564
5
6# pipe - https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html#StandardInput=
7# rcon - https://minecraft.fandom.com/wiki/Server.properties#enable-rcon
8whitelist_access_type: Literal["pipe", "rcon"] = "rcon"
9# Path to whitelist.json file
10# Usually located in the root of the minecraft server folder
11whitelist_file_path = "~/minecraft/whitelist.json"
12# Enabled endpoints
13# GET - get users in the whitelist
14# POST - add user to the whitelist
15# DELETE - delete user from the whitelist
16enabled_endpoints: set[Literal["GET", "POST", "DELETE"]] = {
17 "GET",
18 "POST",
19 # "DELETE",
20}
21
22if whitelist_access_type == "pipe":
23 # Path to PIPE file
24 pipe_path = "~/minecraft/console"
25elif whitelist_access_type == "rcon":
26 # RCON server port - https://minecraft.fandom.com/wiki/Server.properties#rcon.port
27 rcon_port = 25575
28 # RCON server password - https://minecraft.fandom.com/wiki/Server.properties#rcon.password
29 rcon_password = "password"
30else:
31 raise ValueError("Unsupported access type")