-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic Index Settings (Cameron's Proposal) #778
Comments
Migration PlanTo ensure a smooth transition to the new configuration system without introducing breaking changes, the following migration plan is proposed: Phase 1: Introduction of New Configuration Structure
Phase 2: Gradual Migration of Settings
Phase 3: Enable Dynamic Configuration Through Database
Phase 4: Deprecation and Removal of
|
Related to torrust/torrust-index-gui#664
Current Situation
Torrust Index loads a read-only configuration upon startup; this configuration is static over the lifetime of the program.
Details
The Torrust Index reads its settings in TOML format from two places:
/etc/torrust/index/index.toml
, or a path overridden by theTORRUST_INDEX_CONFIG_TOML_PATH
environment variable.TORRUST_INDEX_CONFIG_TOML
.If both configurations are present, the configuration supplied by the environment variable takes precedence.
The TOML format is overridden by configuration options supplied by the
TORRUST_INDEX_CONFIG_OVERRIDE_
environment variable prefix.This merged configuration is read-only for the lifetime of a
torrust-index
instance.Configuration Types
There is a matrix of different types of configuration that the Torrust Index uses, for example:
The current system only supports the
Static-Instance
configuration type, and all the runtime and dynamic configurations are treated asstatic-instance
.There is also a matrix of different administration levels for the configuration:
Proposal
Split the Configuration into Four Separate Files Controlled by the System Administrator
The same settings can be supplied via environment variables, similar to the current implementation. If both a configuration file and the corresponding environment variable are present, the environment variable takes precedence.
1. Static-Private Configuration
/etc/torrust/index/private.toml
orTORRUST_INDEX_CONFIG_PRIVATE
This file will contain settings that are set by the system administrator and should only be known by the system administrator.
2. Static-Public Configuration
/etc/torrust/index/public.toml
orTORRUST_INDEX_CONFIG_PUBLIC
This file will contain settings that are set by the system administrator and may be shared with the service administrator (or more).
3. General Override
/etc/torrust/index/override.toml
orTORRUST_INDEX_CONFIG_OVERRIDE
This file will contain settings that are overridden by the system administrator.
4. General Default
/etc/torrust/index/default.toml
orTORRUST_INDEX_CONFIG_DEFAULT
This file will contain default settings that are set by the system administrator.
Create an In-Database Settings File
As a record inside the database:
This record will contain a
json_utf8
formatted entry with the settings supplied by the service administrator.The following endpoints and actions will be created:
/admin/current
/admin/current
/admin/merged
/admin/default
/admin/override
The text was updated successfully, but these errors were encountered: