Set DB name from VAR closes #45, cleanup docker-compose env

pull/1/head
Jason Kendall 2020-03-21 12:10:13 -04:00
parent 7e997fb3fd
commit b77ce6c623
2 changed files with 13 additions and 7 deletions

View File

@ -33,14 +33,19 @@ services:
- "./ssl/:/etc/ssl/certs"
# - "./examples/custom-entrypoint.sh:/custom-entrypoint.sh" # Use the example custom-entrypoint.sh
environment:
- "CRON_USER_ID=1"
- "REDIS_FQDN=redis"
- "MYSQL_PASSWORD=example"
- "HOSTNAME=https://localhost"
- "INIT=true" # Initialze MISP, things includes, attempting to import SQL and the Files DIR
# - "NOREDIR=true" #Do not redirect port 80
# - "SYNCSERVERS=1 2 3 4"
# - "DISIPV6=true"
- "REDIS_FQDN=redis"
- "INIT=true" # Initialze MISP, things includes, attempting to import SQL and the Files DIR
- "CRON_USER_ID=1" # The MISP user ID to run cron jobs as
# - "SYNCSERVERS=1 2 3 4" # The MISP Feed servers to sync in the cron job
# Database Configuration (And their defaults)
# - "MYSQL_HOST=db"
# - "MYSQL_USER=misp"
# - "MYSQL_PASSWORD=example"
# - "MYSQL_DATABASE=misp"
# Optional Settings
# - "NOREDIR=true" # Do not redirect port 80
# - "DISIPV6=true" # Disable IPV6 in nginx
misp-modules:
image: coolacid/misp-docker:modules-latest

View File

@ -28,6 +28,7 @@ init_misp_config(){
sed -i "s/localhost/$MYSQL_HOST/" $MISP_APP_CONFIG_PATH/database.php
sed -i "s/db\s*login/$MYSQL_USER/" $MISP_APP_CONFIG_PATH/database.php
sed -i "s/db\s*password/$MYSQL_PASSWORD/" $MISP_APP_CONFIG_PATH/database.php
sed -i "s/'database' => 'misp'/'database' => '$MYSQL_DATABASE'/" $MISP_APP_CONFIG_PATH/database.php
echo "Configure sane defaults"
/var/www/MISP/app/Console/cake Admin setSetting "MISP.redis_host" "$REDIS_FQDN"