Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/phpunit-mysql-sharding.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ jobs:
fail-fast: false
matrix:
include:
- mysql-versions: '8.0'
php-versions: '8.3'
- mysql-versions: '8.4'
php-versions: '8.3'
- mysql-versions: '9.7'
php-versions: '8.5'

name: Sharding - MySQL ${{ matrix.mysql-versions }} (PHP ${{ matrix.php-versions }}) - database tests
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/phpunit-mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ jobs:
fail-fast: false
matrix:
include:
- mysql-versions: '8.0'
php-versions: '8.3'
- mysql-versions: '8.4'
php-versions: '8.3'
- mysql-versions: '9.7'
php-versions: '8.5'

name: MySQL ${{ matrix.mysql-versions }} (PHP ${{ matrix.php-versions }}) - database tests
Expand All @@ -75,7 +75,7 @@ jobs:
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3

mysql:
image: ghcr.io/nextcloud/continuous-integration-mysql-${{ matrix.mysql-versions }}:latest # zizmor: ignore[unpinned-images]
image: mysql:${{ matrix.mysql-versions }} # zizmor: ignore[unpinned-images]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nickvergessen as we now have a docker cache in place we do not run into problems with docker hub anymore. Do we still need to use our own images?
If yes I will prepare the new image.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it more likely that we get hacked or mysql? :P
I guess both is fine

ports:
- 4444:3306/tcp
env:
Expand Down
4 changes: 2 additions & 2 deletions apps/settings/lib/SetupChecks/SupportedDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class SupportedDatabase implements ISetupCheck {

private const MIN_MARIADB = '10.6';
private const MAX_MARIADB = '11.8';
private const MIN_MYSQL = '8.0';
private const MAX_MYSQL = '8.4';
private const MIN_MYSQL = '8.4';
private const MAX_MYSQL = '9.7';
private const MIN_POSTGRES = '14';
private const MAX_POSTGRES = '18';
private const MIN_ORACLE = '12.2';
Expand Down
10 changes: 10 additions & 0 deletions build/psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1420,6 +1420,11 @@
<code><![CDATA[getUsersForUserValue]]></code>
</DeprecatedMethod>
</file>
<file src="apps/files/lib/Command/RepairTree.php">
<DeprecatedMethod>
<code><![CDATA[md5]]></code>
</DeprecatedMethod>
</file>
<file src="apps/files/lib/Command/Scan.php">
<DeprecatedMethod>
<code><![CDATA[listen]]></code>
Expand Down Expand Up @@ -3236,6 +3241,11 @@
<code><![CDATA[$this->request->server]]></code>
</NoInterfaceProperties>
</file>
<file src="core/Migrations/Version24000Date20211230140012.php">
<DeprecatedMethod>
<code><![CDATA[md5]]></code>
</DeprecatedMethod>
</file>
<file src="core/Migrations/Version25000Date20220515204012.php">
<DeprecatedConstant>
<code><![CDATA[Types::JSON]]></code>
Expand Down
20 changes: 13 additions & 7 deletions lib/private/Setup/MySQL.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

namespace OC\Setup;

use Doctrine\DBAL\Platforms\MySQL80Platform;
use Doctrine\DBAL\Platforms\MySQL84Platform;
use OC\DatabaseSetupException;
use OC\DB\ConnectionAdapter;
Expand All @@ -30,6 +29,19 @@ public function setupDatabase(): void {
$connection = $this->connect(['dbname' => null]);
}

// for MD5 support
if ($connection->getDatabasePlatform() instanceof MySQL84Platform) {
$statement = $connection->prepare("SHOW VARIABLES LIKE 'version';");
$result = $statement->executeQuery();
$row = $result->fetchAssociative();
$version = $row['Value'];
[$major, ] = explode('.', strtolower($version));
if ((int)$major >= 9) {
$statement = $connection->prepare("INSTALL COMPONENT 'file://component_classic_hashing';");
$statement->executeStatement();
}
}

if ($this->tryCreateDbUser) {
$this->createSpecificUser('oc_admin', new ConnectionAdapter($connection));
}
Expand Down Expand Up @@ -103,12 +115,6 @@ private function createDBUser(IDBConnection $connection): void {
$connection->executeStatement($query, [$name,$password]);
$query = "CREATE USER ?@'%' IDENTIFIED WITH caching_sha2_password BY ?";
$connection->executeStatement($query, [$name,$password]);
} elseif ($connection->getDatabasePlatform() instanceof Mysql80Platform) {
// TODO: Remove this elseif section as soon as MySQL 8.0 is out-of-support (after April 2026)
$query = "CREATE USER ?@'localhost' IDENTIFIED WITH mysql_native_password BY ?";
$connection->executeStatement($query, [$name,$password]);
$query = "CREATE USER ?@'%' IDENTIFIED WITH mysql_native_password BY ?";
$connection->executeStatement($query, [$name,$password]);
} else {
$query = "CREATE USER ?@'localhost' IDENTIFIED BY ?";
$connection->executeStatement($query, [$name,$password]);
Expand Down
1 change: 1 addition & 0 deletions lib/public/DB/QueryBuilder/IFunctionBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ interface IFunctionBuilder {
*
* @return IQueryFunction
* @since 12.0.0
* @deprecated 35.0.0 - MD5 is not considered secure anymore, thus most databases have or will drop support for this function
*/
public function md5($input): IQueryFunction;

Expand Down
Loading