summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2023-10-30 09:04:01 +0000
committerAndrew Dolgov <[email protected]>2023-10-30 09:04:01 +0000
commitd8287dc3901acc3ac03aac3f85e309030144f242 (patch)
treeb8c7e6f748e7e7228ead587f74ac379ee1d2d698
parent2b50b4fdba3d9849882dc680d7308b96db0a3e63 (diff)
Update GlobalConfig
-rw-r--r--GlobalConfig.md160
1 files changed, 80 insertions, 80 deletions
diff --git a/GlobalConfig.md b/GlobalConfig.md
index 2e9516d..a3de8ec 100644
--- a/GlobalConfig.md
+++ b/GlobalConfig.md
@@ -1,80 +1,80 @@
-% Global configuration
-
-All settings (see `_DEFAULTS[]` for default values) are listed here:
-
-- https://srv.tt-rss.org/ttrss-docs/classes/Config.html (auto-generated class documentation)
-- https://git.tt-rss.org/fox/tt-rss.git/tree/classes/config.php (source code, including default values)
-
----------------
-
-It is preferred to adjust tt-rss global configuration through the environment, i.e. defined in `.env` when using docker-compose setup:
-
-```ini
-# Copy this file to .env before building the container.
-# Put any local modifications here.
-
-TTRSS_SELF_URL_PATH=http://127.0.0.1/tt-rss
-```
-
-Alternatively, you can **create** `config.php` in tt-rss root directory (copied from `config.php-dist`), using the following syntax:
-
-```php
-putenv('TTRSS_DB_HOST=myserver');
-putenv('TTRSS_SELF_URL_PATH=http://example.com/tt-rss');
-putenv('TTRSS_SESSION_COOKIE_LIFETIME='.(86400*30));
-```
-
-- Note lack of quotes around values.
-- Options should be always prefixed by `TTRSS_`.
-- Don't modify `classes/config.php`.
-- You don't need to put everything to `config.php`, only the options which you've changed from the defaults.
-
-Legacy plugin-required constants also go to `config.php`, using `define()`:
-
-```php
-define('LEGACY_CONSTANT', 'value');
-```
-
-To set computed values via `putenv()` you have to get them evaluated by PHP, this would work:
-
-```php
-putenv('TTRSS_SESSION_COOKIE_LIFETIME='.(86400*30));
-```
-
-However, these won't give you expected results:
-
-```php
-putenv("TTRSS_SESSION_COOKIE_LIFETIME='2592000'");
-# => 0, because '2592000' is an invalid number
-
-putenv('TTRSS_SESSION_COOKIE_LIFETIME=86400*30');
-# => 86400, right side expression is not evaluated, instead you're casting string literal "86400*30" to integer
-```
-
-Note that all values should be precomputed when setting via `.env` because they are not evaluated by PHP and used as-is.
-
-## Minimal config.php for a non-Docker setup
-
-Should have at least these options defined:
-
-```php
-<?php
-
-putenv('TTRSS_DB_TYPE=pgsql'); # or mysql
-putenv('TTRSS_DB_HOST=mydbhost');
-putenv('TTRSS_DB_USER=mydbuser');
-putenv('TTRSS_DB_PASS=mydbpass');
-putenv('TTRSS_DB_PORT=5432'); # or 3306
-putenv('TTRSS_SELF_URL_PATH=http://example.com/tt-rss/'); # fully-qualified URL of your tt-rss install
-putenv('TTRSS_PHP_EXECUTABLE=/path/to/php-cli-binary'); # normally something like /usr/bin/php
-```
-
-## 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, using the rules above:
-
-`define('DB_PORT', 'xxx')` &rarr; `putenv('TTRSS_DB_PORT=xxx')`.
-
-You can safely omit any settings that were at default values.
-
-[This thread](https://community.tt-rss.org/t/rip-config-php-hello-classes-config-php/4337/30) has relevant discussion and many examples.
+% Global configuration
+
+All settings (see `_DEFAULTS[]` for default values) are listed here:
+
+- https://srv.tt-rss.org/ttrss-docs/classes/Config.html (auto-generated class documentation)
+- https://git.tt-rss.org/fox/tt-rss.git/tree/classes/Config.php (source code, including default values)
+
+---------------
+
+It is preferred to adjust tt-rss global configuration through the environment, i.e. defined in `.env` when using docker-compose setup:
+
+```ini
+# Copy this file to .env before building the container.
+# Put any local modifications here.
+
+TTRSS_SELF_URL_PATH=http://127.0.0.1/tt-rss
+```
+
+Alternatively, you can **create** `config.php` in tt-rss root directory (copied from `config.php-dist`), using the following syntax:
+
+```php
+putenv('TTRSS_DB_HOST=myserver');
+putenv('TTRSS_SELF_URL_PATH=http://example.com/tt-rss');
+putenv('TTRSS_SESSION_COOKIE_LIFETIME='.(86400*30));
+```
+
+- Note lack of quotes around values.
+- Options should be always prefixed by `TTRSS_`.
+- Don't modify `classes/config.php`.
+- You don't need to put everything to `config.php`, only the options which you've changed from the defaults.
+
+Legacy plugin-required constants also go to `config.php`, using `define()`:
+
+```php
+define('LEGACY_CONSTANT', 'value');
+```
+
+To set computed values via `putenv()` you have to get them evaluated by PHP, this would work:
+
+```php
+putenv('TTRSS_SESSION_COOKIE_LIFETIME='.(86400*30));
+```
+
+However, these won't give you expected results:
+
+```php
+putenv("TTRSS_SESSION_COOKIE_LIFETIME='2592000'");
+# => 0, because '2592000' is an invalid number
+
+putenv('TTRSS_SESSION_COOKIE_LIFETIME=86400*30');
+# => 86400, right side expression is not evaluated, instead you're casting string literal "86400*30" to integer
+```
+
+Note that all values should be precomputed when setting via `.env` because they are not evaluated by PHP and used as-is.
+
+## Minimal config.php for a non-Docker setup
+
+Should have at least these options defined:
+
+```php
+<?php
+
+putenv('TTRSS_DB_TYPE=pgsql'); # or mysql
+putenv('TTRSS_DB_HOST=mydbhost');
+putenv('TTRSS_DB_USER=mydbuser');
+putenv('TTRSS_DB_PASS=mydbpass');
+putenv('TTRSS_DB_PORT=5432'); # or 3306
+putenv('TTRSS_SELF_URL_PATH=http://example.com/tt-rss/'); # fully-qualified URL of your tt-rss install
+putenv('TTRSS_PHP_EXECUTABLE=/path/to/php-cli-binary'); # normally something like /usr/bin/php
+```
+
+## 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, using the rules above:
+
+`define('DB_PORT', 'xxx')` &rarr; `putenv('TTRSS_DB_PORT=xxx')`.
+
+You can safely omit any settings that were at default values.
+
+[This thread](https://community.tt-rss.org/t/rip-config-php-hello-classes-config-php/4337/30) has relevant discussion and many examples.