Skip to content
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

fix for public file export path #338

Merged
merged 4 commits into from
Aug 2, 2023

Conversation

joshdentremont
Copy link
Contributor

When exporting the public files directory the tar was being created with the path /var/www/drupal/web/sites/default/files, and then when that dump was imported, it would be placed back at that location and duplicate the path. This meant files are being placed at /var/www/drupal/web/sites/default/files/var/www/drupal/web/sites/default/files.

This PR changes the path inside the exported dump to be ./ which will allow us to extract the files wherever we want.

To reproduce the issue:

  • Install a fresh starter site with make starter
  • check the files directory with docker-compose exec drupal with-contenv bash -lc 'ls /var/www/drupal/web/sites/default/files'
  • make drupal-public-files-dump DEST=files.tgz
  • make drupal-public-files-import SRC=files.tgz
  • docker-compose exec drupal with-contenv bash -lc 'ls /var/www/drupal/web/sites/default/files' again
    You should see that you now have your files duplicated at /var/www/drupal/web/sites/default/files/var/www/drupal/web/sites/default/files

To test this PR works:

  • add something to the files directory with docker-compose exec drupal with-contenv bash -lc 'touch /var/www/drupal/web/sites/default/files/test.txt'
  • docker-compose exec drupal with-contenv bash -lc 'ls /var/www/drupal/web/sites/default/files'
  • make drupal-public-files-dump DEST=files.tgz
  • remove the file with docker-compose exec drupal with-contenv bash -lc 'rm /var/www/drupal/web/sites/default/files/test.txt'
  • docker-compose exec drupal with-contenv bash -lc 'ls /var/www/drupal/web/sites/default/files'
  • make drupal-public-files-import SRC=files.tgz
  • docker-compose exec drupal with-contenv bash -lc 'ls /var/www/drupal/web/sites/default/files'
    You should see that your file was added back to the correct location from the import

@rosiel
Copy link
Contributor

rosiel commented May 24, 2023

During committers call, decided we can fix this but need an option to use the old behaviour, in case people have workflows set up that rely on it working as it does now.

@joshdentremont
Copy link
Contributor Author

This should now let you specify the path. For the old behaviour, set the variable in your .env to PUBLIC_FILES_TAR_DUMP_PATH=/var/www/drupal/web/sites/default/files

@aOelschlager aOelschlager self-requested a review June 28, 2023 17:30
Copy link
Contributor

@aOelschlager aOelschlager left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally got to testing this, sorry for the delay. I followed the testing pr instructions and it works. It's a few commits behind main but otherwise good to merge.

Copy link
Contributor

@aOelschlager aOelschlager left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ready to merge now. Thanks Josh!

@aOelschlager aOelschlager merged commit 8b7e11c into Islandora-Devops:development Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants