I realized that updating .env.production for glitch-soc doesn’t persist after an upgrade. Is there a way to make ENV changes permanent?
My YunoHost server
Hardware: VPS bought online YunoHost version: 11.0.7 I have access to my server : Through SSH | through the webadmin Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no
Do you mean the upgrade script does remove/overwrite it ?
Then you might have a look at Pixelfed upgrade script, I believe it is able to preserve the .env config file now.
ping @yalh76 that might give you some input about that.
I haven’t verified/recreated this issue, but from what I remember, here’s what happened: I updated the file .env.production - adding the setting for SINGLE_USER_MODE and this worked - and then some time later, glitch-soc had an update, so I updated it via the admin, and then the setting I added was no longer there (I think the file gets overwritten).
Thanks everyone for trying to help, I appreciate it!
I faced similar issue with joomla package. Updating gets the settings file reset to default.
So I added two steps to the update script : backup the settings file to a temporary folder before the update, restore the settings file after the update.
You can check the update script of your app and try to make the same I did in the update script of joomla.
Here is the PR :
@jarod5001 This overwritten or not behaviour is a difficult question and it depends of the apps.
In several cases, it could be dangereous to not upgrade the file. So the apps don’t do exactly the same things related to that topic. Some of them replace the file only if it hasn’t been modified. Other display a warning explaining the file has been replaced.
My opinion is no one of these solutions is good, the good way should be to detect what has been changed and to reapply the settings. We could extend a bit the config panel mechanism to allow that, but it won’t cover all the settings only the most important.
An other solutions could be to use a 3 ways merge mechanism, but it could broke completely.
Yes. It’s complicated. In my case, the joomla config file didn’t change since the first 4.0 release.
The best way is to have the script check for changes between every version update and add the new lines to the config file. I didn’t have time to search for a good way to achieve it.
May be a helper in this case would transform the process.
Another solution : backup the file in its folder (ex: create a copy configfile.bak) and overwrite it. Then the user is free to restore the backup or some of its components.
But it requires command line access and skills.