mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 02:48:13 -05:00
[PR #23010] [CLOSED] feat: enable Terminals K8s Orchestrator policy management in Open WebUI #26972
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/23010
Author: @westbrook-ai
Created: 3/25/2026
Status: ❌ Closed
Base:
main← Head:feat-terminals-operator-ui-integration📝 Commits (10+)
83fad5erefac8970923refac86cce2cUpdate fi-FI translation.json (#22542)418bd05refac: refined shimmer effect (#22516)a407a7fUpdated pt-PT Translation (#22587)06657b8fix: handle non-dict history/messages in chat_message migration (#22588)f1c1004fix: ddgsa87f015i18n: Update Catalan translation.json (#22570)0a87c1erefacb312318refac: rm mariadb dep📊 Changes
362 files changed (+33568 additions, -31649 deletions)
View changed files
➕
.github/workflows/ruff.yml(+49 -0)➕
.pre-commit-config.yaml(+8 -0)📝
Dockerfile(+11 -10)📝
backend/open_webui/__init__.py(+29 -35)📝
backend/open_webui/config.py(+1483 -1793)📝
backend/open_webui/constants.py(+60 -78)📝
backend/open_webui/env.py(+292 -424)📝
backend/open_webui/functions.py(+85 -95)📝
backend/open_webui/internal/db.py(+20 -30)📝
backend/open_webui/internal/migrations/001_initial_schema.py(+24 -24)📝
backend/open_webui/internal/migrations/002_add_local_sharing.py(+2 -4)📝
backend/open_webui/internal/migrations/003_add_auth_api_key.py(+2 -4)📝
backend/open_webui/internal/migrations/004_add_archived.py(+2 -2)📝
backend/open_webui/internal/migrations/005_add_updated_at.py(+16 -20)📝
backend/open_webui/internal/migrations/006_migrate_timestamps_and_charfields.py(+20 -20)📝
backend/open_webui/internal/migrations/007_add_user_last_active_at.py(+6 -6)📝
backend/open_webui/internal/migrations/008_add_memory.py(+2 -2)📝
backend/open_webui/internal/migrations/009_add_models.py(+2 -2)📝
backend/open_webui/internal/migrations/010_migrate_modelfiles_to_models.py(+24 -24)📝
backend/open_webui/internal/migrations/011_add_user_settings.py(+2 -2)...and 80 more files
📄 Description
Pull Request Checklist
Before submitting, make sure you've checked the following:
devbranch. PRs targetingmainwill be immediately closed.devto ensure no unrelated commits (e.g. frommain) are included. Push updates to the existing PR branch instead of closing and reopening.Changelog Entry
Description
Adds admin-facing UI and backend proxy routes for managing Terminals Kubernetes Operator policies, monitoring active terminal instances, and inspecting server configuration, all from within Admin Settings → Integrations → Open Terminal.
When a terminal server connection is detected as an orchestrator type, the Open Terminal section gains three tabs: Connections (existing), Policies (new), and Active Terminals (new). Plain terminal server setups are unaffected — the tabs only appear when an orchestrator connection is present.
This is the Open WebUI-side companion to a Terminals repo PR that adds the instance listing and server info API endpoints consumed here. That PR is found here: https://github.com/open-webui/terminals/pull/6
Why this matters: The Terminals orchestrator provisions isolated terminal instances per user based on policies (named resource templates). Until now, policies could only be managed via direct API calls, admins had no visibility into running instances, and the connection modal had no way to select from existing policies. This PR solves all three.
Added
terminals.pyfor policy CRUD, instance listing/teardown, and server info, forwarding requests to the in-cluster orchestrator so its API key never reaches the browserPOST /terminal_servers/verify) that probes a terminal server and identifies it asorchestratororterminalPOST /terminal_servers/policy) for use during initial connection setup before a server ID existsPolicyData,PolicyResponse,TerminalInstance,TerminalServerInfo) with corresponding fetch helpersPolicyEditor.svelte— modal for creating/editing policies (image, CPU, memory, storage, storage mode, idle timeout, environment variables)Policies.svelte— policy list with server selector, search, create/edit/clone/delete actionsInstances.svelte— active terminal instance table with status badges, auto-refresh, relative timestamps, and delete action with confirmationTerminals.svelte(Connections / Policies / Active Terminals) that appears when an orchestrator connection is detectedserver_typedetection on mount — connections without a stored type are probed and the result is persistedChanged
AddTerminalServerModal.svelte— replaced inline policy fields with a policy selector dropdown; adds New/Edit buttons to manage policies in-place; storespolicy_idon the connection instead ofpolicy_dataTerminals.svelte— accepts anadminprop so it can be embedded in both admin and user settings pagesConnection.svelte— passesadminprop through toAddTerminalServerModalIntegrations.svelte— replaced inline terminal HTML with the shared<Terminals admin>component so admin and user settings use the same tabbed UIDeprecated
Removed
AddTerminalServerModal(replaced by policy selector + PolicyEditor)Fixed
Security
get_admin_user— regular users cannot access policy or instance managementBreaking Changes
Additional Information
/api/v1/instances,/api/v1/instances/{id}, and/api/v1/infoendpoints that this PR's proxy routes and frontend consume. The policy CRUD endpoints (/api/v1/policies/*) already exist in the Terminals main branch.policy_idvalues, each granted to a different user group via Open WebUI's existing group-based access control. This enables per-group terminal configurations (e.g., Developers → lightweight Python image, Data Scientists → GPU-capable image with 16 GB RAM).Testing
Tested end-to-end on a local
kindcluster with the Terminals orchestrator, Kopf operator, and Open WebUI.Automated E2E tests:
Manual multi-user testing:
test-pythonpolicydata-science-v2policyScreenshots or Videos
New tabs for Open Terminal when Orchestrator is detected:

Policies tab with hover actions shown on top policy:

Active Terminals tab:

Delete Terminal confirmation window:

Contributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.