Subversion Repositories oidplus

Rev

Rev 814 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
261 daniel-mar 1
 
2
OVERVIEW OF ALL CONFIG.INC.PHP SETTINGS
3
=======================================
4
 
294 daniel-mar 5
The file userdata/baseconfig/config.inc.php contains various settings
261 daniel-mar 6
which are essential to connect to your database and other
7
things that should be known before the database connection
8
is opened.
294 daniel-mar 9
Other settings are stored in the database (table "config")
261 daniel-mar 10
and can be accessed using the admin login area.
11
 
294 daniel-mar 12
The setup assistant (/setup/) will lead you through
13
the creation of the most important settings of config.inc.php.
261 daniel-mar 14
 
294 daniel-mar 15
Below you will find a list of all possible config settings
16
of the default OIDplus installation/plugins.
17
Please note that a plugin can define any key.
18
 
19
 
261 daniel-mar 20
-------------------------------------
21
(1) CONFIG SETTINGS PROVIDED BY SETUP
22
-------------------------------------
23
 
24
OIDplus::baseConfig()->setValue('CONFIG_VERSION',           2.1);
25
 
471 daniel-mar 26
OIDplus::baseConfig()->setValue('ADMIN_PASSWORD',           '<BCrypt hash, or base64 encoded SHA3-512 hash>');
609 daniel-mar 27
                         If you want to have multiple valid administrator passwords
28
                         (e.g. if you want multiple users), then this value can
29
                         also be an array containing hashes.
261 daniel-mar 30
 
31
OIDplus::baseConfig()->setValue('DATABASE_PLUGIN',          '');
786 daniel-mar 32
                         Valid values: see plugins (setup/)
261 daniel-mar 33
 
786 daniel-mar 34
OIDplus::baseConfig()->setValue('OCI_CONN_STR',             'localhost/orcl');
35
                         Can be a Oracle connection string/TNS or a hostname like
36
 
37
OIDplus::baseConfig()->setValue('OCI_USERNAME',             'hr');
38
 
39
OIDplus::baseConfig()->setValue('OCI_PASSWORD',             'oracle');
40
 
261 daniel-mar 41
OIDplus::baseConfig()->setValue('ODBC_DSN',                 'DRIVER={SQL Server};SERVER=localhost;DATABASE=oidplus;CHARSET=UTF8');
42
 
43
OIDplus::baseConfig()->setValue('ODBC_USERNAME',            'sa');
44
 
45
OIDplus::baseConfig()->setValue('ODBC_PASSWORD',            base64_decode('<base64_encoded_password>')); // alternatively as plaintext
844 daniel-mar 46
                         The base64 encoding protects your password from being read if someone
47
                         "looks over your shoulder" at your display while you have the configuration file opened.
48
                         (Obviously, it doesn't protect you if they can make a photo or screenshot)
261 daniel-mar 49
 
50
OIDplus::baseConfig()->setValue('PDO_DSN',                  'pgsql:host=localhost;dbname=oidplus');
51
 
52
OIDplus::baseConfig()->setValue('PDO_USERNAME',             'postgres');
53
 
54
OIDplus::baseConfig()->setValue('PDO_PASSWORD',             base64_decode('<base64_encoded_password>')); // alternatively as plaintext
844 daniel-mar 55
                         The base64 encoding protects your password from being read if someone
56
                         "looks over your shoulder" at your display while you have the configuration file opened.
57
                         (Obviously, it doesn't protect you if they can make a photo or screenshot)
261 daniel-mar 58
 
59
OIDplus::baseConfig()->setValue('MYSQL_HOST',               'localhost:3306');
814 daniel-mar 60
                         The hostname to connect to. Port (:3306) is optional.
261 daniel-mar 61
 
813 daniel-mar 62
OIDplus::baseConfig()->setValue('MYSQL_SOCKET',             '');
63
                         In case you connect via MySQL through a socket, use this setting.
64
                         (It is currently not included in setup/ and needs to be set manually).
65
 
261 daniel-mar 66
OIDplus::baseConfig()->setValue('MYSQL_USERNAME',           'root');
67
 
68
OIDplus::baseConfig()->setValue('MYSQL_PASSWORD',           base64_decode('<base64_encoded_password>')); // alternatively as plaintext
844 daniel-mar 69
                         The base64 encoding protects your password from being read if someone
70
                         "looks over your shoulder" at your display while you have the configuration file opened.
71
                         (Obviously, it doesn't protect you if they can make a photo or screenshot)
261 daniel-mar 72
 
73
OIDplus::baseConfig()->setValue('MYSQL_DATABASE',           'oidplus');
74
 
75
OIDplus::baseConfig()->setValue('PGSQL_HOST',               'localhost:5432');
814 daniel-mar 76
                         The hostname to connect to. Port (:5432) is optional.
261 daniel-mar 77
 
814 daniel-mar 78
OIDplus::baseConfig()->setValue('PGSQL_SOCKET',             '');
79
                         In case you connect via PostgreSQL through a socket, use this setting.
80
                         (It is currently not included in setup/ and needs to be set manually).
81
 
261 daniel-mar 82
OIDplus::baseConfig()->setValue('PGSQL_USERNAME',           'postgres');
83
 
84
OIDplus::baseConfig()->setValue('PGSQL_PASSWORD',           base64_decode('<base64_encoded_password>')); // alternatively as plaintext
844 daniel-mar 85
                         The base64 encoding protects your password from being read if someone
86
                         "looks over your shoulder" at your display while you have the configuration file opened.
87
                         (Obviously, it doesn't protect you if they can make a photo or screenshot)
261 daniel-mar 88
 
89
OIDplus::baseConfig()->setValue('PGSQL_DATABASE',           'oidplus');
90
 
264 daniel-mar 91
 
713 daniel-mar 92
OIDplus::baseConfig()->setValue('SQLITE3_FILE',             'userdata/database/oidplus.db');
93
                         Attention: This file must be located in a location that is not world-readable/downloadable!
264 daniel-mar 94
 
713 daniel-mar 95
OIDplus::baseConfig()->setValue('SQLITE3_ENCRYPTION',       '');
96
                         Optional encryption
264 daniel-mar 97
 
261 daniel-mar 98
OIDplus::baseConfig()->setValue('TABLENAME_PREFIX',         'oidplus_');
99
 
100
OIDplus::baseConfig()->setValue('SERVER_SECRET',            'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
713 daniel-mar 101
                         It is very very important that you choose a long sequence of
261 daniel-mar 102
                         random characters. OIDplus uses this secret for various
103
                         security related purposes. If someone accidently received this secret,
104
                         please change the sequence.
105
 
713 daniel-mar 106
OIDplus::baseConfig()->setValue('CAPTCHA_PLUGIN',           'None');
107
 
261 daniel-mar 108
OIDplus::baseConfig()->setValue('RECAPTCHA_ENABLED',        true);
702 daniel-mar 109
                         Deprecated!
110
                         RECAPTCHA_ENABLED=true  becomes CAPTCHA_PLUGIN=ReCAPTCHA
111
                         RECAPTCHA_ENABLED=false becomes CAPTCHA_PLUGIN=None
261 daniel-mar 112
 
113
OIDplus::baseConfig()->setValue('RECAPTCHA_PUBLIC',         '');
713 daniel-mar 114
                         Only used if CAPTCHA_PLUGIN=ReCAPTCHA
261 daniel-mar 115
 
116
OIDplus::baseConfig()->setValue('RECAPTCHA_PRIVATE',        '');
713 daniel-mar 117
                         Only used if CAPTCHA_PLUGIN=ReCAPTCHA
261 daniel-mar 118
 
119
OIDplus::baseConfig()->setValue('ENFORCE_SSL',              2);
713 daniel-mar 120
                         Values 0 (off), 1 (on), 2 (auto detect)
261 daniel-mar 121
 
122
 
123
----------------------
374 daniel-mar 124
(2) SYSTEM LIMITATIONS (defined and documented in includes/oidplus_limits.inc.php , can be overwritten by config.inc.php)
261 daniel-mar 125
----------------------
126
 
127
OIDplus::baseConfig()->setValue('LIMITS_MAX_OID_DEPTH',  30);
713 daniel-mar 128
                         Please read the documentation in the file includes/oidplus_limits.inc.php
261 daniel-mar 129
 
130
OIDplus::baseConfig()->setValue('LIMITS_MAX_ID_LENGTH',     255);
713 daniel-mar 131
                         Please read the documentation in the file includes/oidplus_limits.inc.php
261 daniel-mar 132
 
133
OIDplus::baseConfig()->setValue('LIMITS_MAX_OID_ARC_SIZE',  50);
713 daniel-mar 134
                         Please read the documentation in the file includes/oidplus_limits.inc.php
261 daniel-mar 135
 
136
OIDplus::baseConfig()->setValue('LIMITS_MAX_OID_ASN1_ID_LEN',  255);
713 daniel-mar 137
                         Please read the documentation in the file includes/oidplus_limits.inc.php
261 daniel-mar 138
 
139
OIDplus::baseConfig()->setValue('LIMITS_MAX_OID_UNICODE_LABEL_LEN',  255);
713 daniel-mar 140
                         Please read the documentation in the file includes/oidplus_limits.inc.php
261 daniel-mar 141
 
142
 
143
-----------------------------------------
144
(3) "HIDDEN"/UNDOCUMENTED CONFIG SETTINGS
145
-----------------------------------------
146
 
147
OIDplus::baseConfig()->setValue('OIDINFO_API_URL', '<url>');
713 daniel-mar 148
                         Currently only internal use for development utilities (dev/).
502 daniel-mar 149
                         The API to oid-info.com is currently not public.
261 daniel-mar 150
 
151
OIDplus::baseConfig()->setValue('REGISTRATION_HIDE_SYSTEM', true);
713 daniel-mar 152
                         Set this if you have a clone of a productive system and you want
261 daniel-mar 153
                         to avoid that the clone registers at the ViaThinkSoft directory
154
                         (which would overwrite the URL of the productive system and reveal
155
                         the URL of your testing system)
156
 
157
OIDplus::baseConfig()->setValue('MYSQL_FORCE_MYSQLND_SUPPLEMENT',         false);
713 daniel-mar 158
                         The MySQLi plugin contains a supplement code to handle
261 daniel-mar 159
                         prepared statements on servers which do not have the MySQLnd extension
160
                         installed. Set this flag to force the supplement to be used,
161
                         even if MySQLnd is available. (For testing purposes only)
162
 
163
OIDplus::baseConfig()->setValue('QUERY_LOGFILE',          '');
713 daniel-mar 164
                         Set this setting to a filename where all queries including timestamps would be written.
261 daniel-mar 165
                         This is used for performance analysis.
166
                         Please choose a directory that cannot be accessed by world-wide.
167
 
168
OIDplus::baseConfig()->setValue('SESSION_LIFETIME', 30*60);
713 daniel-mar 169
                         Session lifetime in seconds.
261 daniel-mar 170
 
171
OIDplus::baseConfig()->setValue('OBJECT_CACHING',         true);
172
 
173
OIDplus::baseConfig()->setValue('FORCE_DBMS_SLANG', '');
713 daniel-mar 174
                         Currently valid values: mysql, mssql, pgsql, sqlite
261 daniel-mar 175
 
502 daniel-mar 176
OIDplus::baseConfig()->setValue('PREPARED_STATEMENTS_EMULATION', 'auto');
713 daniel-mar 177
                         Currently only for ODBC database plugin.
502 daniel-mar 178
                         'auto' = Auto detect if prepared statements should be emulated
179
                         'on' = Always emulate prepared statements
180
                         'off' = Never emulate prepared statements
181
 
261 daniel-mar 182
OIDplus::baseConfig()->setValue('MINIFY_CSS', true);
417 daniel-mar 183
                         This enables the compression of CSS definitions.
184
                         Compressed approx:   220 KB
185
                         Uncompressed approx: 224 KB
261 daniel-mar 186
 
187
OIDplus::baseConfig()->setValue('MINIFY_JS',  true);
417 daniel-mar 188
                         This enables the compression of JavaScript code.
189
                         Please only disable this, if you want to debug
190
                         the code! You should not disable it on a productive
191
                         system, because otherwise the JavaScript code
192
                         would be several Megabytes large.
193
                         Compressed approx:  1133 KB
194
                         Unompressed approx: 2761 KB
261 daniel-mar 195
 
297 daniel-mar 196
OIDplus::baseConfig()->setValue('DISABLE_PLUGIN_...', true);
713 daniel-mar 197
                         This gives you the possibility to disable a plugin without
297 daniel-mar 198
                         requiring it to be removed from the file system.
199
                         (Removing a plugin from the file system can result in various
200
                         problems, e.g. they can be re-added during a SVN/software update.)
201
                         Replace "..." with the main PHP class of the plugin you want to disable
202
                         Example:
203
                         "DISABLE_PLUGIN_OIDplusLoggerPluginUserdataLogfile"
204
                         disables the plugin "logger/300_userdata_logfile".
316 daniel-mar 205
 
206
OIDplus::baseConfig()->setValue('DISABLE_AJAX_TRANSACTIONS', false);
207
                         This will disable the usage of database transactions in ajax.php
208
                         Do only use this if you have severe problems with the system running.
209
                         It might result in inconsistent data e.g. if you update an OID
210
                         and an error occurs in the middle of that process.
326 daniel-mar 211
 
806 daniel-mar 212
OIDplus::baseConfig()->setValue('CANONICAL_SYSTEM_URL', '');
213
                         Setting this value to a system URL will override the absolute system URL detection.
214
                         It has the following effects:
215
                         1. The "canonical" metatag will use this explicit system URL
216
                            instead of the one the PHP script is detecting.
217
                            (This is important to avoid duplicate content at search indexes)
218
                         2. CLI WHOIS and other CLI (Command-line-interface) tools
219
                            will use this address when they need to output an URL.
220
                            Otherwise, the CLI tools would need to use the last known
221
                            URL that was detected when a webpage visitor has last visited the
222
                            page.
223
                         3. While most resources (images, CSS files, scripts, etc.) are loaded
224
                            via relative URLs, sometimes an absolute URL is required
225
                            (e.g., if an email is sent with an activation link).
226
                            The explicit absolute system URL will then be used rather
227
                            than the automatically detected one.
228
                         Note that setting an absolute system URL can be very useful if
229
                         OIDplus runs on a system (which detects itself as "X"),
807 daniel-mar 230
                         while the canonical URL "Y" is a reverse-proxy.
778 daniel-mar 231
 
456 daniel-mar 232
OIDplus::baseConfig()->setValue('DEBUG', false);
233
                         Enables some special checks for plugins (e.g. a self-test for auth plugins).
234
                         It is highly recommended that you enable DEBUG if you are developing
235
                         plugins!
470 daniel-mar 236
                         It is recommended to disable this switch in productive systems,
237
                         because the self-tests decrease the performance.
238
                         However, after installing a new plugin, you might want to enable
239
                         it for a few minutes, to make sure the plugin is working correctly.
430 daniel-mar 240
 
557 daniel-mar 241
OIDplus::baseConfig()->setValue('COOKIE_SAMESITE_POLICY', 'Strict');
242
                         Defined which "SameSite" policy should be used for the cookies OIDplus uses.
243
                         Can be "None", "Lax" or "Strict".
244
                         "Strict" is the most secure setting.
245
                         "Lax" allows that people stay logged in if they follow a link pointing
246
                         to your OIDplus installation.
247
                         "None" is not recommended and is deprecated by modern web browsers.
248
                         However, OIDplus itself provides an Anti-CSRF mechanism, so you should be
249
                         still safe.
456 daniel-mar 250
 
812 daniel-mar 251
OIDplus::baseConfig()->setValue('COOKIE_DOMAIN', '');
252
                         Can be used to increase security by setting an explicit domain-name in the cookies.
253
                         Set to '' (empty string) to allow all (sub)domains.
254
                         Set to '(auto)' to automatically detect the domain based on the absolute canonical path.
255
 
256
OIDplus::baseConfig()->setValue('COOKIE_PATH', '/');
257
                         Can be used to increase security by setting an explicit pathname in the cookies.
258
                         Set to '/' to allow all paths.
259
                         Set to '(auto)' to automatically detect the path based on the absolute canonical path.
260
                         Note: If supported, you can use Apache's "ProxyPassReverseCookiePath" to translate
261
                         the cookie path in a reverse-proxy setting.
262
 
713 daniel-mar 263
OIDplus::baseConfig()->getValue('RA_PASSWORD_PEPPER', '');
617 daniel-mar 264
                         The pepper is stored inside the base configuration file
265
                         It prevents that an attacker with SQL write rights can
266
                         create accounts.
267
                         ATTENTION!!! If a pepper is used, then the
268
                         hashes are bound to that pepper. If you change the pepper,
269
                         then ALL passwords of RAs become INVALID!
557 daniel-mar 270
 
713 daniel-mar 271
OIDplus::baseConfig()->getValue('RA_PASSWORD_PEPPER_ALGO', 'sha512');
711 daniel-mar 272
                         The pepper is stored inside the base configuration file
273
                         It prevents that an attacker with SQL write rights can
274
                         create accounts.
275
                         ATTENTION!!! If a pepper is used, then the
276
                         hashes are bound to that pepper. If you change the pepper,
277
                         then ALL passwords of RAs become INVALID!
617 daniel-mar 278
 
711 daniel-mar 279
 
430 daniel-mar 280
----------------------------------------------------
281
(4) LDAP FIELDS (see document ldap_installation.txt)
282
----------------------------------------------------
283
 
620 daniel-mar 284
OIDplus::baseConfig()->setValue('LDAP_ENABLED',                true);
285
                         Set to true if you want to enable that users can log-in using LDAP / ActiveDirectory.
432 daniel-mar 286
 
625 daniel-mar 287
OIDplus::baseConfig()->setValue('LDAP_NUM_DOMAINS',            1);
288
                         Contains the number of domains/servers which are used.
289
                         For 2nd, 3rd, 4th, ... domain use the fields LDAP_xxx__2, LDAP_xxx__3, ...
290
                         e.g.   LDAP_SERVER__2
291
                                LDAP_PORT__2
292
                                LDAP_BASE_DN__2
293
                                ...
294
 
620 daniel-mar 295
OIDplus::baseConfig()->setValue('LDAP_SERVER',                 'ldap://server1.contoso.local');
296
                         The LDAP server of your company.
432 daniel-mar 297
 
620 daniel-mar 298
OIDplus::baseConfig()->setValue('LDAP_PORT',                   389);
299
                         The port of the LDAP server
300
 
301
OIDplus::baseConfig()->setValue('LDAP_BASE_DN',                'DC=CONTOSO,DC=local');
302
                         The base Distinguished Name (DN) of your directory.
303
 
625 daniel-mar 304
OIDplus::baseConfig()->setValue('LDAP_UPN_SUFFIX',             '@contoso.local');
305
                         The UPN suffix of this domain.
306
 
307
OIDplus::baseConfig()->setValue('LDAP_AUTHENTICATE_UPN',       true);
620 daniel-mar 308
                         In the login mask, the users will log in using the UPN ("principal name") e.g. username@contoso.local,
309
                         and in OIDplus, a RA account with an email equal to the UPN will be created.
310
 
311
OIDplus::baseConfig()->setValue('LDAP_AUTHENTICATE_EMAIL',     false);
312
                         In the login mask, the users will log in using the UPN ("principal name") e.g. username@contoso.local,
313
                         and in OIDplus, a RA account with an email equal to the "E-Mail-Address" field of the user in the directory will be created.
314
                         Note: If you did not set an email address to the user in the LDAP/ActiveDirectory, then the login will not be possible,
315
                         except if LDAP_AUTHENTICATE_UPN is additionally enabled.
316
                         Attention: Depending on your domain configuration, users might be able to change their own data,
317
                         e.g. email address. If this is the case, you must not enable this setting, otherwise,
318
                         users could authenticate with any address!
319
 
623 daniel-mar 320
OIDplus::baseConfig()->setValue('LDAP_ADMIN_GROUP',            '');
321
                         If set to an empty string, the OIDplus administrator account cannot be accessed using LDAP authentication.
322
                         Otherwise, the user will be authenticated as administrator, if the LDAP user is a
624 daniel-mar 323
                         member of the group specified in this setting.
623 daniel-mar 324
                         Example values: CN=Administrators,CN=Builtin,DC=CONTOSO,DC=local
325
                                         makes every domain administrator also an OIDplus administrator
326
                                         CN=OIDplus Administrators,CN=Users,DC=CONTOSO,DC=local
327
                                         makes every user of the group (OIDplus Administrators) to OIDplus administrators
328
 
329
OIDplus::baseConfig()->setValue('LDAP_RA_GROUP',               '');
330
                         If set to an empty string, every LDAP user can authenticate as RA, depending
331
                         on whether LDAP_AUTHENTICATE_UPN and/or LDAP_AUTHENTICATE_EMAIL is set.
624 daniel-mar 332
                         Otherwise, the LDAP users must be a member of the group specified in this setting.
620 daniel-mar 333
 
334
 
432 daniel-mar 335
----------------------------------------------------------------------
336
(5) GOOGLE OAUTH2 FIELDS (see document google_oauth2_installation.txt)
337
----------------------------------------------------------------------
338
 
339
OIDplus::baseConfig()->setValue('GOOGLE_OAUTH2_ENABLED',       true);
340
OIDplus::baseConfig()->setValue('GOOGLE_OAUTH2_CLIENT_ID',     '..............apps.googleusercontent.com');
341
OIDplus::baseConfig()->setValue('GOOGLE_OAUTH2_CLIENT_SECRET', '.............');
436 daniel-mar 342
 
343
 
344
-------------------------------------------------------------------------
345
(6) FACEBOOK OAUTH2 FIELDS (see document facebook_oauth2_installation.txt)
346
-------------------------------------------------------------------------
347
 
348
OIDplus::baseConfig()->setValue('FACEBOOK_OAUTH2_ENABLED',       true);
349
OIDplus::baseConfig()->setValue('FACEBOOK_OAUTH2_CLIENT_ID',     '.............'); // Your App ID
350
OIDplus::baseConfig()->setValue('FACEBOOK_OAUTH2_CLIENT_SECRET', '.............'); // Your App Secret
572 daniel-mar 351
 
352
 
353
----------------------------------------------------
354
(7) JWT AUTHENTICATION FIELDS
355
----------------------------------------------------
356
 
357
If a web request contains the field "OIDPLUS_AUTH_JWT" containing a signed JWT token,
358
an automatic one-time login is performed in order to execute commands.
359
This feature is used in the plugins "Automated AJAX calls" for admins and RAs.
360
With these switches you can disable this feature.
361
 
362
OIDplus::baseConfig()->setValue('JWT_ALLOW_AJAX_ADMIN', true);
363
                         Allow JWT tokens that were created using the admin-plugin
364
                         "Automated AJAX calls".
365
 
366
OIDplus::baseConfig()->setValue('JWT_ALLOW_AJAX_USER', true);
367
                         Allow JWT tokens that were created using the RA-plugin
368
                         "Automated AJAX calls".
369
 
370
OIDplus::baseConfig()->setValue('JWT_ALLOW_LOGIN_ADMIN', true);
579 daniel-mar 371
                         Allow "Remember me" logins for the administrator account.
572 daniel-mar 372
 
373
OIDplus::baseConfig()->setValue('JWT_ALLOW_LOGIN_USER', true);
579 daniel-mar 374
                         Allow "Remember me" logins for a RA.
572 daniel-mar 375
 
585 daniel-mar 376
OIDplus::baseConfig()->setValue('JWT_ALLOW_MANUAL', false);
572 daniel-mar 377
                         Allow JWT tokens which were manually created "by hand".
378
                         These can have any content you like, but they must
379
                         contain the claim "oidplus_generator" with value "2".
583 daniel-mar 380
 
381
OIDplus::baseConfig()->setValue('JWT_TTL_LOGIN_USER', 10*365*24*60*60);
382
                         How many seconds will a "remember me" login JWT token be valid?
383
                         (RA login)
384
 
385
OIDplus::baseConfig()->setValue('JWT_TTL_LOGIN_ADMIN', 10*365*24*60*60);
386
                         How many seconds will a "remember me" login JWT token be valid?
387
                         (Administrator login)