aboutsummaryrefslogtreecommitdiff
path: root/config.py
blob: 437b9d853a76c7569942382bcc4e9f377cf97148 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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")