This commit is contained in:
kento2 2026-08-18 19:19:33 +02:00
parent dede9ce18d
commit 15f60f0465
7 changed files with 111 additions and 270 deletions

View file

@ -1,145 +0,0 @@
# This is the global configuration file for Paper.
# As you can see, there's a lot to configure. Some options may impact gameplay, so use
# with caution, and make sure you know what each option does before configuring.
#
# If you need help with the configuration or have any questions related to Paper,
# join us in our Discord or check the docs page.
#
# The world configuration options have been moved inside
# their respective world folder. The files are named paper-world.yml
#
# File Reference: https://docs.papermc.io/paper/reference/global-configuration/
# Docs: https://docs.papermc.io/
# Discord: https://discord.gg/papermc
# Website: https://papermc.io/
_version: 31
anticheat:
obfuscation:
items:
all-models:
also-obfuscate: []
dont-obfuscate:
- minecraft:lodestone_tracker
sanitize-count: true
enable-item-obfuscation: false
model-overrides:
minecraft:elytra:
also-obfuscate: []
dont-obfuscate:
- minecraft:damage
sanitize-count: true
block-updates:
disable-chorus-plant-updates: false
disable-mushroom-block-updates: false
disable-noteblock-updates: false
disable-tripwire-updates: false
chunk-loading-advanced:
auto-config-send-distance: true
player-max-concurrent-chunk-generates: 0
player-max-concurrent-chunk-loads: 0
chunk-loading-basic:
player-max-chunk-generate-rate: -1.0
player-max-chunk-load-rate: 100.0
player-max-chunk-send-rate: 75.0
chunk-system:
io-threads: -1
worker-threads: -1
collisions:
enable-player-collisions: true
send-full-pos-for-hard-colliding-entities: true
commands:
ride-command-allow-player-as-vehicle: false
suggest-player-names-when-null-tab-completions: true
time-command-affects-all-worlds: false
console:
enable-brigadier-completions: true
enable-brigadier-highlighting: true
has-all-permissions: false
item-validation:
book:
author: 8192
page: 16384
title: 8192
book-size:
page-max: 2560
total-multiplier: 0.98
display-name: 8192
lore-line: 8192
resolve-selectors-in-books: false
logging:
deobfuscate-stacktraces: true
messages:
kick:
authentication-servers-down: <lang:multiplayer.disconnect.authservers_down>
connection-throttle: Connection throttled! Please wait before reconnecting.
flying-player: <lang:multiplayer.disconnect.flying>
flying-vehicle: <lang:multiplayer.disconnect.flying>
no-permission: <red>I'm sorry, but you do not have permission to perform this command.
Please contact the server administrators if you believe that this is in error.
use-display-name-in-quit-message: false
misc:
chat-threads:
chat-executor-core-size: -1
chat-executor-max-size: -1
client-interaction-leniency-distance: default
compression-level: default
enable-nether: true
fix-far-end-terrain-generation: true
load-permissions-yml-before-plugins: true
max-joins-per-tick: 5
prevent-negative-villager-demand: false
region-file-cache-size: 256
send-full-pos-for-item-entities: false
strict-advancement-dimension-check: false
use-alternative-luck-formula: false
use-dimension-type-for-custom-spawners: false
xp-orb-groups-per-area: default
packet-limiter:
all-packets:
action: KICK
interval: 7.0
max-packet-rate: 500.0
kick-message: <red><lang:disconnect.exceeded_packet_rate>
overrides:
minecraft:place_recipe:
action: DROP
interval: 4.0
max-packet-rate: 5.0
player-auto-save:
max-per-tick: -1
rate: -1
proxies:
velocity:
enabled: true
online-mode: true
secret: '1234'
scoreboards:
save-empty-scoreboard-teams: true
track-plugin-scoreboards: false
spam-limiter:
incoming-packet-threshold: 300
recipe-spam-increment: 1
recipe-spam-limit: 20
tab-spam-increment: 1
tab-spam-limit: 500
spark:
enable-immediately: false
enabled: true
unsupported-settings:
allow-headless-pistons: false
allow-permanent-block-break-exploits: false
allow-piston-duplication: false
allow-unsafe-end-portal-teleportation: false
compression-format: ZLIB
oversized-item-component-sanitizer:
dont-sanitize: []
perform-username-validation: true
skip-tripwire-hook-placement-validation: false
skip-vanilla-damage-tick-when-shield-blocked: false
update-equipment-on-player-actions: true
update-checker:
enabled: true
watchdog:
early-warning-delay: 10000
early-warning-every: 5000

View file

@ -1,70 +0,0 @@
#Minecraft server properties
#Thu Jul 09 11:56:34 GMT 2026
accepts-transfers=false
allow-flight=false
broadcast-console-to-ops=true
broadcast-rcon-to-ops=true
bug-report-link=
debug=false
difficulty=easy
enable-code-of-conduct=false
enable-jmx-monitoring=false
enable-query=false
enable-rcon=false
enable-status=true
enforce-secure-profile=false
enforce-whitelist=false
entity-broadcast-range-percentage=100
force-gamemode=false
function-permission-level=2
gamemode=survival
generate-structures=true
generator-settings={}
hardcore=false
hide-online-players=false
initial-disabled-packs=
initial-enabled-packs=vanilla
level-name=world
level-seed=
level-type=minecraft\:normal
log-ips=true
management-server-allowed-origins=
management-server-enabled=false
management-server-host=localhost
management-server-port=0
management-server-secret=PzbLDwG7Wr9xGAgxHiVHLLqy6SG7bxY1niCc8vmR
management-server-tls-enabled=true
management-server-tls-keystore=
management-server-tls-keystore-password=
max-chained-neighbor-updates=1000000
max-players=20
max-tick-time=60000
max-world-size=29999984
motd=A Minecraft Server
network-compression-threshold=256
online-mode=false
op-permission-level=4
pause-when-empty-seconds=60
player-idle-timeout=0
prevent-proxy-connections=false
query.port=25565
rate-limit=0
rcon.password=
rcon.port=25575
region-file-compression=deflate
require-resource-pack=false
resource-pack=
resource-pack-id=
resource-pack-prompt=
resource-pack-sha1=
server-ip=
server-port=25565
simulation-distance=10
spawn-protection=16
status-heartbeat-interval=0
sync-chunk-writes=true
text-filtering-config=
text-filtering-version=0
use-native-transport=true
view-distance=10
white-list=false

View file

@ -22,20 +22,40 @@ us connect to the resolved IPs. With a single node, that's fine but if we want t
access a service on another node, we need wireguard(or something similar).
Actually if we run all nodes in the same network and it'd be fine without.
## Most Basic Implementation
- single node
- runs `nomad agent -dev` and `consul agent -dev`
- runs `dnsmasq -d`, `nomad agent -dev`, and `consul agent -dev` as root
- /etc/nomad.d/consul.hcl:
consul {
address = "127.0.0.1:8500"
}
- /etc/dnsmasq.conf:
server=/consul/127.0.0.1#8600
- all jobs define a consul service
- TODO: make dns/connect work
## useful commands
## useful stuff
- `nomad job run <job>.hcl`
- `consul catalog services` <- list registered services
- http://localhost:4646/ui/jobs <- web UI accessible after `nomad agent -dev`
- https://developer.hashicorp.com/nomad/docs/configuration
- https://developer.hashicorp.com/nomad/docs/job-declare/service-discovery
## Storage/SPOT
the papermc container already copies all files in /mnt/*
to /data, so it's easy to add overwrites.
in ./lobby.nomad.hcl I just use a prestart container that downloads the plugin
to a temporary volume that is then used as /mnt.
A lot of boilerplate and it's also not easy to add other files.
Ideally, we'd just copy a whole directory over sftp. it would look
like this:
/.gitignore <- data
/Makefile <- downloads plugins specified to /data/plugins
/static <- static files that are copied by make to /data
But ig that wouldn't play nice with CI/CD...
Also currently we need to duplicate a lot of this boilerplate btw.

View file

@ -5,10 +5,56 @@ job "lobby" {
count = 1
network {
mode = "host"
mode = "bridge"
port "minecraft" {
to = 25565
}
dns {
servers = ["172.17.0.1"]
}
}
service {
name = "lobby"
port = "minecraft"
address_mode = "alloc"
check {
type = "tcp"
interval = "5s"
timeout = "1s"
}
}
ephemeral_disk {
size = 5000 # 5 gb
}
task "download-plugins" {
driver = "docker"
lifecycle {
hook = "prestart"
sidecar = false
}
config {
image = "busybox"
command = "sh"
volumes = ["../alloc/data:/mnt"]
args = [
"-xec",
<<-EOF
mkdir -p /mnt/plugins
cd /mnt/plugins
wget \
https://git.lab0x13.site/api/packages/scrow/generic/core-bukkit/UNVERSIONED/CoreBukkit.jar \
https://download.luckperms.net/1652/bukkit/loader/LuckPerms-Bukkit-5.5.65.jar \
https://hangarcdn.papermc.io/plugins/ViaVersion/ViaVersion/versions/5.11.0/PAPER/ViaVersion-5.11.0.jar \
https://hangarcdn.papermc.io/plugins/ViaVersion/ViaBackwards/versions/5.11.0/PAPER/ViaBackwards-5.11.0.jar
ls -l
EOF
]
}
}
task "run" {
@ -18,9 +64,9 @@ job "lobby" {
image = "git.lab0x13.site/scrow/papermc:0.1"
force_pull = false
ports = ["minecraft"]
#args = ["java", "-jar", "server.jar", "--port=${NOMAD_PORT_minecraft}"]
volumes = ["../alloc/data:/mnt"]
}
env {
HOST_POSTGRES = "jdbc:postgresql://postgres.service.consul/scrow"
HOST_NATS = "nats://nats.service.consul"
@ -30,18 +76,6 @@ job "lobby" {
cpu = 1000
memory = 2048
}
service {
name = "lobby"
port = "minecraft"
provider = "consul"
check {
type = "tcp"
interval = "5s"
timeout = "1s"
}
}
}
}
}

View file

@ -2,14 +2,24 @@ job "nats" {
type = "service"
group "nats" {
network {
mode = "host"
mode = "bridge"
port "nats" {
to = 4222
}
}
service {
name = "nats"
port = "nats"
address_mode = "alloc"
check {
type = "tcp"
interval = "1s"
timeout = "1s"
}
}
task "nats" {
driver = "docker"
@ -22,18 +32,6 @@ job "nats" {
cpu = 500
memory = 1000
}
service {
name = "nats"
port = "nats"
provider = "consul"
check {
type = "tcp"
interval = "5s"
timeout = "1s"
}
}
}
}
}

View file

@ -1,15 +1,27 @@
# TODO add host volume
job "postgres" {
datacenters = ["dc1"]
type = "service"
group "db" {
network {
mode = "host"
mode = "bridge"
port "postgres" {
to = 5432
}
}
service {
name = "postgres"
port = "postgres"
address_mode = "alloc"
check {
type = "tcp"
interval = "5s"
timeout = "1s"
}
}
task "postgres" {
driver = "docker"
@ -28,18 +40,6 @@ job "postgres" {
cpu = 500
memory = 512
}
service {
name = "postgres"
port = "postgres"
provider = "consul"
check {
type = "tcp"
interval = "10s"
timeout = "1s"
}
}
}
}
}

View file

@ -1,21 +1,25 @@
job "velocity" {
type = "service"
group "proxy" {
group "velocity" {
network {
port "minecraft" {
mode = "bridge"
port "ingress" {
static = 25565
}
dns {
server = ["127.0.0.1"]
}
}
task "velocity" {
driver = "docker"
config {
image = "scrow/velocity:local"
}
resources {
cpu = 2000
memory = 1000
driver = "docker"
config {
image = "scrow/velocity:local"
}
resources {
cpu = 1000
memory = 500
}
}
}