From 3f88229a708530fa33374680ac855af383d529c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Sat, 24 Oct 2026 20:31:21 +0200 Subject: [PATCH] feat: settings.php is shared on the server and no longer in git; production is leading Every deploy replaced settings.php with the committed version, so changes made in the production backend (extension configuration, install tool) were lost with the next deploy or rollback. As LocalConfiguration.php on TYPO3 10, it is now a shared file. typo3:settings:init seeds it once from the live release; deploy:shared would otherwise seed it from the new release, i.e. from git, and drop production's settings one last time. The file is no longer tracked: it holds the encryptionKey and the install tool password hash, and git has no use for it once production is leading. Local copies stay in place (ignored). Co-Authored-By: Claude Opus 5.5 --- config/system/.gitignore | 1 + config/system/settings.php | 216 ------------------------------------- deploy.php | 21 ++++ 3 files changed, 22 insertions(+), 216 deletions(-) delete mode 100644 config/system/settings.php diff --git a/config/system/.gitignore b/config/system/.gitignore index bcf2027..6c9f404 100644 --- a/config/system/.gitignore +++ b/config/system/.gitignore @@ -1,2 +1,3 @@ /secrets.php /drushrc.php +/settings.php diff --git a/config/system/settings.php b/config/system/settings.php deleted file mode 100644 index 1836957..0000000 --- a/config/system/settings.php +++ /dev/null @@ -1,216 +0,0 @@ - [ - 'debug' => false, - 'installToolPassword' => '$argon2i$v=19$m=65536,t=16,p=1$NVBiTmJvdEljbWY0WmdjUg$YRkMEpjn+hVLAZWWrrU9wIhVgZ3pPhSnPQyB/7+7Z1g', - 'passwordHashing' => [ - 'className' => 'TYPO3\\CMS\\Core\\Crypto\\PasswordHashing\\Argon2iPasswordHash', - 'options' => [], - ], - ], - 'DB' => [ - 'Connections' => [ - 'Default' => [ - 'charset' => 'utf8mb4', - 'dbname' => 'db', - 'defaultTableOptions' => [ - 'charset' => 'utf8mb4', - 'collation' => 'utf8mb4_unicode_ci', - ], - 'driver' => 'mysqli', - 'host' => 'db', - 'password' => 'db', - 'port' => 3306, - 'user' => 'db', - ], - ], - ], - 'EXTCONF' => [ - 'lang' => [ - 'availableLanguages' => [ - 'de', - ], - ], - ], - 'EXTENSIONS' => [ - 'backend' => [ - 'backendFavicon' => '', - 'backendLogo' => '', - 'loginBackgroundImage' => '', - 'loginFootnote' => '', - 'loginHighlightColor' => '', - 'loginLogo' => '', - 'loginLogoAlt' => '', - ], - 'ep_products' => [ - 'bpnConnectApiBaseUrl' => '', - 'bpnConnectApiKey' => '', - 'bpnConnectApiMaxDuration' => '15', - 'bpnConnectApiTimeout' => '5', - 'cmsApiKey' => '', - 'contentFeedEnabled' => '1', - 'contentFeedExcludedPages' => '634', - 'contentFeedLanguages' => '0', - 'contentFeedNewsDetailPages' => 'ep-reisen:1392', - 'contentFeedSites' => 'ep-reisen,ser,ski-boarderweek,ski-wochenenden,snowzone', - 'importStoragePid' => '11', - 'myEpApiBaseUrl' => '', - 'myEpApiClientId' => '', - 'myEpApiClientSecret' => '', - 'myEpApiMaxDuration' => '15', - 'myEpApiTimeout' => '5', - 'myEpApiUrlAuthorize' => '', - 'myEpApiUrlToken' => '', - 'myEpStagingUrl' => 'https://my.ep-reisen.net', - 'myEpUrl' => 'https://my.ep-reisen.de/', - 'searchPageUid' => '0', - ], - 'ep_theme' => [ - 'cdnBaseUrl' => 'https://cdn.ep-reisen.de/', - ], - 'extensionmanager' => [ - 'automaticInstallation' => '1', - 'offlineMode' => '0', - ], - 'news' => [ - 'advancedMediaPreview' => '1', - 'archiveDate' => 'date', - 'categoryBeGroupTceFormsRestriction' => '0', - 'categoryRestriction' => '', - 'contentElementRelation' => '1', - 'dateTimeNotRequired' => '0', - 'hidePageTreeForAdministrationModule' => '0', - 'manualSorting' => '0', - 'pageTreePluginPreview' => '1', - 'prependAtCopy' => '1', - 'resourceFolderImporter' => '/news_import', - 'rteForTeaser' => '0', - 'showAdministrationModule' => '1', - 'slugBehaviour' => 'unique', - 'storageUidImporter' => '1', - 'tagPid' => '1', - ], - 'redirects' => [ - 'showCheckIntegrityInfoInReports' => '1', - 'showCheckIntegrityInfoInReportsSeconds' => '86400', - ], - 'scheduler' => [ - 'maxLifetime' => '1440', - ], - 'staticfilecache' => [ - 'backendDisplayMode' => 'both', - 'boostMode' => '0', - 'clearCacheForAllDomains' => '1', - 'cspGenerationOverride' => '0', - 'debugHeaders' => '0', - 'disableInDevelopment' => '0', - 'enableGeneratorBrotli' => '0', - 'enableGeneratorGzip' => '1', - 'enableGeneratorPhp' => '0', - 'enableGeneratorPlain' => '0', - 'hashUriInCache' => '0', - 'headerSizeBuffer' => '1.5', - 'htaccessTemplateName' => 'EXT:staticfilecache/Resources/Private/Templates/Htaccess.html', - 'inlineAssetsFileSize' => '50000', - 'inlineScriptMinify' => '0', - 'inlineServiceFavIcon' => '0', - 'inlineServiceScripts' => '0', - 'inlineServiceStyles' => '0', - 'inlineStyleAssets' => 'ico,png,woff2', - 'inlineStyleMinify' => '0', - 'largeIdentifierInCacheTable' => '0', - 'maxHeaderSize' => '8192', - 'overrideCacheDirectory' => '', - 'overrideClientUserAgent' => '', - 'phpTemplateName' => 'EXT:staticfilecache/Resources/Private/Templates/Php.html', - 'rawurldecodeCacheFileName' => '0', - 'renameTablesToOtherPrefix' => '0', - 'sendCacheControlHeaderRedirectAfterCacheTimeout' => '1', - 'sendHttp2PushEnable' => '0', - 'sendHttp2PushFileExtensions' => 'css,js', - 'sendHttp2PushFileLimit' => '10', - 'sendHttp2PushLimitToArea' => '', - 'useFallbackMiddleware' => '1', - 'useReverseUriLengthInPriority' => '1', - 'validFallbackHeaders' => 'Content-Type,Content-Language,Content-Security-Policy,Link', - 'validHtaccessHeaders' => 'Content-Type,Content-Language,Content-Security-Policy,Link', - ], - ], - 'FE' => [ - 'cacheHash' => [ - 'enforceValidation' => true, - ], - 'debug' => false, - 'disableNoCacheParameter' => true, - 'passwordHashing' => [ - 'className' => 'TYPO3\\CMS\\Core\\Crypto\\PasswordHashing\\Argon2iPasswordHash', - 'options' => [], - ], - 'compressionLevel' => 0, - ], - 'GFX' => [ - 'processor' => 'GraphicsMagick', - 'processor_effects' => false, - 'processor_enabled' => true, - 'processor_path' => '/usr/bin/', - ], - 'LOG' => [ - 'TYPO3' => [ - 'CMS' => [ - 'deprecations' => [ - 'writerConfiguration' => [ - 'notice' => [ - 'TYPO3\CMS\Core\Log\Writer\FileWriter' => [ - 'disabled' => true, - ], - ], - ], - ], - ], - ], - ], - 'MAIL' => [ - 'transport' => 'sendmail', - 'transport_sendmail_command' => '/usr/sbin/sendmail -t -i', - 'transport_smtp_encrypt' => '', - 'transport_smtp_password' => '', - 'transport_smtp_server' => '', - 'transport_smtp_username' => '', - ], - 'SYS' => [ - 'UTF8filesystem' => false, - 'caching' => [ - 'cacheConfigurations' => [ - 'hash' => [ - 'backend' => 'TYPO3\\CMS\\Core\\Cache\\Backend\\Typo3DatabaseBackend', - ], - 'pages' => [ - 'backend' => 'TYPO3\\CMS\\Core\\Cache\\Backend\\Typo3DatabaseBackend', - 'options' => [ - 'compression' => true, - ], - ], - 'rootline' => [ - 'backend' => 'TYPO3\\CMS\\Core\\Cache\\Backend\\Typo3DatabaseBackend', - 'options' => [ - 'compression' => true, - ], - ], - ], - ], - 'devIPmask' => '', - 'displayErrors' => 0, - 'encryptionKey' => '0ad297595e43cb5f668bdf7878eaea7002a4193fd26d2742a3a708b4b0715bcfabdae84a47ca8517d55732d9ea72a26a', - 'exceptionalErrors' => 4096, - 'features' => [ - 'extbase.consistentDateTimeHandling' => true, - 'frontend.cache.autoTagging' => true, - 'security.system.enforceAllowedFileExtensions' => true, - ], - 'sitename' => 'E&P', - 'systemMaintainers' => [ - 1, - ], - 'trustedHostsPattern' => '(?:[a-z0-9-]+\\.)?(?:ep-reisen\\.de|ski-boarderweek\\.(?:de|com|eu)|skiboarderweek\\.(?:de|eu)|snowzone\\.net|unichamp\\.de|snow-break\\.(?:de|com)|semesterende-skireisen\\.de|alpinevacation\\.ch|cllt-touristik\\.at|ep-events\\.de|ski-wochenenden\\.de)', - ], -]; diff --git a/deploy.php b/deploy.php index b8f547c..8fe3bcb 100644 --- a/deploy.php +++ b/deploy.php @@ -36,8 +36,13 @@ set('shared_dirs', [ // Baseline of the MyE&P import: without it every deploy would trigger a full re-import 'var/transient/ep_products_import', ]); +// settings.php is shared as LocalConfiguration.php was on TYPO3 10: production is leading, so what +// is changed in the backend (extension configuration, install tool) survives deploys and rollbacks. +// It is not in git (encryptionKey, install tool password): configuration changes for production are +// made there, in the backend or by hand on the shared file. set('shared_files', [ 'config/system/secrets.php', + 'config/system/settings.php', ]); set('writable_dirs', [ '{{typo3/public_dir}}/typo3temp/assets', @@ -138,6 +143,21 @@ task('typo3:secrets:init', function () { writeln('Created ' . parse($target) . ' from the template: fill it in, then deploy again.'); }); +desc('Seed the shared settings.php from the live release unless it is there already (never overwrites)'); +task('typo3:settings:init', function () { + $target = '{{deploy_path}}/shared/config/system/settings.php'; + if (test("[ -s $target ]")) { + return; + } + // deploy:shared would seed it from the new release, i.e. from git, and drop production's settings + if (!test('[ -f {{deploy_path}}/current/config/system/settings.php ]')) { + return; + } + run('mkdir -p {{deploy_path}}/shared/config/system'); + run("cp -L {{deploy_path}}/current/config/system/settings.php $target"); + writeln('Created ' . parse($target) . ' from the live release.'); +}); + desc('Stop before the database is touched while secrets.php still lacks the database connection'); task('typo3:secrets:check', function () { $secrets = '{{deploy_path}}/shared/config/system/secrets.php'; @@ -175,6 +195,7 @@ task('deploy', [ 'deploy:release', 'rsync', 'typo3:secrets:init', + 'typo3:settings:init', 'deploy:shared', 'typo3:fileadmin', 'deploy:writable',