Page 1 of 1

How to make persistant changes to nextcloud config.php

Posted: Wed Feb 20, 2019 11:14 am
by moretocome
Like the title says, how can I make changes to the Nextcloud

Code: Select all

config.php
that persists after running

Code: Select all

sudo ubos-admin update
?

Thanks in advance :)

Re: How to make persistant changes to nextcloud config.php

Posted: Fri Mar 01, 2019 4:28 am
by j12t
What change would you like to make?

Re: How to make persistant changes to nextcloud config.php

Posted: Fri Sep 20, 2019 1:33 pm
by moretocome
Well for instance I need to edit config.php to configure the Auto Mail Accounts app.

Re: How to make persistant changes to nextcloud config.php

Posted: Fri Sep 20, 2019 5:32 pm
by j12t
The UBOS way of doing things is generally not to edit config files. We are trying to make it so that the user should not even have to know that there are config files. This has many advantages, including that site maintenance over the long term (including backup, restore, host migration etc) doesn't accumulate a lot of cruft.

The right way for us to support what you want to do is to add some customizationpoints to the nextcloud-auto-mail-accounts accessory (to use UBOS terminology), which then are used to automate editing whatever config files need editing. We do this, for example, for the Nextcloud/Redis integration. Here are the relevant files: https://github.com/uboslinux/ubos-nextc ... ache-redis

We don't do that yet for auto-mail-accounts -- for one, I'm not aware that it has many users and nobody so far has asked for that. If you think this is important, could you please log an issue here: https://github.com/uboslinux/ubos-nextcloud/issues/new . You are also welcome, of course, to clone the repo, and make the changes yourself. Pull requests appreciated :-)

Re: How to make persistant changes to nextcloud config.php

Posted: Sat Sep 21, 2019 7:04 am
by moretocome
Well I am the one who requested the "Auto Mail Accounts" in the UBOS repo, and I think this is a good example of why an option to override "The UBOS way of doing things" should exist for users who knows, what they are doing.

I understand your point with easy upgrades but it is also crippling to functionality.

The customization points I need are related to my hosts SMTP server and not relevant to anyone else, so the settings has be user configured and can not be automated.

Actually I even have to re-enter my "Email server" configuration in Nextcloud's "Basic settings" section after each UBOS update and those settings are also stored in config.php, so I think the decision to overwrite customizations to config.php is not right.

I think an option (perhaps accompanied by a warning) should exists to edit at least this but preferably any configuration file within the UBOS eco system. This will make UBOS feel more like a valued offer and not a limitation.

Re: How to make persistant changes to nextcloud config.php

Posted: Sat Sep 21, 2019 10:11 pm
by j12t
You might be misunderstanding what UBOS calls customizationpoints: these are values that are specific to your particular instance of an application (an AppConfiguration in UBOS parlance). If we were to add such customizationpoint(s) to the manifest of the auto mail accounts, you would get to specify your specific values for your particular Nextcloud (or whatever) instance, and UBOS would continue to maintain them, across upgrades. backups, restores etc.

As a simple example from a different app: the customizationpoint called "target" for the UBOS app "redirect". When you deploy "redirect" at a particular URL, you get to specify the particular destination you want the visitor to be redirected to. You could, for example, deploy 3 instances of app "redirect" at example.com/one, example.com/two and example.com/three, and they could redirect the user into entirely different directions: each has the same customizationpoint, but with a different value.

I think this would address your requirement.

There is always a tradeoff between automation and flexibility. In the UBOS world, if you want the automation of "ubos-admin update", you can't have the flexilibity of manually editing (most) config files. However, you (or us, or anybody) does have the flexibility to add customizationpoints to apps or accessories that address this requirement the UBOS way.

I'd like to know more about the requirement of specifying a non-default mail server. Maybe a different thread?