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

Database configuration backend #3770

Open
1 of 3 tasks
nilmerg opened this issue May 2, 2019 · 0 comments
Open
1 of 3 tasks

Database configuration backend #3770

nilmerg opened this issue May 2, 2019 · 0 comments
Labels
area/configuration Affects the configuration enhancement New feature or improvement queue/wishlist Probable candidate for a future release

Comments

@nilmerg
Copy link
Member

nilmerg commented May 2, 2019

At the moment we store most of our configuration on disk in INI files. While this allows easy editing it requires duplicating configuration in a clustered environment.

Subtasks:

Enforce as default backend

At the moment we provide support for INI files and a database as configuration backend. With the release of v2.9.0 we are going to deprecate INI files and enforce a database as configuration backend for new installations.

This requires the following changes:

  • The setup wizard does not allow the user to choose the backend type, it enforces the setup of the database as backend.
  • The general configuration of Icinga Web 2 also does not provide a way to configure the configuration backend type. It only allows to choose a specific database resource to use.
  • INI files as preferences backend are still supported, but only by configuration. If this backend type is detected, a warning should appear in the log telling the user that this is deprecated and will be removed with version 2.10.
  • Code which needs access to the configuration backend should make use of the trait Icinga\Common\Database which utilizes the resource configured in the general configuration.

Development Hints

If the setup module is enabled, the setup is accessible by visiting /icingaweb2/setup. It can be started by entering a token that needs to be generated on the server. (Use icingacli setup token create in the web container)

  • WebWizard::getRequirements() defines what is necessary to start the setup. Currently the database adapters for MySQL and PostgreSQL are both optional. This needs to change so that at least either of the two must be available.
  • Throughout the following steps the wizard must assume database as configuration backend by default.
  • WebWizard::getNewPage() controls whether DbResourcePage is shown in case the database is not already set-up due to the authentication config.
  • Class GeneralConfigPage is used to let the user configure the general configuration of Icinga Web 2. This includes choosing which backend to use to store user preferences. This option needs to be removed so that the user can't choose the backend type anymore. This also requires changes in WebWizard::setupPage() as it's accessing the page's element.
  • Further on, anytime Icinga Web 2 accesses a user's preferences it should assume that a database is used as backend by default. Check where PreferencesStore::create() is utilized to get an idea how to accomplish that. Remember to log a warning for INI backends.
  • Class GeneralConfigForm needs to also show a warning if INI is detected as configuration backend type. To accomplish that implement method onRequest() in this class, inspect the configuration object and show a warning with $this->warning().
@nilmerg nilmerg added area/configuration Affects the configuration enhancement New feature or improvement labels May 2, 2019
@nilmerg nilmerg added this to the 2.8.0 milestone May 2, 2019
@nilmerg nilmerg added the TBD To be defined - We aren't certain about this yet label May 9, 2019
@nilmerg nilmerg removed this from the 2.8.0 milestone Dec 3, 2019
@nilmerg nilmerg added the queue/wishlist Probable candidate for a future release label Dec 3, 2019
@nilmerg nilmerg removed TBD To be defined - We aren't certain about this yet queue/wishlist Probable candidate for a future release labels Apr 16, 2020
@nilmerg nilmerg added the queue/wishlist Probable candidate for a future release label Apr 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/configuration Affects the configuration enhancement New feature or improvement queue/wishlist Probable candidate for a future release
Projects
None yet
Development

No branches or pull requests

1 participant