Skip to content
Snippets Groups Projects
Commit 4aa2e336 authored by Travis Carden's avatar Travis Carden Committed by Ted Bowman
Browse files

Issue #3303727 by TravisCarden: Document in README how to add paths to...

Issue #3303727 by TravisCarden: Document in README how to add paths to composer.json:extra.drupal-core-vendor-hardening to avoid symlink errors
parent 29d3f48b
No related branches found
No related tags found
No related merge requests found
...@@ -8,6 +8,7 @@ Automatic Updates ...@@ -8,6 +8,7 @@ Automatic Updates
### Limitations ### Limitations
- Drupal multi-site installations are not supported. - Drupal multi-site installations are not supported.
- Automatic Updates does not support version control such as Git. It is the responsibility of site administrators to commit any updates to version control if needed. - Automatic Updates does not support version control such as Git. It is the responsibility of site administrators to commit any updates to version control if needed.
- Automatic Updates does not support symlinks. See [What if Automatic Updates says I have symlinks in my codebase?](#what-if-automatic-updates-says-i-have-symlinks-in-my-codebase) for help if you have any.
### Updating contributed modules and themes ### Updating contributed modules and themes
Automatic Updates includes a sub-module, Automatic Updates Extensions, which supports updating contributed modules and themes. Automatic Updates includes a sub-module, Automatic Updates Extensions, which supports updating contributed modules and themes.
...@@ -18,3 +19,54 @@ Automatic Updates includes a sub-module, Automatic Updates Extensions, which sup ...@@ -18,3 +19,54 @@ Automatic Updates includes a sub-module, Automatic Updates Extensions, which sup
- Follow and read up on - Follow and read up on
[Ideas queue - Automatic Updates initiative](https://www.drupal.org/project/ideas/issues/2940731) [Ideas queue - Automatic Updates initiative](https://www.drupal.org/project/ideas/issues/2940731)
### FAQ
#### What if Automatic Updates says I have symlinks in my codebase?
A fresh Drupal installation should not have any symlinks, but third party libraries and custom code can add them. If Automatic Updates says you have some, run the following command in your terminal to find them:
```shell
cd /var/www # Wherever your active directory is located.
find . -type l
```
You might see output like the below, indicating symlinks in Drush's `docs` directory, as an example:
```
./vendor/drush/drush/docs/misc/icon_PhpStorm.png
./vendor/drush/drush/docs/img/favicon.ico
./vendor/drush/drush/docs/contribute/CONTRIBUTING.md
./vendor/drush/drush/docs/drush_logo-black.png
```
##### Composer libraries
Symlinks in Composer libraries can be addressed with [Drupal's Vendor Hardening Composer Plugin](https://www.drupal.org/docs/develop/using-composer/using-drupals-vendor-hardening-composer-plugin), which "removes extraneous directories from the project's vendor directory". Use it as follows.
First, add `drupal/core-vendor-hardening` to your Composer project:
```shell
composer require drupal/core-vendor-hardening
```
Then, add the following to the `composer.json` in your site root to handle the most common, known culprits. Add your own as necessary.
```json
"extra": {
"drupal-core-vendor-hardening": {
"drush/drush": ["docs"],
"grasmash/yaml-expander": ["scenarios"]
}
}
```
The new configuration will take effect on the next Composer install or update event. Do this to apply it immediately:
```shell
composer install
```
##### Custom code
Symlinks are seldom truly necessary and should be avoided in your own code. No solution currently exists to get around them--they must be removed in order to use Automatic Updates.
...@@ -107,6 +107,12 @@ echo "$JSON" > composer.json ...@@ -107,6 +107,12 @@ echo "$JSON" > composer.json
# Update the Composer platform PHP requirement. # Update the Composer platform PHP requirement.
composer config platform.php 7.4.0 composer config platform.php 7.4.0
# Prevent Composer from installing symlinks from common packages known to
# contain them.
# @see https://www.drupal.org/docs/develop/using-composer/using-drupals-vendor-hardening-composer-plugin
composer config --json extra.drupal-core-vendor-hardening.drush/drush '["docs"]'
composer config --json extra.drupal-core-vendor-hardening.grasmash/yaml-expander '["scenarios"]'
# Require the module using the checked out dev branch, ignoring the PHP version # Require the module using the checked out dev branch, ignoring the PHP version
# requirement. # requirement.
composer require \ composer require \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment