Update doc

This commit is contained in:
Sukhwinder Dhillon 2022-05-03 13:34:07 +02:00 committed by Johannes Meyer
parent a250202fa3
commit 41a23c3eb3
2 changed files with 3 additions and 28 deletions

View File

@ -28,8 +28,7 @@ Option | Description
-------------------------|----------------------------------------------- -------------------------|-----------------------------------------------
show\_stacktraces | **Optional.** Whether to show debug stacktraces. Defaults to `0`. show\_stacktraces | **Optional.** Whether to show debug stacktraces. Defaults to `0`.
module\_path | **Optional.** Specifies the directories where modules can be installed. Multiple directories must be separated with colons. module\_path | **Optional.** Specifies the directories where modules can be installed. Multiple directories must be separated with colons.
config\_backend | **Optional.** Select the user preference storage. Can be set to `ini` (default), `db` or `none`. If `db` is selected, this requires the `config_resource` attribute. config\_resource | **Required.** Specify a defined [resource](04-Resources.md#resources-configuration-database) name.
config\_resource | **Optional.** Specify a defined [resource](04-Resources.md#resources-configuration-database) name. Can only be used if `config_backend` is set to `db`.
Example for storing the user preferences in the database resource `icingaweb_db`: Example for storing the user preferences in the database resource `icingaweb_db`:
@ -37,7 +36,6 @@ Example for storing the user preferences in the database resource `icingaweb_db`
``` ```
[global] [global]
show_stacktraces = "0" show_stacktraces = "0"
config_backend = "db"
config_resource = "icingaweb_db" config_resource = "icingaweb_db"
module_path = "/usr/share/icingaweb2/modules" module_path = "/usr/share/icingaweb2/modules"
``` ```

View File

@ -3,35 +3,13 @@
Preferences are settings a user can set for their account only, Preferences are settings a user can set for their account only,
for example the language and time zone. for example the language and time zone.
Preferences can be stored either in INI files or in a MySQL or in a PostgreSQL database. By default, Icinga Web 2 stores Preferences can be stored either in a MySQL or in a PostgreSQL database. The database must be configured.
preferences in INI files beneath Icinga Web 2's configuration directory.
```
/etc/icingaweb2/<username>/config.ini
```
## Configuration <a id="preferences-configuration"></a> ## Configuration <a id="preferences-configuration"></a>
The preference configuration backend is defined in the global [config.ini](03-Configuration.md#configuration-general-global) file. The preference configuration backend is defined in the global [config.ini](03-Configuration.md#configuration-general-global) file.
### Store Preferences in INI Files <a id="preferences-configuration-ini"></a> You have to define a [database resource](04-Resources.md#resources-configuration-database)
If preferences are stored in INI Files, Icinga Web 2 automatically creates one file per user using the username as
file name for storing preferences. A INI file is created once a user saves changed preferences the first time.
The files are located beneath the `preferences` directory beneath Icinga Web 2's configuration directory.
You need to add the following section to the global [config.ini](03-Configuration.md#configuration-general-global) file
in order to store preferences in a file.
```
[global]
config_backend = "ini"
```
### Store Preferences in a Database <a id="preferences-configuration-db"></a>
In order to be more flexible in distributed setups you can store preferences in a MySQL or in a PostgreSQL database.
For storing preferences in a database, you have to define a [database resource](04-Resources.md#resources-configuration-database)
which will be referenced as resource for the preferences storage. which will be referenced as resource for the preferences storage.
You need to add the following section to the global [config.ini](03-Configuration.md#configuration-general-global) file You need to add the following section to the global [config.ini](03-Configuration.md#configuration-general-global) file
@ -39,6 +17,5 @@ in order to store preferences in a database.
``` ```
[global] [global]
config_backend = "db"
config_resource = "icingaweb_db" config_resource = "icingaweb_db"
``` ```