Same filename in this branch
  1. 10 modules/README.txt
  2. 10 profiles/README.txt
  3. 10 sites/README.txt
  4. 10 themes/README.txt
  5. 10 composer/Metapackage/README.txt
  6. 10 composer/Template/README.txt
  7. 10 core/lib/README.txt
  8. 10 composer/Plugin/VendorHardening/README.txt
  9. 10 core/assets/scaffold/README.txt
  10. 10 core/themes/stable9/README.txt
  11. 10 core/themes/stark/README.txt
  12. 10 core/lib/Drupal/Component/README.txt
  13. 10 core/lib/Drupal/Core/README.txt
  14. 10 core/lib/Drupal/Component/Annotation/README.txt
  15. 10 core/lib/Drupal/Component/Assertion/README.txt
  16. 10 core/lib/Drupal/Component/ClassFinder/README.txt
  17. 10 core/lib/Drupal/Component/Datetime/README.txt
  18. 10 core/lib/Drupal/Component/DependencyInjection/README.txt
  19. 10 core/lib/Drupal/Component/Diff/README.txt
  20. 10 core/lib/Drupal/Component/Discovery/README.txt
  21. 10 core/lib/Drupal/Component/EventDispatcher/README.txt
  22. 10 core/lib/Drupal/Component/FileCache/README.txt
  23. 10 core/lib/Drupal/Component/FileSecurity/README.txt
  24. 10 core/lib/Drupal/Component/FileSystem/README.txt
  25. 10 core/lib/Drupal/Component/FrontMatter/README.txt
  26. 10 core/lib/Drupal/Component/Gettext/README.txt
  27. 10 core/lib/Drupal/Component/Graph/README.txt
  28. 10 core/lib/Drupal/Component/HttpFoundation/README.txt
  29. 10 core/lib/Drupal/Component/PhpStorage/README.txt
  30. 10 core/lib/Drupal/Component/Plugin/README.txt
  31. 10 core/lib/Drupal/Component/ProxyBuilder/README.txt
  32. 10 core/lib/Drupal/Component/Render/README.txt
  33. 10 core/lib/Drupal/Component/Serialization/README.txt
  34. 10 core/lib/Drupal/Component/Transliteration/README.txt
  35. 10 core/lib/Drupal/Component/Utility/README.txt
  36. 10 core/lib/Drupal/Component/Uuid/README.txt
  37. 10 core/lib/Drupal/Component/Version/README.txt
  38. 10 core/profiles/demo_umami/themes/umami/README.txt
  39. 10 core/themes/claro/css/classy/README.txt
  40. 10 core/themes/claro/images/classy/README.txt
  41. 10 core/themes/claro/js/classy/README.txt
  42. 10 core/themes/claro/templates/classy/README.txt
  43. 10 core/modules/system/tests/src/Functional/Update/README.txt
  44. 10 core/modules/system/tests/src/Functional/UpdateSystem/README.txt
  45. 10 core/profiles/demo_umami/themes/umami/css/classy/README.txt
  46. 10 core/profiles/demo_umami/themes/umami/images/classy/README.txt
  47. 10 core/profiles/demo_umami/themes/umami/js/classy/README.txt
  48. 10 core/profiles/demo_umami/themes/umami/templates/classy/README.txt
  49. 10 core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/fruit/README.txt
  50. 10 core/modules/sdc/README.txt
Same filename and directory in other branches
  1. 8.9.x composer/Plugin/VendorHardening/README.txt
  2. 9 composer/Plugin/VendorHardening/README.txt
The Drupal Vendor Hardening Composer Plugin
===========================================

Thanks for using this Drupal component.

You can participate in its development on Drupal.org, through our issue system:
https://www.drupal.org/project/issues/drupal

You can get the full Drupal repo here:
https://www.drupal.org/project/drupal/git-instructions

You can browse the full Drupal repo here:
https://git.drupalcode.org/project/drupal

What does it do?
----------------

This Composer plugin does two things:

1) It removes extraneous directories from the project's vendor directory.
They're typically directories which might contain executable files, such as test
directories.

This sort of processing is required for projects that have a vendor directory
inside the HTTP server docroot. This is a common layout for Drupal.

By default, the plugin knows how to clean up packages for Drupal core, so you
can require drupal/core-vendor-hardening in your project and the rest will
happen automatically.

The plugin can also be configured to clean up additional packages using the
project's composer.json extra field.

This plugin can also clean up packages that were installed outside of the
vendor directory, using composer/installers. This allows users to configure the
plugin to clean up, for instance, Drupal extensions and Drupal core.

2) The plugin also adds .htaccess and web.config files to the root of the
project's vendor directory. These files will perform due diligence to keep the
web server from serving files from within the vendor directory.

How do I set it up?
-------------------

Require this Composer plugin into your project:

    composer require drupal/core-vendor-hardening

When you install or update, this plugin will look through each package and
remove directories it knows about.

You can see the list of default package cleanups for this plugin in Config.php.
If you discover that this list needs updating, file an issue about it:
https://www.drupal.org/project/issues/drupal

In addition to the default list of packages, you can configure the plugin using
the root package's composer.json extra field, like this:

    "extra": {
      "drupal-core-vendor-hardening": {
        "vendor/package": ["test", "documentation"]
      }
    }

The above code will tell the plugin to remove the test/ and documentation/
directories from the 'vendor/package' package when it is installed or updated.

For packages installed outside of the vendor directory, such as those installed
by composer/installers, the paths to remove should be relative to the package
base. As an example, a Drupal module package named drupal/module_name might be
installed by composer/installers to web/modules/contrib/module_name/. Cleanup
paths specified for this package might look like this:

    "extra": {
      "drupal-core-vendor-hardening": {
        "drupal/module_name": ["tests", "src/Tests"]
      }
    }

This would then cause the plugin to try and remove
web/modules/contrib/module_name/tests and
web/modules/contrib/module_name/src/Tests.

File

composer/Plugin/VendorHardening/README.txt
View source
  1. The Drupal Vendor Hardening Composer Plugin
  2. ===========================================
  3. Thanks for using this Drupal component.
  4. You can participate in its development on Drupal.org, through our issue system:
  5. https://www.drupal.org/project/issues/drupal
  6. You can get the full Drupal repo here:
  7. https://www.drupal.org/project/drupal/git-instructions
  8. You can browse the full Drupal repo here:
  9. https://git.drupalcode.org/project/drupal
  10. What does it do?
  11. ----------------
  12. This Composer plugin does two things:
  13. 1) It removes extraneous directories from the project's vendor directory.
  14. They're typically directories which might contain executable files, such as test
  15. directories.
  16. This sort of processing is required for projects that have a vendor directory
  17. inside the HTTP server docroot. This is a common layout for Drupal.
  18. By default, the plugin knows how to clean up packages for Drupal core, so you
  19. can require drupal/core-vendor-hardening in your project and the rest will
  20. happen automatically.
  21. The plugin can also be configured to clean up additional packages using the
  22. project's composer.json extra field.
  23. This plugin can also clean up packages that were installed outside of the
  24. vendor directory, using composer/installers. This allows users to configure the
  25. plugin to clean up, for instance, Drupal extensions and Drupal core.
  26. 2) The plugin also adds .htaccess and web.config files to the root of the
  27. project's vendor directory. These files will perform due diligence to keep the
  28. web server from serving files from within the vendor directory.
  29. How do I set it up?
  30. -------------------
  31. Require this Composer plugin into your project:
  32. composer require drupal/core-vendor-hardening
  33. When you install or update, this plugin will look through each package and
  34. remove directories it knows about.
  35. You can see the list of default package cleanups for this plugin in Config.php.
  36. If you discover that this list needs updating, file an issue about it:
  37. https://www.drupal.org/project/issues/drupal
  38. In addition to the default list of packages, you can configure the plugin using
  39. the root package's composer.json extra field, like this:
  40. "extra": {
  41. "drupal-core-vendor-hardening": {
  42. "vendor/package": ["test", "documentation"]
  43. }
  44. }
  45. The above code will tell the plugin to remove the test/ and documentation/
  46. directories from the 'vendor/package' package when it is installed or updated.
  47. For packages installed outside of the vendor directory, such as those installed
  48. by composer/installers, the paths to remove should be relative to the package
  49. base. As an example, a Drupal module package named drupal/module_name might be
  50. installed by composer/installers to web/modules/contrib/module_name/. Cleanup
  51. paths specified for this package might look like this:
  52. "extra": {
  53. "drupal-core-vendor-hardening": {
  54. "drupal/module_name": ["tests", "src/Tests"]
  55. }
  56. }
  57. This would then cause the plugin to try and remove
  58. web/modules/contrib/module_name/tests and
  59. web/modules/contrib/module_name/src/Tests.