fix(core): remove duplicate MySQL user prefix#59514
Conversation
a3e51f3 to
29fe029
Compare
29fe029 to
37f0f54
Compare
PR #53212 implemented a hardcoded database username, instead of deriving it from the Nextcloud admin username, to be able to setup Nextcloud without admin user. This has the additional benefit that knowing one of them does not allow to derive the other. However, it used `oc_admin`, while the MySQL database setup adds `oc_` again in the dedicated `createSpecificUser()` function, resulting in `oc_oc_admin`. In case of PostgreSQL, this was done in `setupDatabase()`, replaced with the hardcoded username. Signed-off-by: MichaIng <micha@dietpi.com>
37f0f54 to
fd046ed
Compare
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
joshtrichards
left a comment
There was a problem hiding this comment.
This one (among others) should already be addressed in #59094. Since I've been doing various refactoring in that area of code already, I'd obviously prefer to go that route... ;-)
|
@joshtrichards Nope, your PR does not address this, it still adds |
Summary
PR #53212 implemented a hardcoded database username, instead of deriving it from the Nextcloud admin username, to be able to setup Nextcloud without admin user.
However, it used
oc_admin, while the MySQL database setup addsoc_again in the dedicatedcreateSpecificUser()function, resulting inoc_oc_admin. In case of PostgreSQL, this was done insetupDatabase(), replaced with the hardcoded username.I kept the 16 characters limit, not sure whether this is still needed. The function is actually called only internally, only in this very script, so it should never see any other value than
oc_admin. Let me know if I should remove the 0-16 substring, along with the confusing$adminUservariable (since this user is neither the database admin, nor the Nextcloud admin).TODO
Checklist
3. to review, feature component)stable32)AI (if applicable)