Fix bug in patching the MISP.baseurl from environment

The web/run.sh script was using a sed command that had two defects,
preventing the MISP_BASEURL environment from setting the MISP.baseurl
in config.php:
 - pattern used '/' as boundaries, making it incompatible with a baseurl
   containing that character
 - pattern assumed 1 space between 'baseurl' and '=>', but the
   config.php has multiple whitespace/tabs, so broadened the pattern to
   support any arbitrary length whitespace there

Signed-off-by: Coleman Kane <ckane@colemankane.org>
Coleman Kane 2021-03-06 13:10:36 -05:00
parent f85912450a
commit 46b2cc37bd
1 changed files with 1 additions and 1 deletions

View File

@ -100,7 +100,7 @@ if [ -r /.firstboot.tmp ]; then
echo "No base URL defined, don't forget to define it manually!"
else
echo "Fixing the MISP base URL ($MISP_BASEURL) ..."
sed -i "s/'baseurl' => '',/'baseurl' => '$MISP_BASEURL',/g" /var/www/MISP/app/Config/config.php
sed -i "s@'baseurl'[\t ]*=>[\t ]*'',@'baseurl' => '$MISP_BASEURL',@g" /var/www/MISP/app/Config/config.php
fi
# Generate the admin user PGP key