Search code examples
dockercomposer-phptypo3-9.xddev

TYPO3 setup issue with Composer + Distribution Package + helhum/typo3-secure-web


We are facing an issue with distribution package composer. Our goal is to achieve DDEV + Composer + Distribution Package + helhum/typo3-secure-web (thx a ton @helhum for such great security solution).

Problem/Issue

When trying to access backend then it does not work, Check this screenshot https://i.sstatic.net/9JwvY.png with CSS/JS is not accessible, seems some directory structure (private/public) cause issue.

Setup Approach

Step 1: Create a project's folder

mkdir my-typo3-site
cd my-typo3-site

Step 2: Configure PHP version

ddev config --project-type php --php-version 7.2

Step 3: Setup TYPO3 latest version

ddev composer create typo3/cms-base-distribution ^9 --no-interaction
ddev config --project-type typo3
ddev start

Step 5: Composer.json, Setup private and public folders

"extra": {
   "typo3/cms": {
       "root-dir": "private",
       "web-dir": "public"
   }
}

Step 4: Secure your TYPO3 with folder structure private and public

ddev composer require helhum/typo3-secure-web

Step 5: Create FIRST_INSTALL file

touch private/FIRST_INSTALL

Step 6: TYPO3 Installation Wizard (successfully)

Composer

The composer code which is generated by typo3/cms-base-distribution ^9

{
    "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.2"
        }
    },
    "require": {
        "helhum/typo3-console": "^5.5.5",
        "typo3/minimal": "^9.5",
        "typo3/cms-about": "^9.5",
        "typo3/cms-adminpanel": "^9.5",
        "typo3/cms-belog": "^9.5",
        "typo3/cms-beuser": "^9.5",
        "typo3/cms-felogin": "^9.5",
        "typo3/cms-fluid-styled-content": "^9.5",
        "typo3/cms-form": "^9.5",
        "typo3/cms-impexp": "^9.5",
        "typo3/cms-info": "^9.5",
        "typo3/cms-redirects": "^9.5",
        "typo3/cms-reports": "^9.5",
        "typo3/cms-rte-ckeditor": "^9.5",
        "typo3/cms-setup": "^9.5",
        "typo3/cms-seo": "^9.5",
        "typo3/cms-sys-note": "^9.5",
        "typo3/cms-t3editor": "^9.5",
        "typo3/cms-tstemplate": "^9.5",
        "typo3/cms-viewpage": "^9.5",
        "helhum/typo3-secure-web": "^0.2.8"
    },
    "scripts":{
        "typo3-cms-scripts": [
            "typo3cms install:fixfolderstructure",
            "typo3cms install:generatepackagestates"
        ],
        "post-autoload-dump": [
            "@typo3-cms-scripts"
        ]
    },
    "extra": {
        "typo3/cms": {
            "root-dir": "private",
            "web-dir": "public"
        }
    }
}

Notes

Everything works well with ddev composer require typo3/minimal:^9 It only causes an issue with distribution package.

What could be a problem with the distribution package? I would appreciate your feedback. Thanks a lot for your time!


Solution

  • Hurray, just resolved the issue! It's just a matter of changing/following orders as follows:

    Step 1: Create a project's folder
    Step 2: Configure PHP version
    Step 3: Composer distribution package
    Step 4: Create FIRST_INSTALL file
    Step 5: TYPO3 Installation Wizard
    Step 6: Composer.json, Setup private and public folders
    Step 7: Secure your TYPO3 with folder structure private and public
    Step 7: ddev composer require helhum/typo3-secure-web
    

    Hurray! Once again, Thanks @Helhum for such great secure TYPO3 solution :)

    InspirePeopleToSecure

    Cheers,

    Sanjay