Commit Graph

123 Commits

Author SHA1 Message Date
Josh
f9f27cec20 fix(setup/pgsql): use injected ISecureRandom
Signed-off-by: Josh <josh.t.richards@gmail.com>
2026-02-18 10:25:39 -05:00
Josh
1cc43bfad5 chore(setup/pgsql): php-cs fixup
Signed-off-by: Josh <josh.t.richards@gmail.com>
2026-02-18 10:25:39 -05:00
Josh
1cdd0af24c refactor(setup/pgsql): log chosen db username
Signed-off-by: Josh <josh.t.richards@gmail.com>
2026-02-18 10:25:39 -05:00
Josh
b8641561ea refactor(setup/pgsql): split out schema mgmt logic + enhance its logging
Signed-off-by: Josh <josh.t.richards@gmail.com>
2026-02-18 10:25:39 -05:00
Josh
d110f259dc refactor(setup/pgsql): Split up creation code path from non-creation
Signed-off-by: Josh <josh.t.richards@gmail.com>
2026-02-18 10:25:39 -05:00
Josh
f8e1dc0da2 refactor(setup/pgsql): use a single connection object and better handle admin credentials
Signed-off-by: Josh <josh.t.richards@gmail.com>
2026-02-18 10:25:39 -05:00
Josh
00074b72c1 refactor(setup/pgsql): make connect object names less ambiguous
Signed-off-by: Josh <josh.t.richards@gmail.com>
2026-02-18 10:25:39 -05:00
Josh
f4e7a7ff5d refactor(setup/pgsql): avoid mutating properties until necessary
And consolidate credential generation logic in a single place

Signed-off-by: Josh <josh.t.richards@gmail.com>
2026-02-18 10:25:39 -05:00
Josh
4787dff6dd refactor(setup/pgsql): move db verification logic to helper
Signed-off-by: Josh <josh.t.richards@gmail.com>
2026-02-18 10:25:39 -05:00
Josh
3b38cb3d50 refactor(setup/pgsql): move role creation priv check to helper
Signed-off-by: Josh <josh.t.richards@gmail.com>
2026-02-18 10:25:39 -05:00
Carl Schwan
c96ece0bcb refactor: Add more typing
- repairs job
- database
- redis

And remove Helpertest which was unused outside of some tests.

Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2026-02-06 13:55:39 +01:00
Carl Schwan
7b6078875b refactor: Run rector on lib/private
Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2026-02-06 13:50:18 +01:00
Carl Schwan
c21b8169ff refactor(querybuilder): Port away from qb::execute() in lib/
Replace by either executeStatement or executeQuery

Signed-off-by: Carl Schwan <carl.schwan@nextclound.com>
2025-09-02 11:55:56 +02:00
Ferdinand Thiessen
b814f3bba6 fix(db): use caching_sha2_password for MySQL
`caching_sha2_password` was added in 8.0.4 as the default
authentication plugin. `mysql_native_password` is deprecated since then.
In MySQL 8.4 it was disabled by default so a user need to manually
reenable it to make it work.
In MySQL 9.0 it is removed and causes the following error:

> SQLSTATE[HY000] [1524] Plugin 'mysql_native_password' is not loaded

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-08-05 20:40:38 +02:00
John Molakvoæ
5108b8fa13 Merge pull request #49104 from nextcloud/fix/install-dbport-unused 2025-08-01 11:35:22 +02:00
provokateurin
9a121269f3 refactor(Setup): When creating a DB user don't use the admin username
Signed-off-by: provokateurin <kate@provokateurin.de>
2025-06-10 11:16:28 +02:00
Côme Chilliet
7c907223d2 fix: Fix psalm taint false-positive by escaping trusted input
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-02-17 15:26:22 +01:00
Josh
ef238b5602 fix(db): Stop writing unused dbport to config at install time
Signed-off-by: Josh <josh.t.richards@gmail.com>
2024-11-05 16:40:29 -05:00
Git'Fellow
a1681b0756 chore(db): Apply query prepared statements
Fix: psalm

fix: bad file

fix: bug

chore: add batch

chore: add batch

chore: add batch

fix: psalm
2024-10-17 20:30:47 +02:00
provokateurin
9836e9b164 chore(deps): Update nextcloud/coding-standard to v1.3.1
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-09-19 14:21:20 +02:00
Daniel Kesselberg
af6de04e9e style: update codestyle for coding-standard 1.2.3
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2024-08-25 19:34:58 +02:00
Hailong Wang
67c52d202c fix: use $this->tryCreateDbUser condition 2024-08-16 10:59:15 +02:00
Hailong Wang
f490a4e8c0 fix: postgresql GRANT user's permission after createDatabase, ensure database exist when GRANT 2024-08-16 10:57:11 +02:00
John Molakvoæ
258bb03cf5 Merge branch 'master' into refactor/OC-Server-getSecureRandom
Signed-off-by: John Molakvoæ <skjnldsv@users.noreply.github.com>
2024-05-30 14:24:22 +02:00
Andy Scherzinger
dae7c159f7 chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-24 13:11:22 +02:00
John Molakvoæ
524ed97d62 fix: replace Account name by Login
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
2024-02-13 21:08:10 +01:00
Vincent Petry
839ddaa354 feat: rename users to account or person
Replace translated text in most locations

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2024-02-13 21:06:30 +01:00
Julius Härtl
81b089cf30 fix: Avoid using replicas during setup
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-12-28 11:51:35 +01:00
Julius Härtl
79c4986354 enh: Implement PrimaryReadReplicaConnection
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-12-16 20:27:37 +01:00
Joas Schilling
aa5f037af7 chore: apply changes from Nextcloud coding standards 1.1.1
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
2023-11-23 10:36:13 +01:00
Joas Schilling
6f39d82031 fix(install): Make installing more verbose
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-11-03 15:44:46 +01:00
Hamid Dehnavi
ea06cf2f39 Convert isset ternary to null coalescing operator
Signed-off-by: Hamid Dehnavi <hamid.dev.pro@gmail.com>
2023-09-28 17:44:19 +03:30
Andrew Summers
1395a53602 Refactor OC\Server::getSecureRandom
Signed-off-by: Andrew Summers <18727110+summersab@users.noreply.github.com>
2023-08-29 21:32:40 -05:00
Simon L
40edac18f5 postgresql - add quotes around user names
fix https://github.com/nextcloud/server/issues/37114

Signed-off-by: Simon L <szaimen@e.mail.de>
2023-03-08 01:03:27 +01:00
Robin Appelman
b923310580 add option to disable db user creation trough environment variable
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-02-21 15:13:47 +01:00
Côme Chilliet
f5c361cf44 composer run cs:fix
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-01-20 11:45:08 +01:00
Vitor Mattos
eb7b682dc0 Bugfix to support postgres15
Signed-off-by: Vitor Mattos <vitor@php.rio>
Signed-off-by: Simon L <szaimen@e.mail.de>
Co-Authored-By: Joas Schilling <213943+nickvergessen@users.noreply.github.com>
2022-11-11 22:36:08 +01:00
Julius Härtl
b427ccd065 Do not store generated mysql password if it was not used
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-09-20 08:39:25 +02:00
Valdnet
6bdc1f8631 l10n: Correct error messages
Signed-off-by: Valdnet <47037905+Valdnet@users.noreply.github.com>
2022-09-16 09:22:01 +02:00
Valdnet
77472db054 l10n: Correct error messages
Signed-off-by: Valdnet <47037905+Valdnet@users.noreply.github.com>
2022-09-16 09:18:24 +02:00
Joas Schilling
33d7a9624c Create more secure passwords by default
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-08-12 10:03:19 +02:00
Joas Schilling
d275c93035 Recover installation when creating the user failed
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-08-12 09:43:38 +02:00
Côme Chilliet
c54fb5f9e6 Use {$var} instead of ${var} for PHP 8.2 compatibility
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-06-14 15:12:28 +02:00
Daniel Kesselberg
cf2bc22e0f Fix return type for createSpecificUser
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2022-05-19 14:36:52 +02:00
Daniel Kesselberg
e163b1bb48 Rename userName to username to align with child classes
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2022-05-19 14:36:41 +02:00
Carl Schwan
6312c0df69 Check style update
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-13 00:19:07 +01:00
J0WI
3b656446af Introduce ISecureRandom::CHAR_ALPHANUMERIC
Signed-off-by: J0WI <J0WI@users.noreply.github.com>
2021-07-08 15:11:31 +02:00
John Molakvoæ (skjnldsv)
215aef3cbd Update php licenses
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2021-06-04 22:02:41 +02:00
Joas Schilling
29a66a5e49 Fix PHP CS
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-04-27 14:34:32 +02:00
Joas Schilling
167efa19d7 Fix psalm errors
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-04-27 14:34:32 +02:00