Migrate global TYPO3 configurations

Those were the last piece in my old .dotfiles repository.
The whole configuration is now defined here.

Only customer specifics are in a separate location / repo to not expose
any sensible data.
This commit is contained in:
Daniel Siepmann 2022-04-14 15:07:29 +02:00
parent 048c0df915
commit 5221385642
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4
13 changed files with 398 additions and 1 deletions

View file

@ -150,6 +150,7 @@
url = "https://docs.oasis-open.org/xliff/v1.2/os/xliff-core-1.2-strict.xsd";
sha256 = "nzevVk7NJ9X2kVTXz+e6jesfYgyBuUzw6rH0IFx01fg=";
};
"typo3-configuration".source = ./home/files/typo3-configuration;
};
xdg.desktopEntries = {

View file

@ -0,0 +1,17 @@
<?php
date_default_timezone_set('Europe/Berlin');
ini_set('timezone', 'Europe/Berlin');
require_once 'SystemSettings.php';
require_once 'Gfx.php';
require_once 'MailSettings.php';
require_once 'CachingConfigurations.php';
require_once 'CacheFileBackend.php';
require_once 'Debugging.php';
require_once 'Logging.php';
require_once 'Autologin.php';
require_once '/home/daniels/Projects/own/typo3-configuration/ClientSpecific.php';
require_once 'ExtensionConfigurations.php';
// Last, as we need client specific db adjustments
require_once 'Database.php';

View file

@ -0,0 +1,87 @@
<?php
namespace Codappix\CdxAutoLogin;
// >= 10.4
if (class_exists(\TYPO3\CMS\Core\Authentication\AbstractAuthenticationService::class) !== false) {
class AutoAuthenticationTypo3Service extends \TYPO3\CMS\Core\Authentication\AbstractAuthenticationService
{
public function getUser()
{
$possibleUsernames = [
'dsiepmann',
'daniel.siepmann',
'daniel_siepmann',
];
foreach ($possibleUsernames as $username) {
$record = $this->fetchUserRecord($username);
if (is_array($record)) {
return $record;
}
}
return [];
}
public function authUser(array $user)
{
return 200;
}
}
}
// < 10.4
if (class_exists(\TYPO3\CMS\Sv\AbstractAuthenticationService\AbstractAuthenticationService::class) !== false) {
class AutoAuthenticationTypo3Service extends \TYPO3\CMS\Sv\AbstractAuthenticationService\AbstractAuthenticationService
{
public function getUser()
{
$possibleUsernames = [
'dsiepmann',
'daniel.siepmann',
'daniel_siepmann',
];
foreach ($possibleUsernames as $username) {
$record = $this->fetchUserRecord($username);
if (is_array($record)) {
return $record;
}
}
return [];
}
public function authUser(array $user)
{
return 200;
}
}
}
// Autologin
if (
false &&
class_exists(\Codappix\CdxAutoLogin\AutoAuthenticationTypo3Service::class)
&& (
defined('TYPO3_REQUESTTYPE') === false
|| (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_CLI) === 0
)) {
$GLOBALS['TYPO3_CONF_VARS']['SVCONF']['auth']['setup']['BE_alwaysFetchUser'] = true;
$GLOBALS['TYPO3_CONF_VARS']['SVCONF']['auth']['setup']['BE_alwaysAuthUser'] = true;
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addService(
'sitepackage',
'auth',
AutoAuthenticationTypo3Service::class,
[
'title' => 'Auto User authentication',
'description' => 'Auto authenticate user with configured username',
'subtype' => 'authUserBE,getUserBE',
'available' => true,
'priority' => 100,
'quality' => 50,
'className' => AutoAuthenticationTypo3Service::class,
]
);
}

View file

@ -0,0 +1,67 @@
<?php
namespace Codappix\CdxFileBackend;
use TYPO3\CMS\Core\Cache\Backend\FileBackend as CoreFileBackend;
use TYPO3\CMS\Core\Cache\Backend\TaggableBackendInterface;
use TYPO3\CMS\Core\Utility\GeneralUtility;
class FileBackend extends CoreFileBackend implements TaggableBackendInterface
{
public function flushByTag($tag)
{
array_walk($this->findIdentifiersByTag($tag), [$this, 'remove']);
}
public function flushByTags(array $tags)
{
foreach ($tags as $tag) {
$this->flushByTag($tag);
}
}
public function findIdentifiersByTag($tag)
{
$files = GeneralUtility::getFilesInDir($this->getCacheDirectory() . 'tag-' . $tag);
if ($files === []) {
return [];
}
return array_values($files);
}
public function set($entryIdentifier, $data, array $tags = [], $lifetime = null)
{
parent::set($entryIdentifier, $data, $tags, $lifetime);
foreach ($tags as $tag) {
$folder = $this->getCacheDirectory() . 'tag-' . $tag;
if (!is_dir($folder)) {
GeneralUtility::mkdir_deep($folder);
}
touch($folder . DIRECTORY_SEPARATOR . $entryIdentifier);
}
file_put_contents(
$this->getCacheDirectory() . $entryIdentifier . '-tags',
serialize($tags)
);
}
public function remove($entryIdentifier)
{
$pathAndFilename = $this->getCacheDirectory() . $entryIdentifier . '-tags';
if (file_exists($pathAndFilename)) {
$tags = unserialize(file_get_contents($pathAndFilename));
if (is_array($tags)) {
foreach ($tags as $tag) {
$tagFile = $this->getCacheDirectory() . 'tag-' . $tag . DIRECTORY_SEPARATOR . $entryIdentifier;
file_exists($tagFile) && unlink($tagFile);
}
}
}
return parent::remove($entryIdentifier);
}
}

View file

@ -0,0 +1,69 @@
<?php
// Caching
// Disable some for local development
// => Done inside Vim, Vim will delete some files after editing
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['extbase_reflection']['backend'] =
\Codappix\CdxFileBackend\FileBackend::class;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['extbase_object']['backend'] =
\Codappix\CdxFileBackend\FileBackend::class;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['extbase_datamapfactory_datamap']['backend'] =
\Codappix\CdxFileBackend\FileBackend::class;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['dashboard_rss']['backend'] =
\Codappix\CdxFileBackend\FileBackend::class;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['adminpanel_requestcache']['backend'] =
\Codappix\CdxFileBackend\FileBackend::class;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['workspaces_cache']['backend'] =
\Codappix\CdxFileBackend\FileBackend::class;
// Extensions
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['thuecat_fetchdata']['backend'] =
\Codappix\CdxFileBackend\FileBackend::class;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['thuecat_fetchdata']['options'] = [
'defaultLifetime' => 60 * 60 * 24 * 7 * 4,
];
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['tx_schema']['backend'] =
\Codappix\CdxFileBackend\FileBackend::class;
// reuter dynamics
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['shop_assets']['backend'] =
\Codappix\CdxFileBackend\FileBackend::class;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['filter_url']['backend'] =
\Codappix\CdxFileBackend\FileBackend::class;
if (
class_exists(\TYPO3\CMS\Core\Utility\VersionNumberUtility::class)
&& version_compare(\TYPO3\CMS\Core\Utility\VersionNumberUtility::getNumericTypo3Version(), '10.0', '>')
) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['rootline']['backend'] =
\Codappix\CdxFileBackend\FileBackend::class;
unset($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['rootline']['options']['compression']);
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['hash']['backend'] =
\Codappix\CdxFileBackend\FileBackend::class;
unset($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['hash']['options']['compression']);
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['pages']['backend'] =
\Codappix\CdxFileBackend\FileBackend::class;
unset($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['pages']['options']['compression']);
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['pagesection']['backend'] =
\Codappix\CdxFileBackend\FileBackend::class;
unset($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['pagesection']['options']['compression']);
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['imagesizes']['backend'] =
\Codappix\CdxFileBackend\FileBackend::class;
unset($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['imagesizes']['options']['compression']);
// 3rd party
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['news_category']['backend'] =
\Codappix\CdxFileBackend\FileBackend::class;
} else {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_rootline']['backend'] =
\Codappix\CdxFileBackend\FileBackend::class;
unset($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_pagesection']['options']['compression']);
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_pagesection']['backend'] =
\Codappix\CdxFileBackend\FileBackend::class;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_hash']['backend'] =
\Codappix\CdxFileBackend\FileBackend::class;
unset($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_pages']['options']['compression']);
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_pages']['backend'] =
\Codappix\CdxFileBackend\FileBackend::class;
}

View file

@ -0,0 +1,29 @@
<?php
// Database
$GLOBALS['TYPO3_CONF_VARS']['DB']['username'] = 'dev';
$GLOBALS['TYPO3_CONF_VARS']['DB']['password'] = 'dev';
// Looks like TYPO3 doesn't work with my socket inside the install tool ...
$GLOBALS['TYPO3_CONF_VARS']['DB']['host'] = '127.0.0.1';
// $GLOBALS['TYPO3_CONF_VARS']['DB']['host'] = '';
$GLOBALS['TYPO3_CONF_VARS']['DB']['socket'] = '/var/run/mysqld/mysqld.sock';
$GLOBALS['TYPO3_CONF_VARS']['SYS']['no_pconnect'] = true;
// Auto set for simple instances via http host. or env from apache This allows
// to set it at one place for the whole project if multiple domains are used
$GLOBALS['TYPO3_CONF_VARS']['DB']['database'] = $typo_db;
$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default'] = [
'dbname' => $GLOBALS['TYPO3_CONF_VARS']['DB']['database'],
'host' => $GLOBALS['TYPO3_CONF_VARS']['DB']['host'],
'password' => $GLOBALS['TYPO3_CONF_VARS']['DB']['password'],
'user' => $GLOBALS['TYPO3_CONF_VARS']['DB']['username'],
// 'port' => $GLOBALS['TYPO3_CONF_VARS']['DB'][''],
'socket' => $GLOBALS['TYPO3_CONF_VARS']['DB']['socket'],
'unix_socket' => $GLOBALS['TYPO3_CONF_VARS']['DB']['socket'],
'driver' => 'mysqli',
'charset' => 'utf8mb4',
'tableoptions' => [
'charset' => 'utf8mb4',
'collate' => 'utf8mb4_unicode_ci',
],
];

View file

@ -0,0 +1,21 @@
<?php
$GLOBALS['TYPO3_CONF_VARS']['SYS']['belogErrorReporting'] = 1;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['enable_errorDLOG'] = true;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['enable_exceptionDLOG'] = true;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['systemLog'] = 'error_log,,0;';
$GLOBALS['TYPO3_CONF_VARS']['SYS']['systemLogLevel'] = 0;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask'] = '*';
$GLOBALS['TYPO3_CONF_VARS']['BE']['debug'] = true;
$GLOBALS['TYPO3_CONF_VARS']['FE']['debug'] = true;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['sqlDebug'] = true;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['displayErrors'] = 1;
// Disable by default
$GLOBALS['TYPO3_CONF_VARS']['BE']['lang']['debug'] = false;
$GLOBALS['TYPO3_CONF_VARS']['BE']['languageDebug'] = false;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['errorHandlerErrors'] = E_ALL & ~ (E_NOTICE | E_DEPRECATED);
$GLOBALS['TYPO3_CONF_VARS']['SYS']['exceptionalErrors'] = E_ALL & ~ (E_NOTICE | E_DEPRECATED);

View file

@ -0,0 +1,27 @@
<?php
$GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['imageoptimizer'] = [
'debug' => '0',
'gifBinary' => 'gifsicle',
'gifCheck' => 'gif',
'gifOnProcessing' => '0',
'gifOnUpload' => '0',
'gifParametersOnProcessing' => '--batch -O2 %s',
'gifParametersOnUpload' => '--batch -O2 %s',
'jpgBinary' => 'jpegoptim',
'jpgCheck' => 'jpg',
'jpgOnProcessing' => '0',
'jpgOnUpload' => '0',
'jpgParametersOnProcessing' => '--strip-all %s',
'jpgParametersOnUpload' => '--strip-all %s',
'pngBinary' => 'optipng',
'pngCheck' => 'png',
'pngOnProcessing' => '0',
'pngOnUpload' => '0',
'pngParametersOnProcessing' => '-o2 %s',
'pngParametersOnUpload' => '-o2 %s',
'svgBinary' => 'svgo',
'svgCheck' => 'svg',
'svgOnUpload' => '0',
'svgParametersOnUpload' => '--pretty %s',
];

View file

@ -0,0 +1,8 @@
<?php
$GLOBALS['TYPO3_CONF_VARS']['GFX']['processor'] = 'ImageMagick';
$GLOBALS['TYPO3_CONF_VARS']['GFX']['im_version_5'] = 'im6';
$GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path'] = '/usr/bin/';
$GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path_lzw'] = $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path'];
$GLOBALS['TYPO3_CONF_VARS']['GFX']['processor_path'] = $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path'];
$GLOBALS['TYPO3_CONF_VARS']['GFX']['processor_path_lzw'] = $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path'];

View file

@ -0,0 +1,9 @@
<?php
$GLOBALS['TYPO3_CONF_VARS']['LOG']['das']['writerConfiguration'] = [
\TYPO3\CMS\Core\Log\LogLevel::DEBUG => [
\TYPO3\CMS\Core\Log\Writer\FileWriter::class => [
'logFile' => 'typo3temp/var/log/typo3_das.log',
],
],
];

View file

@ -0,0 +1,8 @@
<?php
$GLOBALS['TYPO3_CONF_VARS']['MAIL']['transport'] = 'smtp';
$GLOBALS['TYPO3_CONF_VARS']['MAIL']['transport_smtp_server'] = 'localhost:1025';
$GLOBALS['TYPO3_CONF_VARS']['MAIL']['transport_smtp_password'] = '';
$GLOBALS['TYPO3_CONF_VARS']['MAIL']['transport_smtp_username'] = '';
$GLOBALS['TYPO3_CONF_VARS']['MAIL']['transport_smtp_encrypt'] = false;
$GLOBALS['TYPO3_CONF_VARS']['MAIL']['transport_sendmail_command'] = '';

View file

@ -0,0 +1,54 @@
<?php
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserTSConfig('
options {
clearCache.system = 1
pageTree {
showPageIdWithTitle = 1
showDomainNameWithTitle = 1
showPathAboveMounts = 1
searchInAlias = 1
}
}
ADMPANEL {
enable.all = 1
}
');
$GLOBALS['TYPO3_CONF_VARS']['SYS']['clearCacheSystem'] = true;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['curlProxyServer'] = '';
$GLOBALS['TYPO3_CONF_VARS']['SYS']['curlProxyTunnel'] = false;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['proxy_host'] = '';
$GLOBALS['TYPO3_CONF_VARS']['SYS']['proxy_port'] = '';
$GLOBALS['TYPO3_CONF_VARS']['SYS']['trustedHostsPattern'] = '*';
if (isset($_SERVER['HTTP_HOST']) && is_null($_SERVER['HTTP_HOST']) === false) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['trustedHostsPattern'] = $_SERVER['HTTP_HOST'];
}
$GLOBALS['TYPO3_CONF_VARS']['BE']['sessionTimeout'] = 60 * 60 * 24 * 7; // To prevent csrf token from timeout
$GLOBALS['TYPO3_CONF_VARS']['BE']['lockSSL'] = true;
if (
(isset($_SERVER['SERVER_NAME']) && $_SERVER['SERVER_NAME'] === '127.0.0.1')
|| (isset($_SERVER['REQUEST_SCHEME']) && $_SERVER['REQUEST_SCHEME'] === 'http')
) {
$GLOBALS['TYPO3_CONF_VARS']['BE']['lockSSL'] = false;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['cookieSecure'] = false;
}
// Fix locale
if (isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['systemLocale']) && in_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['systemLocale'], ['de_DE.utf8'])) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['systemLocale'] = 'de_DE.UTF-8';
}
$GLOBALS['TYPO3_CONF_VARS']['FE']['versionNumberInFilename'] = false;
$GLOBALS['TYPO3_CONF_VARS']['BE']['versionNumberInFilename'] = false;
$GLOBALS['TYPO3_CONF_VARS']['BE']['installToolPassword'] = '$1$eItwKedf$13XVDVlAwXXMvO4DKw/YQ0';
$GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'] = '*.localhost DEVELOPMENT';
if (isset($GLOBALS['_SERVER']['HTTP_HOST'])) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'] = str_replace('dev.', '', $GLOBALS['_SERVER']['HTTP_HOST']) . ' DEVELOPMENT';
}

View file

@ -22,7 +22,7 @@
GREP_COLOR = "0;30;44";
TYPO3_CONTEXT = "Development/dsiepmann";
TYPO3_ADDITIONAL_CONFIGURATION = "/home/daniels/.dotfiles/configs/php/typo3/AdditionalConfiguration.inc.php";
TYPO3_ADDITIONAL_CONFIGURATION = "/home/daniels/.local/share/typo3-configuration/AdditionalConfiguration.inc.php";
PHAN_COLOR_SCHEME = "code";
# Reduce timeout after <ESC> (vi keybindings)