How to make persistant changes to nextcloud config.php

Questions and discussions about Indie Computing's UBOSbox
Post Reply
moretocome
Posts: 5
Joined: Wed Feb 20, 2019 9:08 am

How to make persistant changes to nextcloud config.php

Post by moretocome » Wed Feb 20, 2019 11:14 am

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 :)



j12t
Posts: 116
Joined: Tue Dec 12, 2017 9:17 pm
Contact:

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

Post by j12t » Fri Mar 01, 2019 4:28 am

What change would you like to make?

moretocome
Posts: 5
Joined: Wed Feb 20, 2019 9:08 am

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

Post by moretocome » Fri Sep 20, 2019 1:33 pm

Well for instance I need to edit config.php to configure the Auto Mail Accounts app.

j12t
Posts: 116
Joined: Tue Dec 12, 2017 9:17 pm
Contact:

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

Post by j12t » Fri Sep 20, 2019 5:32 pm

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 :-)

moretocome
Posts: 5
Joined: Wed Feb 20, 2019 9:08 am

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

Post by moretocome » Sat Sep 21, 2019 7:04 am

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.

j12t
Posts: 116
Joined: Tue Dec 12, 2017 9:17 pm
Contact:

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

Post by j12t » Sat Sep 21, 2019 10:11 pm

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?

Post Reply