]> git.mxchange.org Git - friendica.git/blob - doc/Config.md
Fix formatting in mod/help
[friendica.git] / doc / Config.md
1 Config values that can only be set in config/local.ini.php
2 ==========================================================
3
4 * [Home](help)
5
6 Friendica's configuration is done in two places: in INI configuration files and in the `config` database table.
7 Database config values overwrite the same file config values.
8
9 # File configuration
10
11 The configuration format for file configuration is an INI string returned from a PHP file.
12 This prevents your webserver from displaying your private configuration it interprets the configuration files and displays nothing.
13
14 A typical configuration file looks like this:
15
16 ```php
17 <?php return <<<INI
18
19 ; Comment line
20
21 [section1]
22 key = value
23 empty_key =
24
25 [section2]
26 array[] = value0
27 array[] = value1
28 array[] = value2
29
30 INI;
31 // Keep this line
32 ```
33
34 ## Configuration location
35
36 All the configuration keys Friendica uses are listed with their default value if any in `config/defaults.ini.php`.
37 Addons can define their own default configuration values in `addon/[addon]/config/[addon].ini.php` which are loaded when the addon is activated.
38
39 ### Migrating from .htconfig.php to config/local.ini.php
40
41 The legacy `.htconfig.php` configuration file is still supported, but is deprecated and will be removed in a subsequent Friendica release.
42
43 The migration is pretty straightforward, just copy `config/local-sample.ini.php` to `config/local.ini.php`, add your configuration values to it according to the following conversion chart, then rename your `.htconfig.php` to check your node is working as expected before deleting it.
44
45 <style>
46 table.config {
47     margin: 1em 0;
48     background-color: #f9f9f9;
49     border: 1px solid #aaa;
50     border-collapse: collapse;
51     color: #000;
52     width: 100%;
53 }
54
55 table.config > tr > th,
56 table.config > tr > td,
57 table.config > * > tr > th,
58 table.config > * > tr > td {
59     border: 1px solid #aaa;
60     padding: 0.2em 0.4em
61 }
62
63 table.config > tr > th,
64 table.config > * > tr > th {
65     background-color: #f2f2f2;
66     text-align: center;
67     width: 50%
68 }
69 </style>
70
71 <table class="config">
72         <thead>
73                 <tr>
74                         <th>.htconfig.php</th>
75                         <th>config/local.ini.php</th>
76                 </tr>
77         </thead>
78         <tbody>
79                 <tr>
80                         <td><pre>
81 $db_host = 'localhost';
82 $db_user = 'mysqlusername';
83 $db_pass = 'mysqlpassword';
84 $db_data = 'mysqldatabasename';
85 $a->config["system"]["db_charset"] = 'utf8mb4';
86 </pre></td>
87                         <td><pre>
88 [database]
89 hostname = localhost
90 username = mysqlusername
91 password = mysqlpassword
92 database = mysqldatabasename
93 charset = utf8mb4
94 </pre></td>
95                 </tr>
96
97                 <tr>
98                         <td><pre>
99 $a->config["section"]["key"] = "value";
100 </pre></td>
101                         <td><pre>
102 [section]
103 key = value
104 </pre></td>
105                 </tr>
106
107                 <tr>
108                         <td><pre>
109 $a->config["section"]["key"] = array(
110         "value1",
111         "value2",
112         "value3"
113 );
114 </pre></td>
115                         <td><pre>
116 [section]
117 key[] = value1
118 key[] = value2
119 key[] = value3
120 </pre></td>
121                 </tr>
122
123                 <tr>
124                         <td><pre>
125 $a->config["key"] = "value";
126 </pre></td>
127                         <td><pre>
128 [config]
129 key = value
130 </pre></td>
131                 </tr>
132
133                 <tr>
134                         <td><pre>
135 $a->path = "value";
136 </pre></td>
137                         <td><pre>
138 [system]
139 urlpath = value
140 </pre></td>
141                 </tr>
142
143                 <tr>
144                         <td><pre>
145 $default_timezone = "value";
146 </pre></td>
147                         <td><pre>
148 [system]
149 default_timezone = value
150 </pre></td>
151                 </tr>
152
153                 <tr>
154                         <td><pre>
155 $pidfile = "value";
156 </pre></td>
157                         <td><pre>
158 [system]
159 pidfile = value
160 </pre></td>
161                 </tr>
162
163                 <tr>
164                         <td><pre>
165 $lang = "value";
166 </pre></td>
167                         <td><pre>
168 No equivalent (yet)
169 </pre></td>
170                 </tr>
171
172         </tbody>
173 </table>
174
175
176 ## Database Settings
177
178 The configuration variables database.hostname, database.username, database.password, database.database and database.charset are holding your credentials for the database connection.
179 If you need to specify a port to access the database, you can do so by appending ":portnumber" to the database.hostname variable.
180
181     [database]
182     hostname = your.mysqlhost.com:123456
183
184 If all of the following environment variables are set, Friendica will use them instead of the previously configured variables for the db:
185
186     MYSQL_HOST
187     MYSQL_PORT
188     MYSQL_USERNAME
189     MYSQL_PASSWORD
190     MYSQL_DATABASE
191
192
193
194 # Config values that can only be set in config/local.ini.php
195
196 There are some config values that haven't found their way into the administration page.
197 This has several reasons.
198 Maybe they are part of a current development that isn't considered stable and will be added later in the administration page when it is considered safe.
199 Or it triggers something that isn't expected to be of public interest.
200 Or it is for testing purposes only.
201
202 **Attention:** Please be warned that you shouldn't use one of these values without the knowledge what it could trigger.
203 Especially don't do that with undocumented values.
204
205 The header of the section describes the category, the value is the parameter.
206 Example: To set the automatic database cleanup process add this line to your config/local.ini.php:
207
208     [system]
209     always_show_preview = true
210
211 ## jabber ##
212 * **debug** (Boolean) - Enable debug level for the jabber account synchronisation.
213 * **lockpath** - Must be writable by the ejabberd process. if set then it will prevent the running of multiple processes.
214
215 ## system ##
216
217 * **allowed_link_protocols** (Array) - Allowed protocols in links URLs, add at your own risk. http is always allowed.
218 * **always_show_preview** (Boolean) - Only show small preview picures. Default value is false.
219 * **archival_days** (Integer) - Number of days that we try to deliver content before we archive a contact. Defaults to 32.
220 * **auth_cookie_lifetime** (Integer) - Number of days that should pass without any activity before a user who chose "Remember me" when logging in is considered logged out. Defaults to 7.
221 * **block_local_dir** (Boolean) - Blocks the access to the directory of the local users.
222 * **config_adapter** (jit|preload) - Allow to switch the configuration adapter to improve performances at the cost of memory consumption. Default value is "jit"
223 * **curl_range_bytes** - Maximum number of bytes that should be fetched. Default is 0, which mean "no limit".
224 * **db_log** - Name of a logfile to log slow database queries
225 * **db_loglimit** - If a database call lasts longer than this value it is logged
226 * **db_log_index** - Name of a logfile to log queries with bad indexes
227 * **db_log_index_watch** - Watchlist of indexes to watch
228 * **db_loglimit_index** - Number of index rows needed to be logged for indexes on the watchlist
229 * **db_loglimit_index_high** - Number of index rows to be logged anyway (for any index)
230 * **db_log_index_blacklist** - Blacklist of indexes that shouldn't be watched
231 * **dbclean_expire_conversation** (Integer) - When DBClean is enabled, any entry in the conversation table will be deleted after this many days.  These data are normally needed only for debugging purposes and they are safe to delete.  Default 90.
232 * **diaspora_test** (Boolean) - For development only. Disables the message transfer.
233 * **disable_email_validation** (Boolean) - Disables the check if a mail address is in a valid format and can be resolved via DNS.
234 * **disable_url_validation** (Boolean) - Disables the DNS lookup of an URL.
235 * **disable_password_exposed** (Boolean) - Disable the exposition check against the remote haveibeenpwned API on password change. Default value is false.
236 * **dlogfile** - location of the developer log file
237 * **dlogip** - restricts develop log writes to requests originating from this IP address
238 * **frontend_worker_timeout** - Value in minutes after we think that a frontend task was killed by the webserver. Default value is 10.
239 * **groupedit_image_limit** (Integer) - Number of contacts at which the group editor should switch from display the profile pictures of the contacts to only display the names. Default is 400. This can alternatively be set on a per account basis in the pconfig table.
240 * **hsts** (Boolean) - Enables the sending of HTTP Strict Transport Security headers
241 * **ignore_cache** (Boolean) - For development only. Disables the item cache.
242 * **instances_social_key** - Key to the API of https://instances.social which retrieves data about mastodon servers. See https://instances.social/api/token to get an API key.
243 * **ipv4_resolve** (Boolean) - Resolve IPV4 addresses only. Don't resolve to IPV6. Default value is false.
244 * **invitation_only** (Boolean) -  If set true registration is only possible after a current member of the node has send an invitation. Default is false.
245 * **like_no_comment** (Boolean) - Don't update the "commented" value of an item when it is liked.
246 * **local_block** (Boolean) - Used in conjunction with "block_public".
247 * **local_search** (Boolean) - Blocks search for users who are not logged in to prevent crawlers from blocking your system.
248 * **local_tags** (Boolean) - If activated, all hashtags will point to the local server.
249 * **max_connections** - The maximum number of database connections which can be in use before the worker process is deferred to it's next interval.  When the system can't detect the maximum numbers of connection then this value can be used.
250 * **max_connections_level** - The maximum level of connections that are allowed to let the worker start. It is a percentage value. Default value is 75.
251 * **max_contact_queue** - Default value is 500.
252 * **max_batch_queue** - Default value is 1000.
253 * **max_processes_backend** - Maximum number of concurrent database processes for background tasks. Default value is 5.
254 * **max_processes_frontend** - Maximum number of concurrent database processes for foreground tasks. Default value is 20.
255 * **min_poll_interval** - minimal distance in minutes between two polls for a contact. Default is 1. Reasonable values are between 1 and 59.
256 * **session_handler** (database|cache|native) - Whether to use Cache to store session data or to use PHP native session storage. Default value is `database`.
257 * **cache_driver** (database|memcache|memcached) - Whether to use Memcache or Memcached to store temporary cache. Default value is `database`.
258 * **memcache_host** - Host name of the memcache daemon. Default is '127.0.0.1'.
259 * **memcache_port** - Port number of the memcache daemon. Default is 11211.
260 * **memcached_hosts** - Array of Memcached servers info `[host, port(, weight)]`. Default value is `[['127.0.0.1', 11211]]`.
261 * **no_count** (Boolean) - Don't do count calculations (currently only when showing albums)
262 * **no_oembed** (Boolean) - Don't use OEmbed to fetch more information about a link.
263 * **no_smilies** (Boolean) - Don't show smilies.
264 * **no_view_full_size** (Boolean) - Don't add the link "View full size" under a resized image.
265 * **optimize_items** (Boolean) - Triggers an SQL command to optimize the item table before expiring items.
266 * **ostatus_poll_timeframe** - Defines how old an item can be to try to complete the conversation with it.
267 * **paranoia** (Boolean) - Log out users if their IP address changed.
268 * **permit_crawling** (Boolean) - Restricts the search for not logged in users to one search per minute.
269 * **queue_no_dead_check** (Boolean) - Ignore if the target contact or server seems to be dead during queue delivery.
270 * **worker_debug** (Boolean) - If enabled, it prints out the number of running processes split by priority.
271 * **worker_fetch_limit** - Number of worker tasks that are fetched in a single query. Default is 1.
272 * **profiler** (Boolean) - Enable internal timings to help optimize code. Needed for "rendertime" addon. Default is false.
273 * **free_crawls** - Number of "free" searches when "permit_crawling" is activated (Default value is 10)
274 * **crawl_permit_period** - Period in seconds between allowed searches when the number of free searches is reached and "permit_crawling" is activated (Default value is 60)
275 * **png_quality** - Default value is 8.
276 * **proc_windows** (Boolean) - Should be enabled if Friendica is running under Windows.
277 * **proxy_cache_time** - Time after which the cache is cleared. Default value is one day.
278 * **pushpoll_frequency** -
279 * **qsearch_limit** - Default value is 100.
280 * **remove_multiplicated_lines** (Boolean) - If enabled, multiple linefeeds in items are stripped to a single one.
281 * **sendmail_params** (Boolean) - Normal sendmail command parameters will be added when the PHP mail() function is called for sending e-mails.  This ensures the Sender Email address setting is applied to the message envelope rather than the host's default address.  Default is true.  Set to false if your non-sendmail agent is incompatible, or to restore old behavior of using the host address.
282 * **show_unsupported_addons** (Boolean) - Show all addons including the unsupported ones.
283 * **show_unsupported_themes** (Boolean) - Show all themes including the unsupported ones.
284 * **show_global_community_hint** (Boolean) - When the global community page is enabled, use this option to display a hint above the stream, that this is a collection of all public top-level postings that arrive on your node.
285 * **throttle_limit_day** - Maximum number of posts that a user can send per day with the API.
286 * **throttle_limit_week** - Maximum number of posts that a user can send per week with the API.
287 * **throttle_limit_month** - Maximum number of posts that a user can send per month with the API.
288 * **wall-to-wall_share** (Boolean) - Displays forwarded posts like "wall-to-wall" posts.
289 * **worker_cooldown** - Cooldown time after each worker function call. Default value is 0 seconds.
290 * **worker_load_exponent** (Integer) - Default 3, which allows only 25% of the maximum worker queues when server load reaches around 37% of maximum load.  For a linear response where 25% of worker queues are allowed at 75% of maximum load, set this to 1.  Setting 0 would allow maximum worker queues at all times, which is not recommended.
291 * **xrd_timeout** - Timeout for fetching the XRD links. Default value is 20 seconds.
292
293 ## experimental ##
294
295 * **exp_themes** (Boolean) - Show experimental themes as well.
296
297 ## theme ##
298
299 * **hide_eventlist** (Boolean) - Don't show the birthdays and events on the profile and network page
300
301 # Administrator Options #
302
303 Enabling the admin panel for an account, and thus making the account holder admin of the node, is done by setting the variable
304
305     [config]
306     admin_email = someone@example.com
307
308 Where you have to match the email address used for the account with the one you enter to the config/local.ini.php file.
309 If more then one account should be able to access the admin panel, separate the email addresses with a comma.
310
311     [config]
312     admin_email = someone@example.com,someoneelse@example.com
313
314 If you want to have a more personalized closing line for the notification emails you can set a variable for the admin_name.
315
316     [config]
317     admin_name = Marvin