Skip to content

fix(cloudnet): bind address from service properties + clean stdin shutdown#141

Merged
theEvilReaper merged 4 commits into
mainfrom
feature/cloudnet-readiness-bind-shutdown
Jul 25, 2026
Merged

fix(cloudnet): bind address from service properties + clean stdin shutdown#141
theEvilReaper merged 4 commits into
mainfrom
feature/cloudnet-readiness-bind-shutdown

Conversation

@TheMeinerLP

@TheMeinerLP TheMeinerLP commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • ServiceBootstrap liest service.bind.host/service.bind.port (Fallback localhost:25565 für Standalone-Runs), statt die Bind-Adresse hart zu kodieren — CloudNet weist diese pro Service dynamisch zu und konnte sie bisher nie erreichen.
  • ServiceBootstrap.installShutdownHandling() startet einen Daemon-Thread, der stdin liest und Zeilen an den CommandManager weiterleitet, plus ein stop-Command das MinecraftServer.stopCleanly() + System.exit(0) auf einem separaten Thread ausführt — CloudNet stoppt Services über stdin, nicht per Signal; ohne diesen Listener killt der Node den Prozess nach Timeout.
  • game (CygnusLoader) und setup (SetupLoader) nutzen beide ServiceBootstrap beim Start.
  • LuckPerms-Integration: Beide Services bootstrappen jetzt LuckPerms via net.luckperms:minestom-loader (JarInJar-Loader, kein Extension-Mechanismus). Der stop-Command ist standardmäßig nur für Nicht-Player-Sender (Konsole/CloudNet) erlaubt, zusätzlich aber auch für Spieler mit der Permission cygnus.command.stop.
    • Guava explizit als implementation ergänzt (wird von LuckPerms unrelocated benötigt, kam bisher nur transitiv über CloudNet, das jetzt compileOnly ist).
    • Adventure aus allen LuckPerms-Dependencies ausgeschlossen (Projekt hat bereits eine eigene Adventure-Version).
    • minestom-loader aus dem Test-Runtime-Classpath ausgeschlossen (bundled, veraltetes Gson bricht sonst Minestoms Registry-Init in Tests).
    • data/ (LuckPerms' Runtime-Verzeichnis: Config, H2-DB, relocated libs) zur .gitignore hinzugefügt.
    • minestom-loader:5.6-SNAPSHOT ist nur über den privaten OneLiteFeather-Proxy verfügbar, nicht über Maven Central/Sonatype — das ist bereits als Repository konfiguriert.

Nicht Teil dieser PR: Umstieg auf ExtensionBootstrap/extension.json (die CloudNet-Bridge wird weiterhin direkt per Aerogel-DI geladen, das funktioniert bereits) — das wäre eine separate Architekturentscheidung.

Test plan

  • ./gradlew :common:compileJava :game:compileJava :setup:compileJava — erfolgreich
  • ./gradlew :common:test :game:test :setup:test — alle Tests grün
  • Manueller Rollout auf einem CloudNet-Test-Node (Bind-Adresse + stop-Signal über den Service-Lifecycle prüfen)
  • Manuell prüfen: Spieler mit cygnus.command.stop kann /stop ausführen, Spieler ohne Permission nicht

🤖 Generated with Claude Code

…clean shutdown

CloudNet assigns the bind host/port per service via system properties and
stops services by writing "stop" to stdin; hardcoded bind addresses and the
lack of a stdin listener meant CloudNet could start but never cleanly manage
the game/setup services.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Test results

120 files  120 suites   48s ⏱️
123 tests 118 ✅  5 💤 0 ❌
372 runs  357 ✅ 15 💤 0 ❌

Results for commit 0c50be4.

♻️ This comment has been updated with latest results.

…yers

Bootstraps LuckPerms via net.luckperms:minestom-loader in both the game and
setup services, so the "stop" command (introduced for CloudNet's stdin-based
shutdown) can also be run by a player holding cygnus.command.stop, instead of
only console/CloudNet.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

@theEvilReaper theEvilReaper left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me, the code looks good. However, I would prefer to add documentation to the methods in ServiceBootstrap and StopCommand. Additionally, the header documentation should include the author, version and since tags. If possible, adding tests would also be great

TheMeinerLP and others added 2 commits July 25, 2026 16:27
Adds @author/@version/@SInCE headers and method-level javadoc matching the
project convention, plus unit tests for bind-address resolution and the
stop command's console/non-player condition.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…emProperty

Skips the default-value assertions instead of failing them if
service.bind.host/service.bind.port happen to already be set externally
(e.g. the JVM actually running under CloudNet), per JUnit5's system-property
conditional execution.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

@theEvilReaper theEvilReaper left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@theEvilReaper
theEvilReaper merged commit 4abda36 into main Jul 25, 2026
7 checks passed
@theEvilReaper
theEvilReaper deleted the feature/cloudnet-readiness-bind-shutdown branch July 25, 2026 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants