mirror of https://github.com/MISP/misp-docker
				
				
				
			Add option to disable IPv6 completely (#29)
							parent
							
								
									969c131c84
								
							
						
					
					
						commit
						8ef11e85a7
					
				|  | @ -62,6 +62,7 @@ services: | |||
|     environment: | ||||
|       - "HOSTNAME=${HOSTNAME}" | ||||
|       - "CRON_USER_ID=${CRON_USER_ID}" | ||||
|       - "DISABLE_IPV6=${DISABLE_IPV6}" | ||||
|       # standard settings | ||||
|       - "ADMIN_EMAIL=${ADMIN_EMAIL}" | ||||
|       - "ADMIN_PASSWORD=${ADMIN_PASSWORD}" | ||||
|  |  | |||
|  | @ -16,6 +16,7 @@ trap term_proc SIGTERM | |||
| [ -z "$MYSQLCMD" ] && export MYSQLCMD="mysql -u $MYSQL_USER -p$MYSQL_PASSWORD -P $MYSQL_PORT -h $MYSQL_HOST -r -N $MYSQL_DATABASE" | ||||
| [ -z "$CRON_USER_ID" ] && export CRON_USER_ID="1" | ||||
| [ -z "$HOSTNAME" ] && export HOSTNAME="https://localhost" | ||||
| [ -z "$DISABLE_IPV6" ] && export DISABLE_IPV6=false | ||||
| 
 | ||||
| init_mysql(){ | ||||
|     # Test when MySQL is ready.... | ||||
|  | @ -188,6 +189,9 @@ init_nginx() { | |||
|     # Testing for files also test for links, and generalize better to mounted files | ||||
|     if [[ ! -f "/etc/nginx/sites-enabled/misp80" ]]; then | ||||
|         echo "... enabling port 80 redirect" | ||||
|         if [[ "$DISABLE_IPV6" = "true" ]]; then | ||||
|             sed -i "/\[::\]/d" /etc/nginx/sites-available/misp80 | ||||
|         fi | ||||
|         ln -s /etc/nginx/sites-available/misp80 /etc/nginx/sites-enabled/misp80 | ||||
|     else | ||||
|         echo "... port 80 already configured" | ||||
|  | @ -196,6 +200,9 @@ init_nginx() { | |||
|     # Testing for files also test for links, and generalize better to mounted files | ||||
|     if [[ ! -f "/etc/nginx/sites-enabled/misp" ]]; then | ||||
|         echo "... enabling port 443" | ||||
|         if [[ "$DISABLE_IPV6" = "true" ]]; then | ||||
|             sed -i "/\[::\]/d" /etc/nginx/sites-available/misp | ||||
|         fi | ||||
|         ln -s /etc/nginx/sites-available/misp /etc/nginx/sites-enabled/misp | ||||
|     else | ||||
|         echo "... port 443 already configured" | ||||
|  |  | |||
|  | @ -67,3 +67,6 @@ SYNCSERVERS_1_KEY= | |||
| # Enable admin (user #1) API key autogeneration | ||||
| # if ADMIN_KEY is not set above (default true) | ||||
| # AUTOGEN_ADMIN_KEY=true | ||||
| 
 | ||||
| # Disable IPv6 completely (this setting will persist until the container is removed) | ||||
| # DISABLE_IPV6=true | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 Stefano Ortolani
						Stefano Ortolani