Configure an array with environment variable?

Hello,
I would like to know if it’s possible to configure an array with environment variable.

I use the feature Override config.php values through environment variables to create and configure my Nextcloud.

So I can configure a lot of variable like with environment variable with NC_ prefix, like this NC_force_language=fr. But I would like to know if it’s possible with an array. What syntax should I use?

I find this code server/lib/private/Config.php at master · nextcloud/server · GitHub

But I don’t know if it possible?

I would like configure by example : oidc_login_attributes

No, which is part of the reason that NC_ approach isn’t documented - it’s not well liked by many of the devs.

You can set all the parameters via occ commands however. This enables scripting or setting via the hooks supported by the official Docker images.

However, using environment variables to configure an application is one of the core principles of the Twelve Factor App. Why are “many of the devs” so reluctant to adopt and follow them? It looks like this has been an industry standard for over a decade now.

2 Likes

We still not able to set configurations through environment variables?

I’m trying to configure the trusted proxies using the NC_ approach, and I’m getting the message:

Your "trusted_proxies" setting is not correctly set, it should be an array.

I’m trying to configure via variables like this:
NC_trusted_proxies=['localhost', 'caddy']

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.