-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
ownCloud: Revision for v10.15.0 #6280
Conversation
1ffc9f1
to
d288ade
Compare
During testing of new installations, an intermittent error was observed in the install log:
Based on a previously reported issue (owncloud/core#27219), it was suspected that the database password policy might be causing the problem. This was confirmed by the following entry in the MariaDB error log:
The issue was traced to a flaw in the upstream random password generation logic. The code in SecureRandom.php generates passwords by randomly selecting characters from a predefined set:
Since the character set does not guarantee the inclusion of each character type (uppercase, lowercase, digits, symbols), the generated password may not always meet the policy requirements, especially given the limited number of symbol options. This pull request addresses the issue by retrying the installation process if the password generation fails, repeating the process until a compliant password is produced. |
just curious: doesn't It is very bad to have an endless loop. You should at least limit the number of loops and terminate with an error if it doesn't succeed within e.g. 5 rounds... But if it takes the password defined in the install wizard, the loop does not make any sense. You shold validate the password in |
ok didn't see your explanations while writing the comment above, So it looks like OwnCloud does not use the password given by So I propose to patch the oc sources
|
@hgy59, with MySQL, the database user is automatically created with a randomly generated password, and there isn't an option to specify one manually. The integrity check function in ownCloud's PHP code will likely flag any modified code during setup as a mismatch with the source repository, potentially marking it as corrupted. Therefore, applying a patch may not be a viable solution. For now, I believe this workaround adequately addresses the intermittent installation issue until I can persuade the upstream repository to improve their random string generator. |
So I propose to report an error to owncloud that the db password given for installation is not used... |
The error occurs during the installation script, resulting in a broken ownCloud instance. If the 5 retry attempts fail, the user’s only option is to uninstall and try again. Although reaching the 5 retry limit is unlikely, I've included it as recommended. Please let me know if I've misunderstood your suggestion. |
ok, my missundertanding, I meant
Please let me know, if I am wrong... So owncloud installer should either:
Any password generated by the OC installer may not meet the password complexity enforced by a MySQL installation. I am only I db user and not a professional, but I suppose in a managed db environment the db-user (and related schemes) is predefined by an administrator and the db-root password must not be known by an application installer. So the oc installer seems very limitted. BTW didn't find any documentation of available exec_occ arguments... |
Found some more information https://doc.owncloud.com/server/next/admin_manual/configuration/database/linux_database_configuration.html#mysql-mariadb the configuration is documented as: <?php
"dbtype" => "mysql",
"dbname" => "owncloud",
"dbuser" => "username",
"dbpassword" => "password",
"dbhost" => "localhost",
"dbtableprefix" => "oc_", If we define the configuration like above, it shouldn't be an issue anymore. |
@hgy59, the above is correct.
Before upgrading to ownCloud v10, the setup involved manually creating the database and using an autoconfig file for the initial configuration. However, this method proved unreliable during my initial testing, and the developers are already in the process of deprecating it (see owncloud/core#31073), which means it won't be supported long-term. The preferred approach is to use the |
@mreid-tt thanks for the feedback I started to install ownclound with the version of this branch.
The install with "restore" from database did not work.
The installer fails with: |
OK, my fault BTW I hate this "emptyText" value in wizard fields, because when you start typing it disapears and you can't copy the value and reuse it. |
@hgy59, thanks for assisting with testing.
This is deliberate and all settings are removed by default. Leaving settings is not really possible since the
You simply don't enter a backup path and a backup won't be taken.
This is not an option I presented to users. Having a DB without a matching
This would only occur if the spksrc/spk/owncloud/src/service-setup.sh Lines 185 to 188 in 6bd0be3
As you can see, it's nothing fancy. |
In the given issue someone removed autoconfig to use prefilled |
That would require us having to create the database, its permissions and the database user. I don't like that approach as there are too many things that can change over time with future versions. |
I ment the further checks for file prefix and version... The value for the backup file must be a path with a filename of the expected prefix and version And you can add a check for file extension |
And for security reason I do not like to give occ the mysql root password. |
No, not creating the database, only creating the db-user with the permissions to create the database (IMHO). |
@hgy59, one of the main goals behind my work in the original PR was to ensure a setup free of security and configuration warnings in the Settings -> General screen. Achieving this clean state requires several configurations:
While the first four can be handled via configuration files, setting up cron jobs requires a fully configured ownCloud instance. This can't be achieved if the user has to complete additional setup steps after the installation wizard. I also prefer having a finalized setup immediately after the wizard, without requiring further configuration. In my experience, additional setup steps often introduce potential points of failure with limited options for troubleshooting. Regarding the root password, I'm not sure what challenges arise when passing it to |
Just successfully installed owncloud with a precreated db user and it works as expected. occ creates a db user All you have to change is to create the db user and use it for occ. This brings several advantages
|
@hgy59, that is very interesting. Let me roll-back some stuff and try your approach. |
eb12ecc
to
1bcba34
Compare
@hgy59, thanks for the guidance—it worked well. The documentation doesn’t clearly cover this type of deployment, but it seems to be functioning as expected. I'll run a few more tests to confirm. I've also added regex validation for the backup restore process to explicitly check the file path earlier in the workflow.
I typically use "emptyText" to display examples. When the examples are specific to the user, I prefer "defaultValue," but otherwise, I use "emptyText" as a form of documentation. If there are any particular instances you’d like me to change, just let me know. |
@tbc0309 you can go ahead and test this build as it should resolve all open issues with installation. |
Okay, today I'm here to invite multiple people to test and provide feedback. |
Thanks for this. How has the testing been going so far? |
@tbc0309 any further feedback before I merge and publish this? |
Description
This update builds on #6225 and #6279 to resolve an intermittent issue with admin user creation failing due to randomly generated passwords not meeting Synology MariaDB 10's password policy requirements. The setup now prompts users to specify a database user password, enforcing the required policy. Additionally, it creates the database, assigns the necessary permissions to the user, and refreshes the PHP configuration and extensions according to the latest ownCloud documentation.
Fixes #
Checklist
all-supported
completed successfullyType of change