New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TYPO3 is no longer installed in vendor-dir #75
Comments
@helhum Can you please take a look at this? Not sure if it's a bug or intended. |
@stucki Hey. Thanks for your report. Since Previously typo3/cms was installed and then individual core extensions were symlinked to Now that we use the subtree split packages, these are installed directly into the place TYPO3 expects them, which is So, yes, current behavior is intended. |
Thanks for the feedback. Nevertheless, I'd see this as a missing feature then... |
Can you elaborate what exactly you miss? |
I'm not sure if I just don't understand the concept or if I'm unaware of any planned features, but the status right now seems to be less powerful compared to before: I would like to keep system extensions outside of the document root. It may not make a difference security-wise (because access was always possible via the symlink) but structure wise I like to have everything (or: as much as possible) that does not belong to my project in the vendor folder. |
Related to this, I have a second question: Like you mention, For example, https://forge.typo3.org/issues/83479 was fixed a few days ago in master, but Is there an easy way to regain this possibility without explicitely having to specify all system extensions? |
Well depends how you look at it.
I agree :)
I also agree. However TYPO3 still requires core extensions to be installed in typo3/sysext/. The power of the approach having everything directly installed in typo3/sysext/ is that we won't require any symlinks to be created any more. The code is just there where it needs to be, just like for third party extensions which were always installed in typo3conf/ext/ by composer installers. So yes, structure wise it isn't all too nice, but unavoidable when we want to avoid symlinks. |
Using branches indeed is a bit more complicated. However from a composer point of view it makes sense. If you need a package in a branch, add this package as branch version to your composer.json. In your case you could add In general, if you need a fix for a project, I would always prefer to use a composer patch plugin over having to pull in a branch with composer. |
Oh, and last thing. If you are concerned about security, with extension code being in document root, you may want to look at https://packagist.org/packages/helhum/typo3-secure-web You can use this with TYPO3 8 and higher and using this will get you a directory structure with document root only containing public assets. |
Hm, since I mentioned typo3-secure-web (which also uses symlinks to set up the document root), Shouldn't be too hard to do. Question would be. Should we do this by default (again having symlinks) or as option. I'll re-open this here for now. |
Thanks for the long answer.
I think there are no other drawbacks except this one.
Ok this will do, thanks. I'm still not too happy with it. I was hoping for a way to specifiy the version for all
Yes and no. The issue that I mentioned above breaks the backend for a new installation. It is definitely a bad end user experience if he expects to take a first look at the current master without being aware that this is actually 9.0 and not master...
Looks interesting, thanks! But according to the README, it doesn't work with TYPO3 version 9. So what is correct?
If we can provide better security by default then I'd go for this. I know that there were issues with symlinks and I had some of them too while using Linux in Docker on Windows. However, the easy fix for this could be a configuration flag to turn symlinks on or off without any further auto-detection. What do you think?
Thanks! |
There is no impact on security if typo3 extensions need to be in document root for TYPO3 to work, |
Here is the quote from the README: "While it would still be possible to require typo3/cms (the complete TYPO3 package) for TYPO3 version 8.7, it is not recommended any more and won't work with TYPO3 9." So it is all about the |
Configuration is always easy to implement but not simple for users. Every option you hand out needs to be know and understood. I would avoid configuration wherever possible. |
I gave this another thought and even started implementing some code, when I came (again) to the conclusion that every change would make the situation worse with no actual benefit. Here are the summarized reasons:
|
Regarding
While I see the practical benefit in having only one line to change to get a different version or branch, it was a huge burden in multiple areas, that you only were able to get everything, even if you needed a fraction of the TYPO3 packages. I'm sure we'll figure out something until 9LTS to make it easier to use branches, but for now you would need to change minimum-stablity to dev (which I wouldn't recommend without at the same time setting prefer-stable to true) or requiring dev branches for every package in your root composer.json |
Hey @stucki, there are quite some different issues in your ticket: a) typo3/cms is not working with dev-master or v9 anymore. The main feature (!) for composer-mode installations is that typo3 is not downloading nor installing e.g. workspaces if you don't need it, thus actually "requiring" it. b) Keeping as much as possible in the vendor/ dir - I agree. However, TYPO3 cannot handle this as of yet. We are aware but pushing on thing at a time. If you look at it with my argument above: now TYPO3 does not expose everything but only the required system extensions to the public anymore. Actually, for composer, it does not matter where they are put, as the vendor directory should not be exposed for your application, also not the location of your packages themselves. But for TYPO3 it still matters. I don't see why symlinking helps in any way to continue further down our road to only expose what we need, but only downsides we had with symlinks in the past. My personal goal for v9 LTS would be that all active extensions are in one place (e.g. typo3conf/ext/) no matter if they are sysexts or not. Once we figure out a "core" way to only have the public assets exposed in TYPO3 (don't get me wrong, helmuts secure-web is certainly great), which needs to fit to all systems (symlinking or not) and for non-composer mode, this is the best way we had in years. |
Hi @helhum, many thanks for your detailed answers. It took a few days for me to get back to this:
Sorry, I misunderstood. I was assuming you want to include the
I'm not sure if I got the point. To me it looks like replacing
Like I said, it's probably not a security problem, just inconsistency. Packages are usually installed in the vendor folder except if they are TYPO3 core parts or extensions... In the long term, I'd like to see TYPO3 having only index.php, resources and configuration in the document root, and the rest is stored entirely in vendor/. I'm aware that this is currently out of scope, however it feels like going one step back after we had stored
I appreciate that you focus on simplicity, however I don't see it as a problem to have a flag to control these things. Also I don't see too many other config options coming up...
True. But that could still be the case if everything is moved into the vendor folder and included from a single entry point. (Again, Composer provides a nice example for how this could work using the wrapper in
There's not much to say against this. The main point why I miss this is really just because of the structure. |
Hello @bmack, thanks for trying to clear things up!
That's clear, see my previous comment. This is indeed a nice feature.
True.
Indeed this would be nice to have. However, see my other comment: It would be even nicer if all extensions are stored in vendor/ just like it's done for any other package... Greetings, and thanks to both of you for sharing your thoughts! |
I just found this thread. Thanks for providing the information. I would like to update the documentation. Can you correct me, if I got anything wrong, I will try to summarize:
|
Correct
correct.
They will be installed directly into the directory where TYPO3 needs them, We got rid of symlinks and only install the packages (TYPO3 system extensions) required, not always all, like it was before.
Mid term plan is to "teach" TYPO3 to recognize extensions when they are located in vendor folder.
Not sure what you mean by that. Sounds wrong to me. First of all, I would not consider the above a "limitation".
|
Thanks for the answers. That was very helpful.
I was referring to a possible goal of moving things out of the web directory which do not have to be in the web directory and the goal of using vendor for TYPO3 system extensions (which would also move these out of the web directory). So there is some overlap between these goals and secure-web. But I admit the sentence was vague and not ideal. I will strike both sentences entirely:
About "limitations" which are not - I think it is amazing how much work has been done and how smooth the transition to Composer can actually be. I was also quite pleased that I could find a lot of information. Just needs to get updated in some places which I am currently trying to help with. |
You are very welcomome.
No worries, really. There are many things here that are intertwined and I'm trying to explain
That is one aspect. TYPO3 currently can not cope with that. It expects a directory structure This aspect is indeed tackled by helhum/typo3-secure-web, by providing a
This is another aspect. While being releated, it still is different. Both aspects are intertwined, because once TYPO3 recognizes extensions in the vendor folder One aspect cannot be solved without solving the other.
I think it is inevitable that both aspects will be tackled eventually. But yes, there is no date or version number for that.
helhum/typo3-secure-web can be used to additionally secure current TYPO3 versions, by only exposing public assets to the web directory |
That option has no use since the TYPO3 subtree split in v9: TYPO3/CmsComposerInstallers#75 (comment) Since this extension requires TYPO3 v9+, it can be safely removed.
According to 2d078ab, typo3/cms should always be installed in the vendor directory.
I just tried installing the latest master, but it installs TYPO3 into
{$web-dir}/typo3/
. In older versions, a symlink was created instead when I specifiedcms-package-dir
.According to the message in the commit above, this should now be the default. However it seems like this doesn't work as expected...
Here is my composer.json:
The text was updated successfully, but these errors were encountered: