summaryrefslogtreecommitdiff
path: root/GlobalConfig.md
blob: 5788f182e1f1ea6e93c0c89585e27ee613bd6bef (plain)
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
% Global configuration

Preferred method to adjust tt-rss global configuration options is through the environment, i.e. through `.env` when using Compose setup. 

Alternatively, you can use `config.php` (copied from `config.php-dist`) to adjust the defaults. Use the following syntax (options are declared in `classes/config.php`, prefixed by `TTRSS_`):

```php
putenv('TTRSS_DB_HOST=myserver');
putenv('TTRSS_SELF_URL_PATH=http://example.com/tt-rss');
```

Plugin-required constants also go here, using `define()`:

```php
define('LEGACY_CONSTANT', 'value');
```

## Migrating from old-style config.php

For any `config.php` settings you have changed from the defaults (normally this is the `DB_` group of settings and `SELF_URL_PATH`, replace as follows: 

`define('DB_PORT', 'xxx')` -> `putenv('TTRSS_DB_PORT=xxx')`.

You can safely omit everything else, there's no point in adding setting that were at their default values.

### Note about booleans

To set something to `false` use an empty value, not string literal "false", like so:

**RIGHT:** `putenv('TTRSS_SINGLE_USER_MODE=');` **WRONG:** `putenv('TTRSS_SINGLE_USER_MODE=false');` - this would actually enable it.

[This thread](https://community.tt-rss.org/t/rip-config-php-hello-classes-config-php/4337/30) has relevant discussion and many examples.


## Available options

All options (including their defaults) are listed here:

https://git.tt-rss.org/fox/tt-rss/src/branch/master/classes/config.php#L54