V8-archive: Underscore in config keys prevents ENV var usage

Created on 15 May 2020  路  3Comments  路  Source: directus/v8-archive

Underscore '_' in config keys makes impossible to set some config via env vars.

For example: ['cache']['response_ttl'] cannot be set using DIRECTUS_CACHE_RESPONSE_TTL.

Context::from_map($_ENV) should be adjusted or no underscores have to be allowed in config keys.

bug

Most helpful comment

I'm pretty sure you mentioned this before. Did we ever come to a solution on that?

Right now, we strip the underscore out of keys and keep it just to separate between groups (like cache -> response_ttl).

The correct keys are documented on https://docs.directus.io/docker/environment.html#cache though

It's the workaround we have for now. We haven't implemented this on api-next just yet since we need to account for multi tenancy, and this is landing only between beta and rc, not alpha.

All 3 comments

@WoLfulus I'm pretty sure you mentioned this before. Did we ever come to a solution on that?

no underscores have to be allowed in config keys.

This is not something we can just change like that without it being a breaking change (lets account for it in api-next @WoLfulus )

I'm pretty sure you mentioned this before. Did we ever come to a solution on that?

Right now, we strip the underscore out of keys and keep it just to separate between groups (like cache -> response_ttl).

The correct keys are documented on https://docs.directus.io/docker/environment.html#cache though

It's the workaround we have for now. We haven't implemented this on api-next just yet since we need to account for multi tenancy, and this is landing only between beta and rc, not alpha.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

HashemKhalifa picture HashemKhalifa  路  3Comments

Nitwel picture Nitwel  路  3Comments

Varulv1997 picture Varulv1997  路  3Comments

gitlabisbetterthangithub picture gitlabisbetterthangithub  路  3Comments

vuhrmeister picture vuhrmeister  路  3Comments