-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
/var/www/data is now a volume #296
Conversation
Co-authored-by: @m33m33
34b05c9
to
8166500
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good in the absolute, but what happens for people who were running the Docker image and upgrade it? Won't they be losing access to the filesystem content which reference is now different?
Isn't the file storage setting been set in the database after creation? |
After a fresh install on 2024.12 the storage is Database. The admin have to change it manually and choose a www-data writable path |
Pulling an updated app image will not change:
To my understanding of docker layered approach of filesystem in containers and volumes a friendica app container upgrade or rm will delete data. This is already a risk -probably underestimated- whatever we decide here. Maybe it is an invitation to be explicit about it in the next update release notes and/or warning on the admins forum. |
It is as I remembered and @m33m33 described. The database is the default storage. When the user changes this to file system the setting is saved to the database which has priority over the config file. So existing instances shall not face any issue with the chnage. |
Pulling a new image version for a container will replace its image volume and all layers put ontop. |
The change by itself is safe. As @MrPetovan asked about possible side effects I think it would be fair to point in release notes that an instance with Filesystem backend storage pointing inside the app image will result in data loss during upgrade, rm, rebuild. And that risk is avoided from now on with new safer settings (dedicated volume) on new deployments. |
I don't see the data loss. The change is only for new instances. No need for documentation. Until now the default has been /var/www/html/storage which is inside the html volume. And that's a bad idea as pointed out on the setting's page. With the change for new instances the file storage will default to /var/www/data in its own volume. |
When you look at https://docs.friendi.ca/develop/admin/settings/?h=filesystem#file-storage-backend you are instructed to use a directory outside web server tree. In the app image there is a /var/www/data directory patiently waiting for someone to use that as the Filestorage target directory. It I am not mistaken, /var/www/data is inside the app image, not the html volume, right ? I remember a chat about it I will look at matrix logs later: Others may have found /var/www/data very handy and pointed the target there. |
I see what could go wrong in the scenario and that was the reason why I propose this change to move /var/www/data into its own volume. But /var/www/data is not the default for the setting. /var/www/html/storage is the derfault shown in the settings page. So, if anyone chose /var/www/data before (and did not mount that directory) he will for sure already faced data loss. Saving data into the web app directory is a bad idea. So this PR changes this by providing a separate volume and the related default. No existing instance will face any issue and will work as before with its settings. |
That's fine by me, merging this PR is a good thing anyway. |
Fixes: #290
/var/www/data is now a dedicated volume by default. This prevents writes to the container's image volume.
Co-authored-by: @m33m33