diff --git a/Classes/Report/SolrVersionStatus.php b/Classes/Report/SolrVersionStatus.php index b1cdbc0710..19bff9ab45 100644 --- a/Classes/Report/SolrVersionStatus.php +++ b/Classes/Report/SolrVersionStatus.php @@ -21,6 +21,7 @@ use ApacheSolrForTypo3\Solr\System\Solr\SolrConnection; use Doctrine\DBAL\Driver\Exception as DBALDriverException; use Throwable; +use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Reports\Status; @@ -32,14 +33,6 @@ */ class SolrVersionStatus extends AbstractSolrStatus { - /** - * Required Solr version. The version that gets installed when using the - * provided install-script EXT:solr/Resources/Private/Install/install-solr.sh - * - * @var string - */ - const REQUIRED_SOLR_VERSION = '8.11.1'; - /** * Compiles a version check against each configured Solr server. * @@ -61,13 +54,9 @@ public function getStatus() $pingFailedMsg = 'Could not ping solr server, can not check version ' . $url; $status = GeneralUtility::makeInstance( Status::class, - /** @scrutinizer ignore-type */ 'Apache Solr Version', - /** @scrutinizer ignore-type */ 'Not accessible', - /** @scrutinizer ignore-type */ $pingFailedMsg, - /** @scrutinizer ignore-type */ Status::ERROR ); $reports[] = $status; @@ -75,24 +64,32 @@ public function getStatus() } $solrVersion = $coreAdmin->getSolrServerVersion(); - $isOutdatedVersion = version_compare($this->getCleanSolrVersion($solrVersion), self::REQUIRED_SOLR_VERSION, '<'); + $supportedSolrVersions = $this->getSupportedSolrVersions(); + $isSupported = in_array($this->getCleanSolrVersion($solrVersion), $supportedSolrVersions); - if (!$isOutdatedVersion) { + if ($isSupported) { + $reports[] = GeneralUtility::makeInstance( + Status::class, + 'Apache Solr Version', + 'OK', + 'Version of ' . $coreAdmin->__toString() . ' is ok: ' . $solrVersion, + Status::OK + ); continue; } $formattedVersion = $this->formatSolrVersion($solrVersion); - $variables = ['requiredVersion' => self::REQUIRED_SOLR_VERSION, 'currentVersion' => $formattedVersion, 'solr' => $coreAdmin]; + $variables = [ + 'supportedSolrVersions' => $supportedSolrVersions, + 'currentVersion' => $formattedVersion, + 'solr' => $coreAdmin, + ]; $report = $this->getRenderedReport('SolrVersionStatus.html', $variables); $status = GeneralUtility::makeInstance( Status::class, - /** @scrutinizer ignore-type */ 'Apache Solr Version', - /** @scrutinizer ignore-type */ - 'Outdated, Unsupported', - /** @scrutinizer ignore-type */ + 'Unsupported', $report, - /** @scrutinizer ignore-type */ Status::ERROR ); @@ -102,6 +99,13 @@ public function getStatus() return $reports; } + protected function getSupportedSolrVersions(): array + { + $composerContents = file_get_contents(ExtensionManagementUtility::extPath('solr') . 'composer.json'); + $composerConfiguration = json_decode($composerContents, true, 25, JSON_OBJECT_AS_ARRAY); + return $composerConfiguration['extra']['TYPO3-Solr']['version-matrix']['Apache-Solr'] ?? []; + } + /** * Gets the clean Solr version in case of a custom build which may have * additional information in the version string. diff --git a/Docker/SolrServer/Dockerfile b/Docker/SolrServer/Dockerfile index a29ae00dea..cd93d002eb 100644 --- a/Docker/SolrServer/Dockerfile +++ b/Docker/SolrServer/Dockerfile @@ -1,9 +1,13 @@ -FROM solr:8.11.1 +FROM solr:8.11.3 MAINTAINER dkd Internet Service GmbH ENV TERM linux USER root -RUN rm -fR /opt/solr/server/solr/* +RUN rm -fR /opt/solr/server/solr/* \ + && echo '# EXT:solr relevant changes: ' >> /etc/default/solr.in.sh \ + && echo 'SOLR_OPTS="$SOLR_OPTS -Dsolr.enableRemoteStreaming=true -Dsolr.enableStreamBody=true"' >> /etc/default/solr.in.sh \ + && echo '# END: EXT:solr' >> /etc/default/solr.in.sh + USER solr COPY --chown=solr:solr Resources/Private/Solr/ /var/solr/data diff --git a/Documentation/Appendix/VersionMatrix.rst b/Documentation/Appendix/VersionMatrix.rst index 6f35590ae4..4273683d90 100644 --- a/Documentation/Appendix/VersionMatrix.rst +++ b/Documentation/Appendix/VersionMatrix.rst @@ -21,5 +21,12 @@ Requirements for EXT:solr* 11.5 stack ------------------------------- ---------------------------------------------- --------------------------------------------- --------------------------------- TYPO3 EXT: solr EXT:tika EXT:solrfal EXT:solrconsole EXT:solrdebugtools EXT:solrfluidgrouping EXT:solrmlt Apache Solr Configset ========= ========== ========== =========== =============== ================== ============================= =============== =============== ================= -11.5 11.5 11.0 11.0 11.0 11.0 11.0 11.0 (Ø) 8.11.1 ext_solr_11_5_0 +11.5 11.5 11.0 11.0 11.0 11.0 11.0 11.0 (Ø) 8.11.3¹ ext_solr_11_5_0 ========= ========== ========== =========== =============== ================== ============================= =============== =============== ================= + +|¹ - recommended Apache Solr version, check version matrix in composer.json (composer info:solr-versions) for full list + +.. warning:: + Apache Solr 8.11.3 contains a breaking change, see security fix "SOLR-14853: Make enableRemoteStreaming option global; not configSet". EXT:solr relies on stream bodies + which aren't enabled by default since 8.11.3. EXT:solr 11.5.6 contains all required settings, but if you're updating and not using our Docker image, you have to + set "enableRemoteStreaming=true" and "solr.enableStreamBody=true". TYPO3 reports module will print a warning if you have to reconfigure. diff --git a/Documentation/Releases/solr-release-11-5.rst b/Documentation/Releases/solr-release-11-5.rst index 60cbc5fb5b..48ed52ed35 100644 --- a/Documentation/Releases/solr-release-11-5.rst +++ b/Documentation/Releases/solr-release-11-5.rst @@ -6,6 +6,15 @@ Releases 11.5 ============= + +Release 11.5.6 +-------------- + +.. warning:: + Apache Solr 8.11.3 contains a breaking change, see security fix "SOLR-14853: Make enableRemoteStreaming option global; not configSet". EXT:solr relies on stream bodies + which aren't enabled by default since 8.11.3. EXT:solr 11.5.6 contains all required settings, but if you're updating and not using our Docker image, you have to + set "enableRemoteStreaming=true" and "solr.enableStreamBody=true". TYPO3 reports module will print a warning if you have to reconfigure. + Release 11.5.5 -------------- diff --git a/Resources/Private/Templates/Backend/Reports/SolrVersionStatus.html b/Resources/Private/Templates/Backend/Reports/SolrVersionStatus.html index c4f5fa7873..30b655302a 100644 --- a/Resources/Private/Templates/Backend/Reports/SolrVersionStatus.html +++ b/Resources/Private/Templates/Backend/Reports/SolrVersionStatus.html @@ -1,22 +1,34 @@ -

Found an - outdated Apache Solr server version.
The minimum - required version is {requiredVersion}, you have {currentVersion}.

+ + +

Found an unsupported Apache Solr server version.
+ It is strongly recommended to use one of the explicitly tested versions, preferably the latest one.
+ The currently supported versions are: + + {version}{f:if(condition: '{iterator.isLast}', then: '.', else: ',')} + +
Your version is: {currentVersion}. +

- - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + +
Affected Solr server
Host{solr.primaryEndpoint.host}
Path{solr.corePath}
Port{solr.primaryEndpoint.port}
Affected Solr server
Host{solr.primaryEndpoint.host}
Path{solr.corePath}
Port{solr.primaryEndpoint.port}
+ + \ No newline at end of file diff --git a/Tests/Integration/Report/SolrVersionStatusTest.php b/Tests/Integration/Report/SolrVersionStatusTest.php index 624c435038..0f5e64bb7f 100644 --- a/Tests/Integration/Report/SolrVersionStatusTest.php +++ b/Tests/Integration/Report/SolrVersionStatusTest.php @@ -18,6 +18,7 @@ use ApacheSolrForTypo3\Solr\Report\SolrVersionStatus; use ApacheSolrForTypo3\Solr\Tests\Integration\IntegrationTest; use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\CMS\Reports\Status; /** * Integration test for the solr version test @@ -41,7 +42,14 @@ public function canGetAGreenSolrConfigStatusAgainstTestServer() /** @var $solrVersionStatus SolrVersionStatus */ $solrVersionStatus = GeneralUtility::makeInstance(SolrVersionStatus::class); - $violations = $solrVersionStatus->getStatus(); - self::assertEmpty($violations, 'We expect to get no violations against the test solr server'); + $results = $solrVersionStatus->getStatus(); + self::assertCount(6, $results); + self::assertEmpty( + array_filter( + $results, + static fn (Status $status): bool => $status->getSeverity() !== Status::OK + ), + 'We expect to get no violations against the test Solr server ' + ); } } diff --git a/composer.json b/composer.json index 1f0b453b57..af72fb4789 100644 --- a/composer.json +++ b/composer.json @@ -80,6 +80,12 @@ "tests:unit": "Runs unit tests" }, "scripts": { + "info:solr-versions": [ + "@composer config extra.TYPO3-Solr.version-matrix.Apache-Solr" + ], + "info:recommended-solr-version": [ + "@composer config extra.TYPO3-Solr.version-matrix.Apache-Solr.0" + ], "post-autoload-dump": [ "mkdir -p .Build/Web/typo3conf/ext/", "[ -L .Build/Web/typo3conf/ext/solr ] || ln -snvf ../../../../. .Build/Web/typo3conf/ext/solr" @@ -140,7 +146,11 @@ "ext-solrdebugtools": "^11.0", "ext-solrfluidgrouping": "^11.0", "ext-solrmlt": "^11.0", - "Apache-Solr": "8.11.1", + "Apache-Solr": [ + "8.11.3", + "8.11.2", + "8.11.1" + ], "configset": "ext_solr_11_5_0" }, "ext-solrfal": {