Skip to content

[Feature] Enable Settings even for Core plugin component #946

@scicco

Description

@scicco

Is your feature request related to a problem? Please describe.

It should be nice to have a settings section for the core plugin where we can specify the custom variables used for the cat. When opening the settings, the default values will be set as the corresponding ENV variable.

Example:

variable name: log_level
default value: get_env('LOG_LEVEL') or 'INFO'

get_env

def get_env(name):
)

default_value of log_level:

"CCAT_LOG_LEVEL": "INFO",

With this change, we can add additional settings without the need to introduce additional ENV variables.

This can avoid any breaking changes for all deployments already in production but let us define additional settings even without introducing other ENVs

some use cases:

Describe the solution you'd like

A user can override those settings runtime. When the user saves the settings, those values are written inside the cat data folder, maybe in a new settings.json file.

On startup, the code checks for the existence of settings.json. If no file is present it will be filled with the default values and then saved.

For newer values without an ENV, we can modify the settings.json default template to include that default values

We can then use the watch library to listen for changes to that file, and then restart the server if needed

Describe alternatives you've considered

Change settings without the watch library involved. In this case, the server must be restarted manually to apply the new values

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions