Repository navigation
Harden database settings, input parsing and the watch queue - #2
Merged
Merged
Conversation
- Database host, user and password come from configuration: the password from an environment variable or a file, never the command line. There is no default user any more. - The compose example joins a named external network and reaches the database as tidb:4000 instead of using host networking. run.sh passes the password by name. - Raise mem_limit to 3g: the iGPU's buffers are charged to the container's cgroup. - Region files, NBT and jars are treated as outside input: sizes, lengths, nesting and value counts are bounded, block and biome data are validated, block names are limited to safe names and the block palette sent to the GPU covers every index. - A mega tile that cannot be drawn keeps its existing rows. One that keeps taking the process down is retried alone and then dropped. - The live feed accepts wss:// only (ws:// to this machine) and validates player entries. - Add tests that need no GPU and run them with shellcheck and the compose check in CI.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hardening of the database settings, the file parsers and the resident updater.
Changes
db.useris required (no default). The password comes fromDYNMAP_DB_PASSWORD,DYNMAP_DB_PASSWORD_FILEordb.password_file, never from the command line, and apasswordin the JSON is ignored. If a configured password file cannot be read, the store does not connect.DB_NETWORK, defaultminecraft-network), usestidb:4000, and mounts the password as a compose secret.docker/run.shpasses the password by name, so the value stays off thedockercommand line.mem_limit: 3g, with a comment: the iGPU's buffers are charged to the cgroup as shmem.wss://only (ws://to this machine). With another URL it never connects, whichruntreats as busy. Player entries need numeric coordinates.Checks
Local, Godot 4.7.2 on Windows. The new
testworkflow runs the same checks on Linux.tests/run_tests.gd: 134 checks, 0 failedscanoutput, same tile hashes from GPU renders of 64 tiles iniso_SE_30_hiresandiso_S_90_lowres(NVIDIA, Vulkan). NBT parse time unchanged.bash -n,shellcheck -S warning,actionlint: no findingsNot checked here: the container on the iGPU, the password against a real database, and
godot --importon Windows (it hung on this machine, so the checks reused an existing import cache; CI runs the import).When deploying
Update your own copy of the compose file and
maps.json:dbhost and user, the password file, the network,mem_limit.db.usermust be present, andlivemust bewss://.