Replace the combined node-info protocol with independent profile, external-endpoint, and extra-route requests. Aggregate consumers use NodeInfoQueryCoordinator and validate response source addresses. BREAKING CHANGE: nodeinfotinyreq/resp and nodeinfofullreq/resp are removed. Peers must use the profile, external-endpoint, and extra-route request pairs.
3.0 KiB
3.0 KiB
KLALB Repository Guide
KLALB is a Java SRv6/load-balancing system. Start at org.kne.cloud.network.klalb.KLALBMain; runtime configuration is root-relative klalb-config.json.
Build And Run
- This is an Eclipse Java project, not Maven or Gradle:
src/contains sources,lib/vendored dependencies, andbin/compiled output..classpathtargets Java 25. - Source files contain Chinese text, so compile with UTF-8 from the repository root:
& "C:\Program Files\Zulu\zulu-25\bin\javac.exe" -encoding UTF-8 -cp "lib/*" -d bin (Get-ChildItem -Recurse src -Filter *.java | ForEach-Object FullName)
- Run from the repository root.
srcmust stay on the classpath because manual compilation does not copy resource bundles:
& "C:\Program Files\Zulu\zulu-25\bin\java.exe" --enable-native-access=ALL-UNNAMED "--add-opens=java.base/jdk.internal.misc=ALL-UNNAMED" -cp "bin;src;lib/*" org.kne.cloud.network.klalb.KLALBMain
- Native libraries and
klalb-config.jsonare resolved from the current directory; restart the JVM after recompiling. TUN creation requires elevation, so use"enableTUN": falsefor non-admin checks.
Dashboard
dashboard/is a Git submodule. Commit dashboard changes in that repository, then update the parent submodule pointer.- Run frontend commands from
dashboard/:pnpm install --frozen-lockfile,pnpm lint,pnpm typecheck, andpnpm build. The build istsc -b && vite buildand producesdashboard/dist, which the Java server hosts. - Vite proxies
/apitohttp://127.0.0.1:4665; usepnpm devonly with the Java API running there.
Verification
- No repository test runner or CI workflow is configured. For Java changes, compile and launch the app; for dashboard changes, run
pnpm typecheckandpnpm build.
Important Boundaries
KLALBConfigItemis a polymorphic JSON array keyed by case-sensitiveType. New types need serializer and deserializer support; preserve unknown items' raw JSON./api/configparses fields and legacy aliases explicitly. Web and Swing writes must useKLALBProxySystem's revision-checked detached-candidate commit path, never mutate the canonical config directly.- Vendored Gson is 2.1: serialize HTTP
JsonElementvalues withtoString(); serialize configuration through the configured pretty-print Gson path. - UI strings use
UIEnv.getRsb(); add keys to bothsrc/klalb_zh_CN.propertiesandsrc/klalb_en_US.properties. KLALBController.PublishedNodeInfois the thread-safe node-info source. Publish profile, effective external endpoints, and extra routes through the controller so snapshots and update flags remain coherent. Peer queries are separate profile, endpoint, and extra-route requests; useNodeInfoQueryCoordinatorwhen a consumer needs an aggregate detail result.RouterInforetains an empty legacy UTF slot.RouterInfoPacketappends optional update flags behind a marker; treat binary codec changes as mesh-compatibility work and preserve old-reader behavior.