From 1cb2acd647efa5fb36b84aff246cabc9aaad9140 Mon Sep 17 00:00:00 2001 From: Игорь Толмачёв Date: Mon, 22 Apr 2024 12:21:07 +0000 Subject: Initial commit --- config.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 config.py (limited to 'config.py') diff --git a/config.py b/config.py new file mode 100644 index 0000000..437b9d8 --- /dev/null +++ b/config.py @@ -0,0 +1,31 @@ +from typing import Literal + +# Port of minecraft HTTP whitelist server +http_port = 25564 + +# pipe - https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html#StandardInput= +# rcon - https://minecraft.fandom.com/wiki/Server.properties#enable-rcon +whitelist_access_type: Literal["pipe", "rcon"] = "rcon" +# Path to whitelist.json file +# Usually located in the root of the minecraft server folder +whitelist_file_path = "~/minecraft/whitelist.json" +# Enabled endpoints +# GET - get users in the whitelist +# POST - add user to the whitelist +# DELETE - delete user from the whitelist +enabled_endpoints: set[Literal["GET", "POST", "DELETE"]] = { + "GET", + "POST", + # "DELETE", +} + +if whitelist_access_type == "pipe": + # Path to PIPE file + pipe_path = "~/minecraft/console" +elif whitelist_access_type == "rcon": + # RCON server port - https://minecraft.fandom.com/wiki/Server.properties#rcon.port + rcon_port = 25575 + # RCON server password - https://minecraft.fandom.com/wiki/Server.properties#rcon.password + rcon_password = "password" +else: + raise ValueError("Unsupported access type") -- cgit v1.2.3