Drupal 10, the latest version of the open-source digital experience platform with even more features, is here.Tasks:
- #2876247: [meta] 3.0 release of Aegir Composer
- Include hosting_composer in the hostmaster makefile
Drush Make is being eventually going to be deprecated in favour of Composer. So, we should look at supporting Composer as an alternative to Drush Make for building platforms.
This article describes a workflow using drupal-composer/drupal-project. Part of the challenge here is that Drupal ends up installed in web/, but as far as I can tell, meta-data that would allow us to discover this isn't readily supplied, and appears hard-coded. Perhaps we could parse "installer-paths" or something, to figure this out.
Presumably, Composer-based installs could do things differently, and so we'd need a reasonably flexible solution to work with variations. In addition, drupal-composer/drupal-project appears to assume that the site will be installed into sites/default/, and hardcodes that as well, leaving /sites/default/settings.php world-writeable (i.e., mode 0600).
We should start looking into this, and perhaps suggest some changes to drupal-composer/drupal-project and similar projects to make them more flexible and secure.
| Comment | File | Size | Author |
|---|











Comments
Comment #2
ergonlogicbumping priority and tagging.
Comment #3
colanWe should probably use the official upstream source at Using Composer to install Drupal packages through Drupal.org.
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedModern Distributions, like Open Social are already using Composer to install packages, and don't use a Make file anymore.
I am not that technical, but I would love to help testing Composer builds in Aegir.
Comment #5
muschpusch CreditAttribution: muschpusch at Factorial GmbH commentedThere two problems right now:
a.) Installing a drupal composer based distribution by using the aegir frontend isn't possible right now.
b.) It's not possible to install a site which is using a drupal composer based code base at all. Which means there is no manual workaround for a.)
I would call b.) a critical issue when supporting D8 even though the discussion is huge. Composer is the standard in the php community, vanilla drupal is not using composer the way it should be used, drupal composer is. #1475510: Remove external dependencies from the core repo and let Composer manage the dependencies instead There is a lot progress in the composer integration issues and i must admit that i stopped following it since everything seems to work fine.
@ergonlogic that drupal composer assumes the installed site in sites/default doesn't need mean that it doesn't support a multi site setup. At least i couldn't find a reason why that wouldn't possible. IMHO. The actual sites/SOMESITE or DEFAULT shouldn't be part of the version control system and shouldn't be deployed when installing the platform anyways.
Isn't the main problem here: #2770077: RFC: Refactor how Aegir installs Drupal. which is already worked on?
Comment #6
helmo CreditAttribution: helmo as a volunteer and at Initfour websolutions for Aegir Cooperative commentedOne work around that should always be possible is to let composer create the platform tree by calling it manually, and then add that dir as a platform to Aegir, or re-verify if already added as platform.
Comment #7
Anonymous (not verified) CreditAttribution: Anonymous commenteda.) That's what this issue is about. Add de possibility to build a platform based on Composer, not on a Make-file or GIT
b.) I did some test with the social distribution, and I can install sites based on a composer based platform. This is my workflow.
1) Download Core
2) Download the profile in de /profiles/directory (profiles/social)
3) drush dl composer_manager
4) php modules/composer_manager/scripts/init.php
5) composer drupal-update
6) composer dump-autoload
This platform verifies, and I can install sites from this platform. As far as I understood 'composer_manager' is deprecated.
If I can be of any help regarding this issue, let me know.
Comment #8
helmo CreditAttribution: helmo as a volunteer and at Initfour websolutions for Aegir Cooperative commentedI saw that the social distro also offers to install via a composer template in https://github.com/goalgorilla/social_template
This does download all the stuff in a 'html' sub-directory of the one you specify.
Comment #9
8thom CreditAttribution: 8thom as a volunteer commentedA possible option to support composer builds is to implement a build artifact repository.
You'd need a way to build out the source repo with a task runner like Jenkins or possibly a cloud CI platform like travis or circle, but at least the source repo could only contain your custom code + a composer.json referencing all dependences.
Docman is a project I was introduced to @ Drupalcon Dublin which might help with building this artifact repository -- https://github.com/Adyax/docman
Comment #10
mengi CreditAttribution: mengi commentedThis would be fantastic as Drupal Commerce 8-2.x now requires Composer.
This blog states that Composer Manager is deprecated and should not be used.
Comment #11
ergonlogicWe're converging on a solution to #2838489: Support drupal being in a subdirectory of a git repo. The attached patch then allows a git repo, built from a template like the one mentioned in #8, to run
composer install, to build the dependencies for the platform.While this patch add Composer support to hosting_git, it's actually pretty self-contained. The use of
composer create-projectis certainly interesting though, and shouldn't be much different in implementation to this patch. They could perhaps be bundled into ahosting_composercontrib module.Comment #12
gusaus CreditAttribution: gusaus commentedFWIW there's some recent documentation on how to install Open Social that may be relevant to this issue.
https://www.getopensocial.com/blog/installing-open-social-with-composer
Comment #13
colan#11 looks reasonable, but needs testing.
Comment #14
helmo CreditAttribution: helmo as a volunteer and at Initfour websolutions for Aegir Cooperative commented@ergonlogic after #11 you created https://www.drupal.org/project/hosting_composer ... does that replace this path? In that case this issue could be re-purposed to include hosting_composer as golden contrib.
Comment #15
c_archer CreditAttribution: c_archer as a volunteer and commentedOkay so Patch #11 does work for me, I was able to:
When I went to add a site I could not see the install profile for this platform, I had to move it out of the folder
html/profiles/contrib/tohtml/profiles/I then re-verified the platform and I could install the site.
I also tried the hosting_composer module but I could not work out how to get it working from git.
Comment #16
c_archer CreditAttribution: c_archer as a volunteer and commentedComment #17
c_archer CreditAttribution: c_archer as a volunteer and commentedThe other issue I've found is when ever I try and access an admin page I am redirected to the site's homepage. I can, however, access the user pages and site none admin pages seems to be anything that as admin/ in the URL.
Comment #18
c_archer CreditAttribution: c_archer as a volunteer and commentedI did wonder if this was the issue: https://learn.omega8.cc/how-to-disable-the-admin-url-protection-276 but it appears not
Comment #19
colanComment #20
ergonlogicI believe that hosting_composer is a better solution than this patch, as it also supports
composer create-project.See #2884048: Unite with hosting_git? and comment #5 onward for more context.
So, #2876247: [meta] 3.0 release of Aegir Composer is, imo, the way forward here.
Comment #21
helmo CreditAttribution: helmo as a volunteer and at Initfour websolutions for Aegir Cooperative commentedUpdated summary ...
Hiding the patch here as there seems to be consensus on going with hosting_composer instead
Comment #22
Jon PughSee #2937147: Add Composer support directly to Provision.