Feat 3139 self hosted multi regions support - #3150
Open
ibaraki-douji wants to merge 5 commits into
Open
Conversation
ibaraki-douji
marked this pull request as ready for review
August 6, 2026 21:06
Contributor
Greptile SummaryThe PR adds runtime-configurable multi-region support for self-hosted consoles while preserving Cloud routing.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Reviews (5): Last reviewed commit: "chore(env): Revert PUBLIC_APPWRITE_ENDPO..." | Re-trigger Greptile |
…fy API endpoint usage
…loading in self-hosted environments
…n and ensure proper region loading
ibaraki-douji
force-pushed
the
feat-3139-self-hosted-multi-regions-support
branch
from
August 7, 2026 09:30
6f53438 to
2447975
Compare
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.
What does this PR do?
Adds self-hosted multi-region console support so operators can run one apex console against a meta API plus regional APIs, without Cloud-only gates or rebuilding the image when regions change.
isMultiRegionfromPUBLIC_APPWRITE_MULTI_REGION=true(alongside existingisMultiRegionSupportedfor Cloud).GET /console/regions(nginx exact location + optional ConfigMap/volume mount). Accepts a JSON array or{ "regions": [...] }with$id,name,disabled,available, optionalflag, and optional routing fields:hostname→{page-protocol}//{hostname}/v1endpoint→ full API base (with or without/v1)/v1(leavePUBLIC_APPWRITE_ENDPOINTempty)hostname/endpoint{region}.subdomain behaviorregionwhen multi-region is on (self-hosted modal, not Cloud wizard).getProjectEndpoint: usesgetApiEndpoint(region)so copy/display URLs match SDK routing.src/lib/helpers/regionHosts.test.tsfor endpoint vs hostname vs null fallback..env.example: documents emptyPUBLIC_APPWRITE_ENDPOINTfor self-hosted (no hostname baked into the image).Self-hosted operators configure hosts at deploy time via
/console/regions; they do not need to rebuild the console image per environment.Test Plan
bun format/bun run check/bun run lint/bun run test:unit -- src/lib/helpers/regionHosts.test.tsappwrite.localhost/fra.localhost/nyc.localhost/ absolutehttp://…localhost/v1(emptyPUBLIC_APPWRITE_ENDPOINT)PUBLIC_APPWRITE_MULTI_REGION=false, console onlocalhost→ API calls go tohttp://localhost/v1; register/login worksPUBLIC_APPWRITE_MULTI_REGION=true+ ConfigMap at/console/regionswithhostname→ region picker, create project infra/nyc, SDK hits regional hosts; meta stays on page hostnamePUBLIC_CONSOLE_MODE=cloud(subdomain rewrite still applies)Related PRs and Issues
Checklist
TYPE-ISSUE_ID-DESCRIPTION(feat-3139-self-hosted-multi-regions-support)