-
Notifications
You must be signed in to change notification settings - Fork 82
Documented ibexa/cloud package #2985
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 5.0
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,116 @@ | ||
| --- | ||
|
Check warning on line 1 in docs/ibexa_cloud/environment_variables.md
|
||
| description: Environment variables automatically generated based on Ibexa Cloud relationships and routes. | ||
|
Check failure on line 2 in docs/ibexa_cloud/environment_variables.md
|
||
| --- | ||
|
|
||
| # Environment variables on Ibexa Cloud | ||
|
|
||
| [[= product_name_cloud =]] automatically generates environment variables based on the Platform.sh relationships and routes configuration. | ||
| It parses `PLATFORM_RELATIONSHIPS` and `PLATFORM_ROUTES` environment variables and exposes them as application-specific variables. | ||
|
|
||
| Environment variable prefixes are created by converting relationship names to uppercase and replacing hyphens with underscores. | ||
| When multiple endpoints are defined for a single relationship, numerical indices are used, for example: `SOLR_1_`, `SOLR_2`. | ||
|
|
||
| ## Relationship naming conventions | ||
|
|
||
| Use the following relationship names in `.platform.app.yaml`: | ||
|
|
||
| - `database` - main application database | ||
| - `dfs_database` - DFS database (required name for DFS functionality) | ||
| - `rediscache` - Redis for cache | ||
| - `redissession` - Redis for sessions (recommended name for dedicated session storage) | ||
| - `elasticsearch` - Elasticsearch search service | ||
| - `solr` - Solr search service | ||
|
|
||
| ## Database variables | ||
|
|
||
| For MySQL and PostgreSQL databases, the following variables are generated based on the relationship name (e.g., `database`): | ||
|
|
||
| - `{RELATIONSHIP_NAME}_URL` - full database URL with charset and server version | ||
| - `{RELATIONSHIP_NAME}_USER` / `{RELATIONSHIP_NAME}_USERNAME` - database user | ||
| - `{RELATIONSHIP_NAME}_PASSWORD` - database password | ||
| - `{RELATIONSHIP_NAME}_HOST` - database host | ||
| - `{RELATIONSHIP_NAME}_PORT` - database port | ||
| - `{RELATIONSHIP_NAME}_NAME` / `{RELATIONSHIP_NAME}_DATABASE` - database name | ||
| - `{RELATIONSHIP_NAME}_DRIVER` - database driver | ||
| - `{RELATIONSHIP_NAME}_SERVER` - database server | ||
|
|
||
| For example, for a relationship called `database` the environment variables are named `DATABASE_URL`, `DATABASE_HOST`, `DATABASE_USER`, etc. | ||
|
|
||
| For more information about database configuration, see [Databases](databases.md). | ||
|
|
||
| ## DFS database variables | ||
|
|
||
| When using [distributed file storage (DFS) using a separate database](clustering.md#dfs-io-handler), you must use the relationship name `dfs_database`. | ||
| In addition to the database variables listed above, additional DFS-specific variables are created when `PLATFORMSH_DFS_NFS_PATH` is set: | ||
|
|
||
| - `DFS_NFS_PATH` - NFS path for DFS storage | ||
| - `DFS_DATABASE_CHARSET` - database character set | ||
| - `DFS_DATABASE_COLLATION` - database collation | ||
|
|
||
| ## Cache variables | ||
|
|
||
| For Redis and Memcached cache services, the following variables are available. | ||
|
|
||
| - `{RELATIONSHIP_NAME}_URL` (Redis only) | ||
| - `{RELATIONSHIP_NAME}_HOST` | ||
| - `{RELATIONSHIP_NAME}_PORT` | ||
| - `{RELATIONSHIP_NAME}_SCHEME` (Redis only) | ||
|
|
||
| In addition, the following global variables are defined: | ||
|
|
||
| - `CACHE_POOL` - either `cache.redis` or `cache.memcached` | ||
| - `CACHE_DSN` - cache connection string | ||
|
|
||
| !!! note | ||
| Redis services have higher priority than Memcached services when building the global cache variables. | ||
|
|
||
| For more information about persistence cache configuration, see [Persistence cache](persistence_cache.md). | ||
|
|
||
| ## Session variables | ||
|
|
||
| For Redis-based session storage, the following variables are available. | ||
|
|
||
| - `SESSION_HANDLER_ID` - session handler class name | ||
| - `SESSION_SAVE_PATH` - Redis connection in `host:port` format | ||
|
|
||
| The system looks for a relationship named `redissession` first. If not found, it uses the first available Redis service. | ||
|
|
||
| For more information about session configuration, see [Sessions](sessions.md). | ||
|
|
||
| ## Search engine variables | ||
|
|
||
| ### Solr | ||
|
|
||
| For Solr search engine configuration, the following variables are generated: | ||
|
|
||
| - `SEARCH_ENGINE` - set to `solr` | ||
| - `SOLR_DSN` - Solr connection string | ||
| - `SOLR_CORE` - Solr core name | ||
| - `{RELATIONSHIP_NAME}_HOST` | ||
| - `{RELATIONSHIP_NAME}_PORT` | ||
| - `{RELATIONSHIP_NAME}_NAME` / `{RELATIONSHIP_NAME}_DATABASE` | ||
|
|
||
| For more information, see [Solr search engine](solr_overview.md). | ||
|
|
||
| ### Elasticsearch | ||
|
|
||
| For Elasticsearch search engine configuration, the following variables are generated: | ||
|
|
||
| - `SEARCH_ENGINE` - set to `elasticsearch` | ||
| - `ELASTICSEARCH_DSN` - Elasticsearch connection string | ||
| - `{RELATIONSHIP_NAME}_URL` | ||
| - `{RELATIONSHIP_NAME}_HOST` | ||
| - `{RELATIONSHIP_NAME}_PORT` | ||
| - `{RELATIONSHIP_NAME}_SCHEME` | ||
|
|
||
| For more information, see [Elasticsearch](elasticsearch_overview.md). | ||
|
|
||
| ## HTTP cache variables (Varnish) | ||
|
|
||
| For Varnish-based HTTP caching, the following variables are available. | ||
|
|
||
| - `HTTPCACHE_PURGE_TYPE` - set to `varnish` | ||
| - `HTTPCACHE_PURGE_SERVER` - Varnish server address | ||
| - `HTTPCACHE_VARNISH_INVALIDATE_TOKEN` - token for cache invalidation | ||
|
|
||
| For more information about HTTP cache and Varnish configuration, see [HTTP cache](http_cache.md). | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -156,7 +156,7 @@ Out of the box in `config/packages/cache_pool/cache.redis.yaml` you can find a d | |
|
|
||
| !!! note "[[= product_name_cloud =]]" | ||
|
|
||
| For [[= product_name_cloud =]]/Platform.sh: This is automatically configured in `vendor/ibexa/core/src/bundle/Core/DependencyInjection/IbexaCoreExtension.php` if you have enabled Redis as `rediscache` Platform.sh service. | ||
| For [[= product_name_cloud =]]/Platform.sh, it's configured based on the `.platform.app.yaml` file by the [`ibexa/cloud` package](install_on_ibexa_cloud.md). | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we migrate naming to "Upsun"? |
||
|
|
||
| For anything else, you can enable it with environment variables. | ||
| For instance, if you set the following environment variables `export CACHE_POOL="cache.redis" CACHE_DSN="[email protected]:1234/13"`, it results in config like this: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -183,8 +183,8 @@ Out of the box in [[= product_name =]] the following is enabled for a setup: | |
| ibexa_solr: | ||
| endpoints: | ||
| endpoint0: | ||
| dsn: '%solr_dsn%' | ||
| core: '%solr_core%' | ||
| dsn: '%env(string:SOLR_DSN)%' | ||
| core: '%env(string:SOLR_CORE)%' | ||
| connections: | ||
| default: | ||
| entry_endpoints: | ||
|
|
@@ -202,10 +202,10 @@ The installation contains several similar languages, and one different language | |
| ibexa_solr: | ||
| endpoints: | ||
| endpoint0: | ||
| dsn: '%solr_dsn%' | ||
| dsn: '%env(string:SOLR_DSN)%' | ||
| core: core0 | ||
| endpoint1: | ||
| dsn: '%solr_dsn%' | ||
| dsn: '%env(string:SOLR_DSN)%' | ||
| core: core1 | ||
| connections: | ||
| default: | ||
|
|
@@ -232,25 +232,25 @@ ibexa_solr: | |
| version: '9.8.1' # Required only if using Solr 9 | ||
| endpoints: | ||
| endpoint0: | ||
| dsn: '%solr_dsn%' | ||
| dsn: '%env(string:SOLR_DSN)%' | ||
| core: core0 | ||
| endpoint1: | ||
| dsn: '%solr_dsn%' | ||
| dsn: '%env(string:SOLR_DSN)%' | ||
| core: core1 | ||
| endpoint2: | ||
| dsn: '%solr_dsn%' | ||
| dsn: '%env(string:SOLR_DSN)%' | ||
| core: core2 | ||
| endpoint3: | ||
| dsn: '%solr_dsn%' | ||
| dsn: '%env(string:SOLR_DSN)%' | ||
| core: core3 | ||
| endpoint4: | ||
| dsn: '%solr_dsn%' | ||
| dsn: '%env(string:SOLR_DSN)%' | ||
| core: core4 | ||
| endpoint5: | ||
| dsn: '%solr_dsn%' | ||
| dsn: '%env(string:SOLR_DSN)%' | ||
| core: core5 | ||
| endpoint6: | ||
| dsn: '%solr_dsn%' | ||
| dsn: '%env(string:SOLR_DSN)%' | ||
| core: core6 | ||
| connections: | ||
| default: | ||
|
|
@@ -286,14 +286,14 @@ The example is based on multi-core setup so any specific language analysis optio | |
| ibexa_solr: | ||
| endpoints: | ||
| main: | ||
| dsn: '%solr_dsn%' | ||
| core: '%solr_main_core%' | ||
| dsn: '%env(string:SOLR_DSN)%' | ||
| core: '%env(string:SOLR_MAIN_CORE)%' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think |
||
| en: | ||
| dsn: '%solr_dsn%' | ||
| core: '%solr_en_core%' | ||
| dsn: '%env(string:SOLR_DSN)%' | ||
| core: '%env(string:SOLR_EN_CORE)%' | ||
| fr: | ||
| dsn: '%solr_dsn%' | ||
| core: '%solr_fr_core%' | ||
| dsn: '%env(string:SOLR_DSN)%' | ||
| core: '%env(string:SOLR_FR_CORE)%' | ||
| # ... | ||
| connections: | ||
| default: | ||
|
|
@@ -325,7 +325,7 @@ In the example below we configured Solr Bundle to work with secured Solr core. | |
| ibexa_solr: | ||
| endpoints: | ||
| endpoint0: | ||
| dsn: '%solr_dsn%' | ||
| dsn: '%env(string:SOLR_DSN)%' | ||
| core: core0 | ||
| user: example | ||
| pass: password | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if the strict naming requirement makes sense now - Redis, Elasticsearch, Solr and databases don't have to be named in any specific way. The only required ones are
dfs_databaseandredissession.Developers can have multirepo setup with many services, and environmental variables are exposed accordingly. So maybe we shouldn't enforce the setup with word "use" - wdyt?