604b4d85d55780dddd680aa101d80dbaa46eca67
Two bugs on codebuddy-intl connections: 1. Test Connection always failed with "Provider test not supported": codebuddy-intl was missing from OAUTH_TEST_CONFIG, so testOAuthConnection bailed before probing. Add a real probe against the Keycloak realm's userinfo endpoint (URL derived from the token's iss claim), and wire refreshable so an expired token is rotated via refreshCodebuddyIntlToken. 2. OAuth logins were named "Account N" with no email: mapTokens returned no identity, even though the access token is a Keycloak JWT carrying email/name claims. Extract email + displayName in mapTokens (new shared extractDisplayNameFromAccessToken helper) so fresh logins are named and deduped by identity. Also add a run-once backfill (backfillCodeBuddyIntlIdentity) invoked from GET /api/providers and /api/providers/client to self-heal existing rows (backfill email/displayName, rename the generic "Account N" placeholder). Verified live: the real connection now returns valid:true and the row is renamed to the account email.
9Router MIBP Version
A local AI routing gateway with provider fallback and token-saving features. This is a fork of decolua/9router.
Installation
Option 1: Docker
Pull the image:
docker pull mhiqrambhrng/9router-mibp-version:latest
Run the container:
mkdir -p 9router-data
docker run -d \
--name 9router \
-p 20128:20128 \
-v 9router-data:/app/data \
-e DATA_DIR=/app/data \
-e PORT=20128 \
-e HOSTNAME=0.0.0.0 \
-e NODE_ENV=production \
-e JWT_SECRET=<generate-with-openssl-rand-hex-32> \
-e INITIAL_PASSWORD=<your-dashboard-password> \
-e API_KEY_SECRET=<generate-with-openssl-rand-hex-32> \
-e MACHINE_ID_SALT=<generate-with-openssl-rand-hex-32> \
mhiqrambhrng/9router-mibp-version:latest
Or using Docker Compose (a docker-compose.yml is included in this repo):
cp .env.example .env # fill in JWT_SECRET, INITIAL_PASSWORD, API_KEY_SECRET, MACHINE_ID_SALT
docker compose up -d
Dashboard opens at http://localhost:20128/dashboard.
Option 2: Manual (from source)
Requirements: Node.js 22 or newer.
git clone https://github.com/mhiqrambg/9router-mibp-version.git
cd 9router-mibp-version
cp .env.example .env
# Edit .env: set JWT_SECRET, INITIAL_PASSWORD, API_KEY_SECRET, MACHINE_ID_SALT
npm install
# Development server
npm run dev
# Or production build
npm run build
npm run start
Dashboard opens at http://localhost:20128/dashboard.
More Information
- Upstream project: https://github.com/decolua/9router
- Upstream docs: DOCKER.md • ARCHITECTURE.md
Languages
JavaScript
99.6%
CSS
0.3%