Merge pull request #6241 from SteveClement/tools

chg: [installer] Made the globalVariables more flexible
pull/6262/head
Steve Clement 2020-08-27 09:25:21 +09:00 committed by GitHub
commit c3d6054409
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 12 deletions

View File

@ -7,12 +7,9 @@
MISPvars () {
debug "Setting generic ${LBLUE}MISP${NC} variables shared by all flavours" 2> /dev/null
# Local non-root MISP user
MISP_USER='misp'
MISP_USER="${MISP_USER:-misp}"
MISP_PASSWORD="$(openssl rand -hex 32)"
# MISP configuration variables
PATH_TO_MISP='/var/www/MISP'
# The web server user
# RHEL/CentOS
if [[ -f "/etc/redhat-release" ]]; then
@ -25,13 +22,13 @@ MISPvars () {
# OpenBSD
elif [[ "$(uname -s)" == "OpenBSD" ]]; then
WWW_USER="www"
PATH_TO_MISP="/var/www/htdocs/MISP"
PATH_TO_MISP="${PATH_TO_MISP:-/var/www/htdocs/MISP}"
SUDO_WWW="doas -u www "
SUDO_CMD="doas "
# NetBSD
elif [[ "$(uname -s)" == "NetBSD" ]]; then
WWW_USER="www"
PATH_TO_MISP="/usr/pkg/share/httpd/htdocs/MISP"
PATH_TO_MISP="$PATH_TO_MISP:-/usr/pkg/share/httpd/htdocs/MISP}"
SUDO_WWW="sudo -H -u ${WWW_USER} "
else
# I am feeling lucky
@ -39,13 +36,12 @@ MISPvars () {
SUDO_WWW="sudo -H -u ${WWW_USER} "
fi
if [ -z "${FQDN}" ]; then
FQDN="misp.local"
fi
# MISP configuration variables
PATH_TO_MISP="${PATH_TO_MISP:-/var/www/MISP}"
if [ -z "${MISP_BASEURL}" ]; then
MISP_BASEURL='""'
fi
FQDN="${FQDN:-misp.local}"
MISP_BASEURL="${MISP_BASEURL:-""}"
MISP_LIVE='1'