Skip to content
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

Refactor Config #1184

Closed
kuznetsss opened this issue Feb 15, 2024 · 3 comments · Fixed by #1627
Closed

Refactor Config #1184

kuznetsss opened this issue Feb 15, 2024 · 3 comments · Fixed by #1627
Assignees
Labels
enhancement New feature or request refactoring Code improvements without logical changes
Milestone

Comments

@kuznetsss
Copy link
Collaborator

It would be nice to refactor Config class to parse file once into structure applying all the default values and then use the structure everywhere in the code.

It will also allow us to easily add --check-config run option to verify provided config instead of starting Clio.

@github-project-automation github-project-automation bot moved this to 📋 Backlog in Clio Feb 15, 2024
@kuznetsss kuznetsss added enhancement New feature or request refactoring Code improvements without logical changes labels Feb 15, 2024
@godexsoft
Copy link
Collaborator

If we want to support live reload of some components in the future (such as DOSGuard for example) we might want to do a bit more than a plain structure. I'd like to be able to subscribe to changes of certain config sections so that we don't need to reload all components, only ones affected by the config change. Not sure how desired this functionality is, just an idea.

@kuznetsss
Copy link
Collaborator Author

I will create a separate task for live config reload.

In this task we want to rewrite config so it has these features:

  • checking whether config file is valid
  • generating default config (probably with something like <required> in place where there is no default value and the value is always required)

Some details of implementation:

  • all the default values and values restrictions should be in one place inside implementation
  • provided file should be parsed once into in-memory representation of config and only the representation should be used
  • implementing this we should keep in mind that we want to support yaml in the future, so adding another parser should be easy

@kuznetsss
Copy link
Collaborator Author

We should create a separate issues for these items:

  • checking whether config file is valid (clio-server --verify-config)
  • generating default config (probably with something like in place where there is no default value and the value is always required)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request refactoring Code improvements without logical changes
Projects
Status: ✅ Merged
Development

Successfully merging a pull request may close this issue.

3 participants