Using configuration files for i-doit console utility#
Using a configuration file (.ini
) is a powerful way to run console commands, especially complex ones. It allows you to pre-define all your options in a reusable file.
Key Benefits: * Security: Avoids typing passwords directly into the command line where they can be logged in your shell history. * Simplicity: Manages many options for complex commands like ldap-sync
in a structured way. * Reusability: Saves different configurations for different tasks without having to re-type them every time.
Backup First
Please create a complete backup before making any changes with an interface or import. If the result is not satisfying, it can then be restored.
The Structure of an .ini
File#
You can save your configuration files everywhere you want for better organization. To use one, specify the path with the --config
or -c
option.
Every configuration file follows the same basic structure with three sections:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
Examples#
Example for the command search-index
#
This example rebuilds the search index. The update
option forces a rebuild of an existing index, and quiet
minimizes the console output.
search-index.ini | |
---|---|
1 2 3 4 5 6 7 8 |
|
Execution:
1 |
|
Example for the command notifications-send
#
This command sends out pending notifications and requires only basic authentication options.
notifications-send.ini | |
---|---|
1 2 3 4 5 6 |
|
Execution:
1 |
|
example-notifications-send.ini
Example for the command ldap-sync
#
This is a complex command where a configuration file is highly recommended. The [additional]
section contains all the LDAP-specific settings and attribute mappings.
ldap-sync.ini | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
|
Explanation of [additional]
Parameters:
Key | Value | Description |
---|---|---|
import_rooms | true or false | If true , imports the physicalDeliveryOfficeName attribute and creates a corresponding room object if it doesn't exist. |
defaultCompany | "Name of Organization" | Sets a default organization for imported users. Leave empty to make no changes. |
deletedUsersBehaviour | archive , delete or disable_login | Defines what happens to i-doit users when they are deleted from LDAP. |
disabledUsersBehaviour | archive , delete or disable_login | Defines what happens to i-doit users when they are disabled in LDAP. |
attributes[] | attributes[i-doit field]=AD Attribute | Maps an i-doit object attribute (key) to an LDAP attribute (value). If you want to save custom information, you can enable Category extension. |
autoReactivateUsers | true or false | If true , all users are set to "normal" status before sync. Only needed for OpenLDAP/NDS. |
ignoreUsersWithAttributes[] | ignoreUsersWithAttributes[]="sn" | Prevents synchronization of users if a specified LDAP attribute is empty (e.g., sn for last name). You can list multiple attributes. |
ignoreFunction | empty , !empty , isset , !isset | The check used for ignoreUsersWithAttributes . For example, empty checks if the attribute value is empty or not set. |
Execution:
1 |
|
Example for the command import-syslog
#
This command imports syslog messages into the i-doit logbook. The configuration file defines which log files to read and how to parse them.
import-syslog.ini | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
|
Execution:
1 |
|