fix: auto-derive unique slug from identity when WORLD_ID is not set#14
Merged
Conversation
When no WORLD_ID env var is provided, the slug was always 'star-office', causing all deployed instances to appear identical on the gateway. Now derives a unique slug from the world-identity.json keypair (format: 'star-office-<6char-hash>'), ensuring each instance has a distinct URL suffix. Explicit WORLD_ID still takes priority when set. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
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.
Problem
All deployed instances without explicit
WORLD_IDenv var get the same slugstar-office, causing 6 identical entries on the gateway and indistinguishable URLs.Solution
When
WORLD_IDis not set, derive a unique slug from the world's identity keypair:star-office-<6char-hash>(e.g.star-office-chs9cn)world-identity.jsonpublicKey hash, falls back to random suffix if identity not yet createdWORLD_IDstill takes full priority when providedFiles Changed
src/config.ts:deriveSlug()function, integrated intoresolveConfig()test/integration.test.mjs: Updated slug assertions to usestartsWithcheckAll 35 tests pass.