documentation icon indicating copy to clipboard operation
documentation copied to clipboard

📝 Include instructions on how to configure the server with Env Variables

Open LeoColman opened this issue 2 years ago • 7 comments

This commit adds to the docs instructions on how to configure a Nextcloud instance to use Environment configuration when values aren't present in config.php.

This should close https://github.com/nextcloud/docker/issues/1544 and https://github.com/nextcloud/docker/issues/1465 It should also render https://github.com/nextcloud/docker/pull/1795 unnecessary.

Signed-off-by: Leonardo Colman [email protected]

LeoColman avatar Aug 23 '22 18:08 LeoColman

Please also document how this works with dicts and lists.

PrivatePuffin avatar Aug 26 '22 13:08 PrivatePuffin

Hi @Ornias1993 !

Absolutely! Although I don't really know how it works with dicts and lists. Could you give me an example?

LeoColman avatar Aug 26 '22 13:08 LeoColman

Hi @Ornias1993 !

Absolutely! Although I don't really know how it works with dicts and lists. Could you give me an example?

No idea.

PrivatePuffin avatar Aug 26 '22 13:08 PrivatePuffin

I'll do some exploring :D

LeoColman avatar Aug 26 '22 13:08 LeoColman

What would be the correct way to configure these variables using the environment?

LeoColman avatar Sep 06 '22 19:09 LeoColman

What would be the correct way to configure these variables using the environment?

I'm afraid we don't have something else :see_no_evil: NC_ works for some configuration options in config.php.

Some examples:

It does not work for trusted_domains or objectstore (because it's an array)

It does not work for 'sharing.enable_share_accept' (because an boolean is expected but the variable from env is always a string and 'false' is true.

It may work for sharing.mail_link_password_expiration_interval (but the . seems not to work everywhere: https://stackoverflow.com/questions/2821043/allowed-characters-in-linux-environment-variable-names)

I'm okay with updating the documentation but then usually people start using a feature and some people might be confused when this way does not work for everything. A library like https://github.com/symfony/dotenv may help us to cover most of the cases. Let's see what Vincent and Carl think about your PR.

kesselb avatar Sep 06 '22 20:09 kesselb

I agree with you:

A library like symfony/dotenv may help us to cover most of the cases.

Having proper implementation is better, even better if we delegate it to somewhere else xD

LeoColman avatar Sep 06 '22 21:09 LeoColman