mirror of https://github.com/MISP/misp-docker
Make SSL certs in INIT mode if any part doesn't exist
parent
e8a1dc0c06
commit
e5937ecdb8
|
@ -1,12 +1,8 @@
|
|||
logs/
|
||||
ssl/cert.pem
|
||||
ssl/chain.pem
|
||||
ssl/dhparams.pem
|
||||
ssl/key.pem
|
||||
files/
|
||||
ssl/
|
||||
server-configs/database.php
|
||||
server-configs/config.php
|
||||
server-configs/bootstrap.php
|
||||
server-configs/core.php
|
||||
server-configs/config.php.bk
|
||||
files/INIT
|
||||
files/[0-9]*
|
||||
|
|
|
@ -45,6 +45,18 @@ init_misp_files(){
|
|||
fi
|
||||
}
|
||||
|
||||
init_ssl() {
|
||||
if [[ (! -f /etc/apache2/ssl/dhparams.pem) ||
|
||||
(! -f /etc/apache2/ssl/cert.pem) ||
|
||||
(! -f /etc/apache2/ssl/key.pem) ||
|
||||
(! -f /etc/apache2/ssl/chain.pem) ]]; then
|
||||
cd /etc/apache2/ssl
|
||||
openssl dhparam -out dhparams.pem 2048
|
||||
openssl req -x509 -subj '/CN=localhost' -nodes -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365
|
||||
cp cert.pem chain.pem
|
||||
fi
|
||||
}
|
||||
|
||||
init_mysql(){
|
||||
# Test when MySQL is ready....
|
||||
# wait for Database come ready
|
||||
|
@ -78,6 +90,7 @@ start_apache() {
|
|||
if [[ "$INIT" == true ]]; then
|
||||
echo "Import MySQL scheme..." && init_mysql
|
||||
echo "Setup MISP files dir..." && init_misp_files
|
||||
echo "Ensure SSL certs exist..." && init_ssl
|
||||
fi
|
||||
|
||||
# Things we should do if we're configuring MISP via ENV
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
|
||||
echo "Seriously, don't use this"
|
||||
openssl dhparam -out dhparams.pem 2048
|
||||
openssl req -x509 -subj '/CN=localhost' -nodes -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365
|
||||
cp cert.pem chain.pem
|
Loading…
Reference in New Issue