Skip to content

fix(core): remove duplicate MySQL user prefix#59514

Open
MichaIng wants to merge 1 commit intomasterfrom
fix/double-db-prefix
Open

fix(core): remove duplicate MySQL user prefix#59514
MichaIng wants to merge 1 commit intomasterfrom
fix/double-db-prefix

Conversation

@MichaIng
Copy link
Copy Markdown
Member

@MichaIng MichaIng commented Apr 8, 2026

  • Resolves: #

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. 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.

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 $adminUser variable (since this user is neither the database admin, nor the Nextcloud admin).

TODO

  • ...

Checklist

AI (if applicable)

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

@MichaIng MichaIng added this to the Nextcloud 34 milestone Apr 8, 2026
@MichaIng MichaIng requested a review from a team as a code owner April 8, 2026 19:13
@MichaIng MichaIng added bug 3. to review Waiting for reviews labels Apr 8, 2026
@MichaIng MichaIng requested review from ArtificialOwl, CarlSchwan, leftybournes and salmart-dev and removed request for a team April 8, 2026 19:13
@MichaIng MichaIng force-pushed the fix/double-db-prefix branch 2 times, most recently from a3e51f3 to 29fe029 Compare April 8, 2026 19:33
@MichaIng MichaIng force-pushed the fix/double-db-prefix branch from 29fe029 to 37f0f54 Compare April 8, 2026 19:39
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>
@MichaIng MichaIng force-pushed the fix/double-db-prefix branch from 37f0f54 to fd046ed Compare April 8, 2026 19:42
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 bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant