The way aegir handles writing the files folders is not flexible. The settings.php template actually hard codes /sites/domain.com/files right in the template. To change a site's files folder, you would have to write an entirely new template, then figure out how to get provision to use it.

This branch will make the important Drupal settings for files full context properties so they can be overwritten in the future.

This will allow an add-on module to be created to allow sites to customize their own files folder, and makes it possible to manually edit a site context's file_public_path property, if they would like.

Update

See Patch here:
https://git.drupalcode.org/project/provision/compare/7.x-3.x...3016995-f...

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jon Pugh created an issue. See original summary.

Jon Pugh’s picture

  • Jon Pugh committed 223154d on 3016995-file-path-properties
    Issue #3016995: Make file directories first class context properties
    

  • Jon Pugh committed 7faa6e9 on 3016995-file-path-properties
    Issue #3016995: Make file directories first class context properties
    
Jon Pugh’s picture

Issue summary: View changes
Jon Pugh’s picture

FileSize
5.57 KB
helmo’s picture

Nice, that reads better :)

tucho’s picture

Hi @Jon Pugh !

I made the attached patch against the last commit of the 3016995-file-path-properties branch.

It correct one of the paths that you have changed in previous commits: The one that was sites/$url/files/tmp and the directories for the config syncronization.

I think that another thing that you be modified is the synchronization of the files from the web servers to the hostmaster when a backup is made (or before a migration). Currently this is taken care in the provision_drupal_fetch_site function.

colan’s picture

Status: Active » Needs review

  • Jon Pugh committed 64675cc on 3016995-file-path-properties authored by tucho
    Issue #3016995 by tucho: Make file directories first class context...
Jon Pugh’s picture

  • Jon Pugh committed eca3b84 on 3016995-file-path-properties
    Issue #3016995 by Jon Pugh: Make file directories first class context...
Jon Pugh’s picture

THANK YOU tucho...

Let's get this reviewed and merged?

I'm going to include it in the devshop-7.x-3.x branch so that we start using it right away.

Jon Pugh’s picture

Issue tags: +devshop patches
helmo’s picture

I've not been able to fully test this, but it looks OK. Probably ok to commit and verify before the next release.

Jon Pugh’s picture

Let's make sure to fully test it. :)

I'm about to add a commit to drush_provision_drupal_provision_delete(), now that files paths can be outside of site root, they need to be explicitly deleted.

Jon Pugh’s picture

There's also some code for hosting coming through.

  • Jon Pugh committed 3afb269 on 3016995-file-path-properties
    Issue #3016995 by Jon Pugh: Make file directories first class context...
  • Jon Pugh committed 40fe036 on 3016995-file-path-properties
    Issue #3016995 by Jon Pugh: Make file directories first class context...
Jon Pugh’s picture

Issue summary: View changes
Jon Pugh’s picture

Added Hosting schema, form elements, Hosting settings checkbox for "Allow sites to have custom file paths for public, private, and temporary files.".

Works great!

Screenshot of files settings form.

josebc’s picture

Status: Needs review » Needs work

Nice work on this, is testing on remote cluster and its not syncing the path to remotes
im trying something like "sites/something/files"
Maybe we need to change something in provision_drupal_push_site??

    // Sync all filesystem changes to the remote server.
    d()->service('http')->sync(d()->site_path, $options);
Jon Pugh’s picture

Still seems to change ownership of sites/folder files still.

  • Jon Pugh committed ee5684c on 3016995-file-path-properties
    Issue #3016995 by Jon Pugh, tucho: Make file directories first class...
Jon Pugh’s picture

This new feature should implement the new sync path hook, since the files can now live outside of the root as well: #3016995: Make file directories first class context properties.

Jon Pugh’s picture

Status: Needs work » Needs review

Can we identify what is blocking this from moving forward?

froboy’s picture

@jon-pugh I've tested merging this into master and ran into a few conflicts. I'm not sure what the best way to make changes is since this is a branch and not a patch.

  • Two D9 support commits in provision_drupal_settings_8.tpl.php are conflicting: config_sync_directory and file_temp_path. Those are trivial resolutions.
  • In that same file config_sync_directory should probably have its own option now too?
  • platform/provision_drupal.drush.inc has... a lot of conflicts.

  • Jon Pugh committed 223154d on 7.x-4.x
    Issue #3016995: Make file directories first class context properties
    
  • Jon Pugh committed 3afb269 on 7.x-4.x
    Issue #3016995 by Jon Pugh: Make file directories first class context...
  • Jon Pugh committed 40fe036 on 7.x-4.x
    Issue #3016995 by Jon Pugh: Make file directories first class context...
  • Jon Pugh committed 64675cc on 7.x-4.x authored by tucho
    Issue #3016995 by tucho: Make file directories first class context...
  • Jon Pugh committed 7faa6e9 on 7.x-4.x
    Issue #3016995: Make file directories first class context properties
    
  • Jon Pugh committed eca3b84 on 7.x-4.x
    Issue #3016995 by Jon Pugh: Make file directories first class context...
  • Jon Pugh committed f80b28f on 7.x-4.x
    Issue #3016995 by Jon Pugh, tucho: Make file directories first class...
Jon Pugh’s picture

The config sync dir is very often used by developers and managed in the same git repo as the site codebase. Common practice is to put it in the git root, ./config/sync.

I don't agree this should be put in settings.php by default. The decisions should be cognizant that not everyone will use multisite, not everyone will want to use sites/DOMAIN.COM folders.

I am moving forward on the 4.x branch and will likely not merge any additional changes FROM 3.x.

There have been too many changes to 3.x I don't agree with so I'm moving all my work to 4.x.

  • Jon Pugh committed 223154d on 7.x-3.x
    Issue #3016995: Make file directories first class context properties
    
  • Jon Pugh committed 3afb269 on 7.x-3.x
    Issue #3016995 by Jon Pugh: Make file directories first class context...
  • Jon Pugh committed 40fe036 on 7.x-3.x
    Issue #3016995 by Jon Pugh: Make file directories first class context...
  • Jon Pugh committed 64675cc on 7.x-3.x authored by tucho
    Issue #3016995 by tucho: Make file directories first class context...
  • Jon Pugh committed 7faa6e9 on 7.x-3.x
    Issue #3016995: Make file directories first class context properties
    
  • Jon Pugh committed eca3b84 on 7.x-3.x
    Issue #3016995 by Jon Pugh: Make file directories first class context...
  • Jon Pugh committed f80b28f on 7.x-3.x
    Issue #3016995 by Jon Pugh, tucho: Make file directories first class...

  • Jon Pugh committed 08f3fc9a on 7.x-4.x
    Issue #3016995: Make file directories first class context properties
    

  • Jon Pugh committed 08f3fc9a on 2953349-drush9-composer
    Issue #3016995: Make file directories first class context properties
    
Jon Pugh’s picture

Status: Needs review » Fixed
Issue tags: -

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.