From 3acc92b85c54b2bfa81e5b1436cc2df78da36536 Mon Sep 17 00:00:00 2001 From: Tom Wiesing Date: Wed, 7 Oct 2020 13:18:04 +0200 Subject: [PATCH] Add set_trusted_host utility script --- distillery/utils/set_trusted_host.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 distillery/utils/set_trusted_host.sh diff --git a/distillery/utils/set_trusted_host.sh b/distillery/utils/set_trusted_host.sh new file mode 100755 index 0000000..194097f --- /dev/null +++ b/distillery/utils/set_trusted_host.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +# This utility script can be used to configure the trusted host settings inside of settings.php. +# It doesn't take care of corner cases and should only be used when needed + +INSTANCE_DOMAIN="$(hostname -f)" +chmod u+w web/sites/default/settings.php +echo "" >> web/sites/default/settings.php +echo "\$settings['trusted_host_patterns'] = ['${INSTANCE_DOMAIN//\./\\\.}'];" >> web/sites/default/settings.php +chmod u-w web/sites/default/settings.php \ No newline at end of file