mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-21 17:13:00 -05:00
[PR #17436] [CLOSED] refactor: implement state.config bootstrap (4/4) #47479
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/17436
Author: @luxass
Created: 9/14/2025
Status: ❌ Closed
Base:
dev← Head:refactor/add-state-config-bootstrap📝 Commits (10+)
5ee3521refactor: move config.py into config/ package structure61ce6c4refactor(logging): move logging setup to a dedicated modulec9639ddrefactor(config): reorganize configuration modules and enhance structured300bdfchore: format5efefcbMerge branch 'dev' into refactor/move-to-config-module8b67a4aMerge branch 'dev' into refactor/move-to-config-module5d1ae32chore: format56bfb79Merge branch 'refactor/move-to-config-module' into refactor/extract-core-config3b71b86refactor(config): reorganize imports and create llm modulee0a2faafeat(config): add authentication configuration module📊 Changes
37 files changed (+3976 additions, -4257 deletions)
View changed files
➖
backend/open_webui/config.py(+0 -3483)➕
backend/open_webui/config/__init__.py(+8 -0)➕
backend/open_webui/config/core/__init__.py(+9 -0)➕
backend/open_webui/config/core/auth.py(+626 -0)➕
backend/open_webui/config/core/base.py(+172 -0)➕
backend/open_webui/config/core/bootstrap.py(+167 -0)➕
backend/open_webui/config/core/database.py(+79 -0)➕
backend/open_webui/config/core/logging.py(+15 -0)➕
backend/open_webui/config/features/__init__.py(+11 -0)➕
backend/open_webui/config/features/admin.py(+36 -0)➕
backend/open_webui/config/features/features.py(+72 -0)➕
backend/open_webui/config/features/misc.py(+98 -0)➕
backend/open_webui/config/features/permissions.py(+211 -0)➕
backend/open_webui/config/features/static.py(+113 -0)➕
backend/open_webui/config/features/tasks.py(+311 -0)➕
backend/open_webui/config/features/ui.py(+134 -0)➕
backend/open_webui/config/integrations/__init__.py(+10 -0)➕
backend/open_webui/config/integrations/code_interpreter.py(+133 -0)➕
backend/open_webui/config/integrations/llm.py(+127 -0)➕
backend/open_webui/config/integrations/media.py(+455 -0)...and 17 more files
📄 Description
⚠️ DEPENDS ON PR #17433
This PR builds on the changes from PR #17433. The diff currently shows cumulative changes from both PRs. Once PR #17433 is merged, I will rebase this branch and the diff will show only the changes specific to this PR.
Part 4/4 of the config refactoring series.
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Before submitting, make sure you've checked the following:
devbranch.Changelog Entry
Description
Implement centralized bootstrap initialization that replaces scattered
app.state.config.Xassignments throughoutmain.pywith a singleConfigStateBoostrap(app).bootstrap_config_state()call. This completes the config.py refactoring series by providing a clean, maintainable initialization pattern that automatically discovers and sets all configuration values. This is the final part (4/4) of the config.py refactoring series.Added
ConfigStateBoostrap(app)class: Centralized configuration initialization systembootstrap_config_state()class method that systematically sets allapp.state.config.XfieldsConfiguration registry system: Automatic discovery of all
PersistentConfiginstancesapp.state.config.{config_name} = config_instanceCentralized initialization logic: Single point of truth for app state configuration
Changed
main.py: Replaced ~50+ scatteredapp.state.config.X = Yassignments with single bootstrap callBefore/After: main.py Transformation
Before (scattered assignments):
After (single bootstrap call):
Deprecated
Removed
app.state.config.Xassignments frommain.py(replaced by bootstrap)Fixed
Security
Breaking Changes
app.state.config.Xaccess patterns throughout the codebase continue to work unchangedAdditional Information
Screenshots or Videos
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.