Skip to content

refactor(setup): Centralize database password generation in AbstractDatabase#59092

Open
joshtrichards wants to merge 3 commits intomasterfrom
jtr/refactor-setup-central-db-gen
Open

refactor(setup): Centralize database password generation in AbstractDatabase#59092
joshtrichards wants to merge 3 commits intomasterfrom
jtr/refactor-setup-central-db-gen

Conversation

@joshtrichards
Copy link
Member

@joshtrichards joshtrichards commented Mar 20, 2026

  • Resolves: #

Summary

MySQL and PostgreSQL used different password generation strategies during setup. MySQL generated 30-char passwords with guaranteed character class diversity (upper, lower, digits, symbols) while PostgreSQL used only 30 alphanumeric characters via a service locator call.

This moves the stronger MySQL implementation into AbstractDatabase as generateDbPassword() and uses it from both backends. More DRY + this also eliminates an unnecessary Server::get() call in PostgreSQL setup.

TODO

  • ...

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
@joshtrichards joshtrichards added this to the Nextcloud 34 milestone Mar 20, 2026
@joshtrichards joshtrichards added feature: install and update technical debt ♻️ refactor Refactor code (not a bug fix, not a feature just refactoring) 3. to review Waiting for reviews labels Mar 20, 2026
@joshtrichards joshtrichards marked this pull request as ready for review March 20, 2026 14:03
@joshtrichards joshtrichards requested a review from a team as a code owner March 20, 2026 14:03
@joshtrichards joshtrichards requested review from ArtificialOwl, CarlSchwan, icewind1991, nickvergessen and salmart-dev and removed request for a team March 20, 2026 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews feature: install and update ♻️ refactor Refactor code (not a bug fix, not a feature just refactoring) technical debt

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants