Skip to content
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

Update Nextcloud's MariaDB container safely #1682

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nmfretz
Copy link
Contributor

@nmfretz nmfretz commented Oct 23, 2024

🤖 This is an automated pull request to update nextcloud to version v30.0.1. This PR must be reviewed and tested before merging.

Copy link

🎉   Linting finished with no errors or warnings   🎉

Thank you for your submission! This is an automated linter that checks for common issues in pull requests to the Umbrel App Store.

Please review the linting results below and make any necessary changes to your submission.

Linting Results

Severity File Description
ℹ️ nextcloud/docker-compose.yml Potentially using unsafe user in service "web":
The default container user "root" can lead to security vulnerabilities. If you are using the root user, please try to specify a different user (e.g. "1000:1000") in the compose file or try to set the UID/PUID and GID/PGID environment variables to 1000.
ℹ️ nextcloud/docker-compose.yml Potentially using unsafe user in service "cron":
The default container user "root" can lead to security vulnerabilities. If you are using the root user, please try to specify a different user (e.g. "1000:1000") in the compose file or try to set the UID/PUID and GID/PGID environment variables to 1000.

Legend

Symbol Description
Error: This must be resolved before this PR can be merged.
⚠️ Warning: This is highly encouraged to be resolved, but is not strictly mandatory.
ℹ️ Info: This is just for your information.

@nmfretz
Copy link
Contributor Author

nmfretz commented Oct 23, 2024

🤖 This is an automated summary of installation tests for nextcloud:

  • ✅ App successfully installed in umbrel-dev instance
  • ✅ App successfully listed in umbrel.yaml
  • ✅ App UI successfully returns a 200 status code
  • 📸 Screenshot of the app:
    App Screenshot

This PR must still be reviewed and tested before merging.

@nmfretz
Copy link
Contributor Author

nmfretz commented Oct 24, 2024

TODO: upgrade MariaDB #1547 (comment):

Thanks for noting this @dennysubke! Shall we schedule the mariadb update for Nextcloud 30.0.1 which should be out soon (https://github.com/nextcloud/server/milestone/279)?

We'll need to be careful when updating mariadb and may need to run some mariadb specific migration logic in the pre-start script when we do so (https://mariadb.com/kb/en/mariadb-upgrade/).

@dennysubke
Copy link
Contributor

dennysubke commented Nov 4, 2024

TODO: upgrade MariaDB #1547 (comment):

Thanks for noting this @dennysubke! Shall we schedule the mariadb update for Nextcloud 30.0.1 which should be out soon (https://github.com/nextcloud/server/milestone/279)?

We'll need to be careful when updating mariadb and may need to run some mariadb specific migration logic in the pre-start script when we do so (https://mariadb.com/kb/en/mariadb-upgrade/).

I just wanted to check in and ask if you have any rough estimate on when it might be ready. I know you have a lot on your plate, so no rush - I really appreciate all the hard work you’re putting into this.

Thanks again for your efforts! 👌

@nmfretz
Copy link
Contributor Author

nmfretz commented Nov 6, 2024

Hey @dennysubke, sorry for the delay on this.

I need to carve out some significant time for this single app update. The issue here is that we'll need to test that whatever method we come up with for updating the database will work for users who are updating through multiple major versions (e.g., someone who is still on v28.x needing to get to v30.0.1 via v28.x --> v29.07 --> v30.0.1)

I haven't given it a ton of thought so far, but one thing we need to do when changing the mariadb image is have the app start up with the MARIADB_AUTO_UPGRADE=1 env var in the mariadb service. This tells mariadb to update system tables. The tricky part here is that if a user is upgrading through multiple major versions then we need to make sure the mariadb upgrade process is completed before sending them on to the next major version to avoid weird state issues or database corruption. I'm not sure what the best way to do this is yet. Also, we need to make sure that a user on an older version of nextcloud that might not be compatible with the newer mariadb image doesn't start up with this newer db until the user has made it to a specific version of nextcloud.

cc @sharknoon

@dennysubke
Copy link
Contributor

Hey @dennysubke, sorry for the delay on this.

I need to carve out some significant time for this single app update. The issue here is that we'll need to test that whatever method we come up with for updating the database will work for users who are updating through multiple major versions (e.g., someone who is still on v28.x needing to get to v30.0.1 via v28.x --> v29.07 --> v30.0.1)

I haven't given it a ton of thought so far, but one thing we need to do when changing the mariadb image is have the app start up with the MARIADB_AUTO_UPGRADE=1 env var in the mariadb service. This tells mariadb to update system tables. The tricky part here is that if a user is upgrading through multiple major versions then we need to make sure the mariadb upgrade process is completed before sending them on to the next major version to avoid weird state issues or database corruption. I'm not sure what the best way to do this is yet. Also, we need to make sure that a user on an older version of nextcloud that might not be compatible with the newer mariadb image doesn't start up with this newer db until the user has made it to a specific version of nextcloud.

cc @sharknoon

Thank you for the detailed explanation! This sounds like a well-thought-out approach. Of course, safety comes first! 👍

@nmfretz
Copy link
Contributor Author

nmfretz commented Nov 8, 2024

Also to consider for this update: #1771

@DavidEGx
Copy link

Any news about this? Now v30.0.4 is out.

Both v30.0.2 and v30.0.3 releases contain security fixes.

@dennysubke
Copy link
Contributor

@nmfretz 👋🏻

@nmfretz nmfretz changed the title Update nextcloud to version v30.0.1 Update Nextcloud's MariaDB container safely Jan 2, 2025
@nmfretz nmfretz marked this pull request as draft January 2, 2025 02:37
@nmfretz
Copy link
Contributor Author

nmfretz commented Jan 2, 2025

Thanks for the ping @dennysubke. In order to not delay Nextcloud updates I have updated to 30.0.4 in #1997, and have renamed this PR to focus only on the database update.

@dennysubke
Copy link
Contributor

Thank you for your great work! 🙏🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants