Browse Source

adapt to the new docker system, cloning the full typo3 instance and using it as volume

Olivier Massot 4 years ago
parent
commit
1c73ae21d8

+ 23 - 0
doc/docker.md

@@ -0,0 +1,23 @@
+# Instance docker
+
+Un container est créé sous le nom de 'typo3'.
+
+## Architecture 
+
+
+## Répliquer l'instance Typo3 de la prod vers docker
+
+Accéder en SSH au serveur preprod, et lancer:
+
+    cd /var/www/typo3
+    tar cvzf ./typo3_install.tar.gz . --exclude='./public/fileadmin/user_upload' --exclude='./archive' --exclude='./public/fileadmin/_processed_' --exclude='./var/log/*.log'
+
+Télécharger l'archive.
+
+Se placer ensuite à la racine de votre projet [docker](https://gitlab.2iopenservice.com/vincent/docker), et exécuter:
+
+    tar xvzf ./apps/ot_typo3/docker/typo3/typo3_install.tar.gz -C ./apps/ot_typo3/docker/typo3
+
+
+## Configurer le serveur sur Phpstorm
+

+ 0 - 1
docker/.gitignore

@@ -1 +0,0 @@
-/.idea/

+ 8 - 0
docker/clone-install.sh

@@ -0,0 +1,8 @@
+
+# Compress the typo3 install on preprod, download it and extract it here, in a typo3 subdir
+ssh exploitation@preprod cd /var/www/typo3 & tar cvzf ./typo3_install.tar.gz . --exclude=/var/www/typo3/public/fileadmin/user-upload --exclude=/var/www/typo3/archive --exclude=/var/www/typo3/public/fileadmin/_processed_
+scp exploitation@preprod:/var/www/typo3/typo3_install.tar.gz ./docker
+cd ./docker || exit
+tar xvzf typo3_install.tar.gz
+rm typo3_install.tar.gz
+cd ..

+ 0 - 19
docker/conf/AdditionalConfiguration.php

@@ -1,19 +0,0 @@
-<?php
-
-if (\TYPO3\CMS\Core\Core\Environment::getContext()->isDevelopment()) {
-    $GLOBALS['TYPO3_CONF_VARS']['BE']['debug'] = '1';
-    $GLOBALS['TYPO3_CONF_VARS']['FE']['debug'] = '1';
-    $GLOBALS['TYPO3_CONF_VARS']['SYS']['enable_DLOG'] = '1';
-    $GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask'] = '*';
-    $GLOBALS['TYPO3_CONF_VARS']['SYS']['displayErrors'] = '1';
-    $GLOBALS['TYPO3_CONF_VARS']['SYS']['enableDeprecationLog'] = '';
-    $GLOBALS['TYPO3_CONF_VARS']['SYS']['sqlDebug'] = '1';
-    $GLOBALS['TYPO3_CONF_VARS']['SYS']['systemLogLevel'] = '0';
-    $GLOBALS['TYPO3_CONF_VARS']['SYS']['exceptionalErrors'] = '28674';
-}
-
-$GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride']['EXT:flux/Resources/Private/Language/locallang.xlf'][0] = 'typo3conf/LFEditor/OverrideFiles/flux/Resources/Private/Language/locallang.xml';
-$GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride']['EXT:core/Resources/Private/Language/locallang_mod_web_list.xlf'][0] = 'typo3conf/LFEditor/OverrideFiles/core/Resources/Private/Language/locallang_mod_web_list.xml';
-$GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride']['EXT:tstemplate/Resources/Private/Language/locallang_info.xlf'][0] = 'typo3conf/LFEditor/OverrideFiles/tstemplate/Resources/Private/Language/locallang_info.xml';
-$GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride']['EXT:frontend/Resources/Private/Language/locallang_tca.xlf'][0] = 'typo3conf/LFEditor/OverrideFiles/frontend/Resources/Private/Language/locallang_tca.xml';
-$GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride']['EXT:core/Resources/Private/Language/locallang_core.xlf'][0] = 'typo3conf/LFEditor/OverrideFiles/core/Resources/Private/Language/locallang_core.xml';

+ 0 - 192
docker/conf/LocalConfiguration.php

@@ -1,192 +0,0 @@
-<?php
-return [
-    'BE' => [
-        'compressionLevel' => '5',
-        'debug' => true,
-        'enabledBeUserIPLock' => false,
-        'installToolPassword' => '$argon2i$v=19$m=65536,t=16,p=1$Z2NIbFRRVlVYZHhoaEUuMg$88qbJUyQLt7mgO0AhyVZIEzLWlX72oJ9oHuvzQHhYBM',
-        'interfaces' => 'backend',
-        'lockIP' => '0',
-        'loginSecurityLevel' => 'normal',
-        'passwordHashing' => [
-            'className' => 'TYPO3\\CMS\\Core\\Crypto\\PasswordHashing\\Argon2iPasswordHash',
-            'options' => [],
-        ],
-        'sessionTimeout' => '65000',
-        'showRefreshLoginPopup' => true,
-        'versionNumberInFilename' => '0',
-    ],
-    'DB' => [
-        'Connections' => [
-            'Default' => [
-                'charset' => 'utf8',
-                'dbname' => 'typo3',
-                'driver' => 'mysqli',
-                'host' => 'db',
-                'initCommands' => '',
-                'password' => 'mysql660',
-                'user' => 'root',
-            ],
-        ],
-        'extTablesDefinitionScript' => 'extTables.php',
-    ],
-    'EXT' => [
-        'extConf' => [
-            'backend' => 'a:6:{s:9:"loginLogo";s:0:"";s:19:"loginHighlightColor";s:0:"";s:20:"loginBackgroundImage";s:0:"";s:13:"loginFootnote";s:0:"";s:11:"backendLogo";s:0:"";s:14:"backendFavicon";s:0:"";}',
-            'extensionmanager' => 'a:2:{s:21:"automaticInstallation";s:1:"1";s:11:"offlineMode";s:1:"0";}',
-            'flux' => 'a:7:{s:9:"debugMode";s:1:"0";s:8:"doktypes";s:5:"0,1,4";s:12:"handleErrors";s:1:"0";s:8:"autoload";s:1:"1";s:11:"plugAndPlay";s:1:"0";s:20:"plugAndPlayDirectory";s:6:"design";s:33:"pagesLanguageConfigurationOverlay";s:1:"0";}',
-            'frontend_editing' => 'a:3:{s:11:"seoProvider";s:4:"none";s:29:"contentEditableWrapperTagName";s:3:"div";s:18:"enablePlaceholders";s:1:"0";}',
-            'lfeditor' => 'a:9:{s:13:"viewLanguages";s:0:"";s:15:"defaultLanguage";s:0:"";s:11:"searchRegex";s:60:"/^([a-z0-9_]*locallang[a-z0-9_-]*\\.(php|xml)|[^\\.]*\\.xlf)$/i";s:9:"extIgnore";s:23:"/^(CVS|.svn|.git|csh_)/";s:12:"extWhitelist";s:0:"";s:13:"changeXlfDate";s:1:"1";s:17:"editModeExtension";s:1:"1";s:27:"pathAdditionalConfiguration";s:37:"typo3conf/AdditionalConfiguration.php";s:16:"beMainModuleName";s:4:"user";}',
-            'news' => 'a:18:{s:13:"prependAtCopy";s:1:"1";s:6:"tagPid";s:1:"1";s:12:"rteForTeaser";s:1:"0";s:22:"contentElementRelation";s:1:"1";s:21:"contentElementPreview";s:1:"1";s:13:"manualSorting";s:1:"0";s:19:"categoryRestriction";s:0:"";s:34:"categoryBeGroupTceFormsRestriction";s:1:"0";s:19:"dateTimeNotRequired";s:1:"0";s:11:"archiveDate";s:4:"date";s:12:"mediaPreview";s:5:"false";s:20:"advancedMediaPreview";s:4:"true";s:13:"slugBehaviour";s:6:"unique";s:24:"showAdministrationModule";s:1:"1";s:35:"hidePageTreeForAdministrationModule";s:1:"0";s:12:"showImporter";s:1:"0";s:18:"storageUidImporter";s:1:"1";s:22:"resourceFolderImporter";s:12:"/news_import";}',
-            'scheduler' => 'a:2:{s:11:"maxLifetime";s:4:"1440";s:15:"showSampleTasks";s:1:"1";}',
-            'vhs' => 'a:1:{s:20:"disableAssetHandling";s:1:"0";}',
-        ],
-    ],
-    'EXTCONF' => [
-        'lang' => [
-            'availableLanguages' => [
-                'fr',
-            ],
-        ],
-    ],
-    'EXTENSIONS' => [
-        'backend' => [
-            'backendFavicon' => '',
-            'backendLogo' => '',
-            'loginBackgroundImage' => '',
-            'loginFootnote' => '',
-            'loginHighlightColor' => '',
-            'loginLogo' => '',
-        ],
-        'extensionmanager' => [
-            'automaticInstallation' => '1',
-            'offlineMode' => '0',
-        ],
-        'flux' => [
-            'autoload' => '1',
-            'debugMode' => '0',
-            'doktypes' => '0,1,4',
-            'handleErrors' => '0',
-            'pagesLanguageConfigurationOverlay' => '0',
-            'plugAndPlay' => '0',
-            'plugAndPlayDirectory' => 'design',
-        ],
-        'frontend_editing' => [
-            'contentEditableWrapperTagName' => 'div',
-            'enablePlaceholders' => '0',
-            'seoProvider' => 'none',
-        ],
-        'lfeditor' => [
-            'beMainModuleName' => 'user',
-            'changeXlfDate' => '1',
-            'defaultLanguage' => '',
-            'editModeExtension' => '1',
-            'extIgnore' => '/^(CVS|.svn|.git|csh_)/',
-            'extWhitelist' => '',
-            'pathAdditionalConfiguration' => 'typo3conf/AdditionalConfiguration.php',
-            'searchRegex' => '/^([a-z0-9_]*locallang[a-z0-9_-]*\\.(php|xml)|[^\\.]*\\.xlf)$/i',
-            'viewLanguages' => '',
-        ],
-        'news' => [
-            'advancedMediaPreview' => 'true',
-            'archiveDate' => 'date',
-            'categoryBeGroupTceFormsRestriction' => '0',
-            'categoryRestriction' => '',
-            'contentElementPreview' => '1',
-            'contentElementRelation' => '1',
-            'dateTimeNotRequired' => '0',
-            'hidePageTreeForAdministrationModule' => '0',
-            'manualSorting' => '0',
-            'mediaPreview' => 'false',
-            'prependAtCopy' => '1',
-            'resourceFolderImporter' => '/news_import',
-            'rteForTeaser' => '0',
-            'showAdministrationModule' => '1',
-            'showImporter' => '0',
-            'slugBehaviour' => 'unique',
-            'storageUidImporter' => '1',
-            'tagPid' => '1',
-        ],
-        'scheduler' => [
-            'maxLifetime' => '1440',
-            'showSampleTasks' => '1',
-        ],
-        'vhs' => [
-            'disableAssetHandling' => '0',
-        ],
-    ],
-    'FE' => [
-        'compressionLevel' => 5,
-        'debug' => true,
-        'disableNoCacheParameter' => '0',
-        'pageNotFoundOnCHashError' => '0',
-        'passwordHashing' => [
-            'className' => 'TYPO3\\CMS\\Core\\Crypto\\PasswordHashing\\Argon2iPasswordHash',
-            'options' => [],
-        ],
-    ],
-    'GFX' => [
-        'jpg_quality' => '96',
-        'processor' => 'GraphicsMagick',
-        'processor_allowTemporaryMasksAsPng' => false,
-        'processor_colorspace' => 'RGB',
-        'processor_effects' => false,
-        'processor_enabled' => true,
-        'processor_path' => '/usr/bin/',
-        'processor_path_lzw' => '/usr/bin/',
-    ],
-    'HTTP' => [],
-    'INSTALL' => [],
-    'LOG' => [
-        'TYPO3' => [
-            'CMS' => [
-                'deprecations' => [
-                    'writerConfiguration' => [
-                        5 => [
-                            'TYPO3\CMS\Core\Log\Writer\FileWriter' => [
-                                'disabled' => false,
-                            ],
-                        ],
-                    ],
-                ],
-            ],
-        ],
-    ],
-    'MAIL' => [
-        'defaultMailFromAddress' => 'ne_pas_repondre@opentalent.fr',
-        'transport' => 'sendmail',
-        'transport_sendmail_command' => ' -t -i ',
-        'transport_smtp_encrypt' => '',
-        'transport_smtp_password' => '',
-        'transport_smtp_server' => '',
-        'transport_smtp_username' => '',
-    ],
-    'SYS' => [
-        'UTF8filesystem' => '1',
-        'belogErrorReporting' => 30711,
-        'caching' => [
-            'cacheConfigurations' => [
-                'extbase_object' => [
-                    'backend' => 'TYPO3\\CMS\\Core\\Cache\\Backend\\ApcBackend',
-                    'frontend' => 'TYPO3\\CMS\\Core\\Cache\\Frontend\\VariableFrontend',
-                    'groups' => [
-                        'system',
-                    ],
-                    'options' => [
-                        'defaultLifetime' => 0,
-                    ],
-                ],
-            ],
-        ],
-        'cookieDomain' => 'opentalent.fr',
-        'devIPmask' => '*',
-        'displayErrors' => 1,
-        'encryptionKey' => 'ed7ad07c97e4703bd18aaad78071be42',
-        'exceptionalErrors' => 12290,
-        'fileCreateMask' => '2660',
-        'folderCreateMask' => '2770',
-        'sitename' => 'Opentalent',
-        'systemLocale' => 'fr_FR.UTF-8',
-        'systemLogLevel' => 0,
-    ],
-];

+ 0 - 69
docker/conf/composer.json

@@ -1,69 +0,0 @@
-{
-	"repositories": [
-		{ "type": "composer", "url": "https://composer.typo3.org/" }
-	],
-	"name": "typo3/cms-base-distribution",
-	"description" : "TYPO3 CMS Base Distribution",
-	"license": "GPL-2.0-or-later",
-	"config": {
-		"platform": {
-			"php": "7.4"
-		}
-	},
-	"require": {
-		"typo3/cms-about": "^9.5",
-		"typo3/cms-adminpanel": "^9.5",
-		"typo3/cms-backend": "^9.5",
-		"typo3/cms-belog": "^9.5",
-		"typo3/cms-beuser": "^9.5",
-		"typo3/cms-core": "^9.5",
-		"typo3/cms-extbase": "^9.5",
-		"typo3/cms-extensionmanager": "^9.5",
-		"typo3/cms-felogin": "^9.5",
-		"typo3/cms-filelist": "^9.5",
-		"typo3/cms-filemetadata": "^9.5",
-		"typo3/cms-fluid": "^9.5",
-		"typo3/cms-fluid-styled-content": "^9.5",
-		"typo3/cms-form": "^9.5",
-		"typo3/cms-frontend": "^9.5",
-		"typo3/cms-info": "^9.5",
-		"typo3/cms-install": "^9.5",
-		"typo3/cms-lowlevel": "^9.5",
-		"typo3/cms-recycler": "^9.5",
-		"typo3/cms-redirects": "^9.5",
-		"typo3/cms-reports": "^9.5",
-		"typo3/cms-rte-ckeditor": "^9.5",
-		"typo3/cms-scheduler": "^9.5",
-		"typo3/cms-seo": "^9.5",
-		"typo3/cms-setup": "^9.5",
-		"typo3/cms-t3editor": "^9.5",
-		"typo3/cms-tstemplate": "^9.5",
-		"fluidtypo3/flux": "^9.4",
-		"fluidtypo3/vhs": "^6.0",
-		"georgringer/news": "^8.4",
-		"helhum/typo3-console": "^5.7",
-		"causal/image_autoresize": "^2.0",
-		"friendsoftypo3/frontend-editing": "^1.9",
-		"sgalinski/lfeditor": "^6.0",
-		"twig/twig": "^3.3"
-	},
-	"scripts":{
-		"typo3-cms-scripts": [
-			"typo3cms install:fixfolderstructure",
-			"typo3cms install:generatepackagestates"
-		],
-		"post-autoload-dump": [
-			"@typo3-cms-scripts"
-		]
-	},
-	"autoload": {
-		"psr-4": {
-			"Opentalent\\OtCore\\": "public/typo3conf/ext/ot_core/Classes",
-			"Opentalent\\OtConnect\\": "public/typo3conf/ext/ot_connect/Classes",
-			"Opentalent\\OtTemplating\\": "public/typo3conf/ext/ot_templating/Classes",
-			"Opentalent\\OtAdmin\\": "public/typo3conf/ext/ot_admin/Classes",
-			"Opentalent\\OtStats\\": "public/typo3conf/ext/ot_stats/Classes",
-			"Opentalent\\OtOptimizer\\": "public/typo3conf/ext/ot_optimizer/Classes"
-		}
-	}
-}

BIN
docker/conf/sites.tar.gz


+ 5 - 0
docker/readme.md

@@ -0,0 +1,5 @@
+# Docker
+
+This folder will hold the /var/www/typo3 volume of the typo3 docker.
+
+> [See the documentation](../doc/docker.md)

+ 1 - 0
docker/typo3/.gitignore

@@ -0,0 +1 @@
+*

+ 6 - 2
ot_admin/Classes/Controller/SiteController.php

@@ -1785,8 +1785,12 @@ class SiteController extends ActionController
         }
         catch (\Throwable $e) {
             // rollback
-            $this->rrmdir($configRootDir);
-            rename($backupConfigDir, $configRootDir);
+            if (!file_exists($configRootDir)) {
+                $this->rrmdir($configRootDir);
+            };
+            if (!file_exists($backupConfigDir)) {
+                rename($backupConfigDir, $configRootDir);
+            }
             $this->connectionPool->getConnectionByName('Default')->rollback();
             throw $e;
         }