生成位于 build/libs/DockBridge-<version>.jar 的阴影 jar 包。
贡献
欢迎 Fork 和提交 PR。保持代码注释简洁但富有目的性。
默认使用 Java 21、Gradle Kotlin DSL、Velocity API 3.4.0-SNAPSHOT 用于运行任务;3.1.1 用于 compileOnly/annotationProcessor。
提交前请运行 ./gradlew build;基于 Docker 的测试是可选的。
DockBridge
Velocity plugin to auto-register Docker-backed servers (e.g., Limbo) and check for updates on Modrinth.
Features
Auto-discovery: Containers with label net.uebliche.dockbridge.autoregister=true are registered as Velocity servers. Host from container name, port from label net.uebliche.dockbridge.server_port (fallback: first exposed port, else 25565).
Name collisions: Default suffix → append short container id (basename-abcdef). Alternative overwrite → keep basename, last writer wins.
/dockbridge command (permission dockbridge.command): Shows label filter, duplicate strategy, last scan stats, and registered servers (no sensitive data).
Modrinth update check on proxy start; login hint for players with permission dockbridge.update.notify.
Installation
Download the latest DockBridge release from Modrinth (jar file).
Place the jar into your Velocity plugins/ folder.
(Optional) If Velocity runs in Docker, mount /var/run/docker.sock into the Velocity container so DockBridge can discover containers.
Start Velocity. On first start, the config file dockbridge.conf is created in the Velocity data folder; adjust settings and restart.
Permissions:
dockbridge.command for /dockbridge
dockbridge.update.notify for update hints on login
Configuration
dockbridge.conf (created in the Velocity data folder on first start):
Downloads Velocity, builds the plugin (shadowJar), and starts the proxy with the plugin loaded.
Docker Compose (Limbo set)
docker compose up --build # or: docker compose -f docker-compose.limbo.yml up --build
Includes three Limbo backends (ports 30000/30001/30002) and Velocity on host port 26678. Velocity runs via runVelocity inside the container and mounts your sources/config.
Commands & permissions
/dockbridge (permission dockbridge.command): Status and registered servers.
Update hint on login: permission dockbridge.update.notify.
Troubleshooting
No servers registered?
Ensure your containers have the label net.uebliche.dockbridge.autoregister=true and a valid net.uebliche.dockbridge.server_port.
Make sure Velocity can reach Docker: mount /var/run/docker.sock (or set docker.endpoint to a reachable TCP endpoint).
Check /dockbridge output for last scan count and registered servers.
Port mismatch or forwarding errors?
Verify the Limbo (or other backend) port matches the label and the server properties.
For Velocity forwarding, ensure forwarding secret/mode match on both ends.
Duplicate names?
Default strategy is suffix. Switch to overwrite via docker.autoregister.duplicate_strategy if you want last-writer-wins.
Build
./gradlew build
Produces the shaded jar at build/libs/DockBridge-<version>.jar.
Contributing
Fork & PRs welcome. Keep code comments minimal but purposeful.
Default Java 21, Gradle Kotlin DSL, Velocity API 3.4.0-SNAPSHOT for run task; 3.1.1 for compileOnly/annotationProcessor.
Run ./gradlew build before submitting; Docker-based tests are optional.
评论 0
登录后参与评分
还没有评论,来抢沙发吧