Feature #76723
closedComposer installation without symlinks
0%
Description
I’m trying to setup TYPO3 on the Microsoft Azure Platform as a so called App Service / Web App. This is a fully managed and highly scalable environment running a IIS on Windows. For security reasons there are no symlinks or junctions allowed.
Actual scenario:
- The whole project is versioned with GIT
- TYPO3, Templates and even project related extension are in the same repository
Because of the security related problem with the symlinks, I need to configure the composer.json like this:
{
"repositories": [
{
"type": "composer",
"url": "https://composer.typo3.org"
}
],
"require": {
"typo3/cms-composer-installers": "1.3.0-rc1",
"typo3/cms": "^7.0"
},
"extra": {
"typo3/cms": {
"prepare-web-dir": false,
"cms-package-dir": "{$vendor-dir}/typo3/cms",
"web-dir": "public"
}
}
}
This is working as intended, everything goes into the web-dir and no symlink is required. But the downside with this solution is, that every pre-existing folder / file like templates or extensions (web-dir/typo3conf/ext) are getting deleted.
When I’m trying it with the following settings:
{
"repositories": [
{
"type": "composer",
"url": "https://composer.typo3.org"
}
],
"require": {
"typo3/cms-composer-installers": "1.3.0-rc1",
"typo3/cms": "^7.0"
},
"extra": {
"typo3/cms": {
"cms-package-dir": "{$vendor-dir}/typo3/cms",
"web-dir": "public"
}
}
}
Composer stops with an exception because he can’t create symlinks. This is because of: https://github.com/TYPO3/CmsComposerInstallers/commit/7d5aea6148354169165642078e792cc76b359438
This was a patch which prevents composer from copying all related files/folders rather then trying to symlink. The problem is, that this patch is obviously necessary because a simple copy of the files / folders seems not to be enough to get TYPO3 up and running.
Does anyone have good solution for this type of problem? I’m currently a bit stuck with this. Maybe for the future it would be nice when the handling of the frontend and the backend request is done by simple rewrites, so it wouldn’t be necessary anymore to have a typo3 folder / symlink in the web-dir?
Updated by Benjamin Hirsch over 8 years ago
I accidentally added the wrong composer.json. The first one should look like this:
{
"repositories": [
{
"type": "composer",
"url": "https://composer.typo3.org"
}
],
"require": {
"typo3/cms-composer-installers": "1.3.0-rc1",
"typo3/cms": "^7.0"
},
"extra": {
"typo3/cms": {
"prepare-web-dir": false,
"cms-package-dir": "public",
"web-dir": "public"
}
}
}
Updated by Helmut Hummel over 8 years ago
every pre-existing folder / file like templates or extensions (web-dir/typo3conf/ext) are getting deleted.
Can you elaborate on that please?
Updated by Helmut Hummel over 8 years ago
- Status changed from Accepted to Needs Feedback
Updated by Helmut Hummel over 8 years ago
"cms-package-dir": "public",
"web-dir": "public"
Ah, well, this does not make sense and cannot work like that.
What you would need to do currently, is copy the typo3 folder, the index.php file and the vendor folder to the document root.
Make sure you deny access to vendor folder though for web requests.
Updated by Riccardo De Contardi about 8 years ago
- Status changed from Needs Feedback to Accepted
Updated by Benni Mack about 8 years ago
- Status changed from Accepted to Needs Feedback
Hey Benjamin,
the composer installer now allows to disable the symlinking process in order for you to set up your own configuration - does this solve your issue?
Updated by Helmut Hummel about 8 years ago
- Status changed from Needs Feedback to Accepted
@Benni Mack That is what he used already. The thing is, you can't copy the typo3 folder as it would not work
Updated by Benjamin Hirsch almost 8 years ago
I think Johannes Goslar is on the right track with it's changes:
https://github.com/ksjogo/CmsComposerInstallers/commit/5fe63bc9f0401581092854c416b70d7c21b6cd8c
plus additional changes (snippet of a batch file, because it's from it's Azure template)`
:: fix autoload paths for the entry points :: as these paths are different when not symlinked (why?) call replace "(\.\./)*vendor/autoload.php" "../../../../../../../vendor/autoload.php" web\typo3\sysext\backend\Resources\Private\Php\backend.php web\typo3\sysext\backend\Resources\Private\Php\cli.php web\typo3\sysext\frontend\Resources\Private\Php\frontend.php call replace "(\.\./)*vendor/autoload.php" "../../../../../vendor/autoload.php" web\typo3\sysext\install\Start\Install.php call replace "(\.\./)*vendor/autoload.php" "../../../../../vendor/autoload.php" web\typo3\sysext\core\bin\typo3 call replace "(\.\./)*vendor/autoload.php" "../../../vendor/autoload.php" web\typo3\install\index.php call replace "(\.\./)+vendor/autoload.php" "../../vendor/autoload.php" vendor\helhum\typo3-console\Scripts\typo3cms.php
@Helmut
The above listed paths should be the reason why simply copying fails.
Updated by Helmut Hummel over 7 years ago
- Status changed from Accepted to Resolved
This is now resolved with version 1.4.x of typo3/cms-composer-installers and the generation of entry scripts in TYPO3 master.
It would also be possible with a few lines of code, to make this work older TYPO3 versions