From 7194a6d180176d7aa375fa4e583c89d9435090dc Mon Sep 17 00:00:00 2001 From: Dane Powell Date: Tue, 25 Oct 2016 12:30:22 -0700 Subject: [PATCH] Automated SimpleSAMLphp htaccess patch. --- phing/tasks/simplesamlphp.xml | 4 +++- readme/simplesamlphp-setup.md | 13 ++----------- scripts/simplesamlphp/htaccess-saml.json | 9 +++++++++ 3 files changed, 14 insertions(+), 12 deletions(-) create mode 100644 scripts/simplesamlphp/htaccess-saml.json diff --git a/phing/tasks/simplesamlphp.xml b/phing/tasks/simplesamlphp.xml index b1e9baae07..4b9f10272f 100644 --- a/phing/tasks/simplesamlphp.xml +++ b/phing/tasks/simplesamlphp.xml @@ -32,6 +32,9 @@ @@ -73,7 +76,6 @@ To complete the setup you must manually modify several files. ============================================================================ - * ${docroot}/.htaccess * ${repo.root}/simplesamlphp/config/acquia_config.php * ${repo.root}/simplesamlphp/config/authsources.php * ${repo.root}/simplesamlphp/metadata/saml20-idp-remote.php diff --git a/readme/simplesamlphp-setup.md b/readme/simplesamlphp-setup.md index f3c7c4dcaf..f5062f0f44 100644 --- a/readme/simplesamlphp-setup.md +++ b/readme/simplesamlphp-setup.md @@ -4,21 +4,12 @@ To configure SimpleSAMLphp, perform the following steps after initially setting 1. Execute `blt simplesamlphp:init`. This will perform the initial setup tasks including: * Adds the simplesamlphp_auth module as a project dependency. + * Patches your .htaccess file to allow access to the simplesaml path. * Copies configuration files to `${project.root}/simplesamlphp` * Adds a simplesamlphp property to project.yml * Creates a symbolic link in the docroot to the web accessible directory of the simplesamlphp library. * Adds a settings.php file to the project's default settings directory. - -1. Edit `docroot/.htaccess` to include the following 2 lines. Note: the only 2 lines that need to be added are the lines marked with "+" signs. - - # Copy and adapt this rule to directly execute PHP files in contributed or - # custom modules or to run another PHP application in the same directory. - RewriteCond %{REQUEST_URI} !/core/modules/statistics/statistics.php$ - + # Allow access to simplesaml paths - + RewriteCond %{REQUEST_URI} !^/simplesaml - # Deny access to any other PHP files that do not match the rules above. - RewriteRule "^.+/.*\.php$" - [F] - + 1. Edit `${project.root}/simplesamlphp/config/config.php` * This file has been pre-populated with a code snippet recommended for Acquia Cloud Environments. You will need to edit the `$config` array for your local environment. * Update your database name in `$ah_options` diff --git a/scripts/simplesamlphp/htaccess-saml.json b/scripts/simplesamlphp/htaccess-saml.json new file mode 100644 index 0000000000..335046fa86 --- /dev/null +++ b/scripts/simplesamlphp/htaccess-saml.json @@ -0,0 +1,9 @@ +{ + "extra": { + "patches": { + "drupal/core": { + "SimpleSAML htaccess": "./patches/drupal/htacess-simplesaml.patch" + } + } + } +}