Model capability guard, shared catalogs and trusted management origins
Changes
- Publish safe upstream catalog metadata on
/v1/modelsand/admin/models: capability states, token limits and per-profile declarations withcatalog_sourceprovenance; account identities, credentials and internal configuration are never exposed. The WebUI model page shows full details and shared-catalog sources (#32). - Add
model_capability_guard, default on and configurable via CLI,CODEBUDDY2API_MODEL_CAPABILITY_GUARDand a WebUI hot switch. Declared-unsupported images, tools or reasoning, out-of-range effort and over-cap output return 400 without an upstream call (#32). - Deduplicate international CLI/WorkBuddy catalogs into a shared view with source tracking, and merge lossless consecutive image-bearing user messages for international profiles only; domestic backends keep native behavior (#25, #32).
- Fix management login behind HTTPS reverse proxies (#31, #33): trust exact browser origins via
admin_allowed_origins(WebUI system settings, hot),CODEBUDDY2API_ADMIN_ORIGINSor--admin-allowed-origins. Bare domains mean HTTPS; strict same-origin matching, the Referer fallback and CSRF token requirements are unchanged.
Upgrade
- Back up and preserve your existing
.envand entire writable data directory, includingcontrol.sqlite3,logs.sqlite3, credentials and reward ledgers. - Native precedence is CLI > environment > saved WebUI settings > defaults.
model_capability_guardandadmin_allowed_originsare hot WebUI settings unless locked by an explicit CLI or environment value. - Compose keeps container binding at
0.0.0.0:8787; update the image in your existing.envtoghcr.io/maiphucgiang/codebuddy2api:1.2.7, then rundocker compose pull && docker compose up -d --no-build. - If HTTPS domain login through a reverse proxy fails Origin checks, add the public address to
admin_allowed_originsinstead of disabling CSRF protection. - Existing
/v1/*and/admin/*addresses remain unchanged.
Distribution and validation
codebuddy2api-1.2.7.tar.gz includes source and prebuilt WebUI assets; SHA256SUMS verifies the download. It excludes credentials, databases, .env and dependency directories. Native use requires Python 3.12+ and the locked Python dependencies, but no frontend build.
All 55 backend test scripts pass, including new international-catalog, capability, message-normalization and origin-allowlist suites. The extracted distribution passed isolated startup, version, health, asset, environment and authentication checks. Reviewed changes: #32, #33.
Tag CI passed and published linux/amd64 and linux/arm64 images. Both report version 1.2.7 and revision 5d86db585190a8c1676c9fdb8759e5127befb7bf; latest matches the versioned manifest.
Full changelog: v1.2.6...v1.2.7