mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
Fix customcert linux tests
This commit is contained in:
parent
dcba7dc181
commit
4d3e30977b
1 changed files with 9 additions and 6 deletions
|
|
@ -28,6 +28,7 @@ if [ "$integration" == "docker" ] ; then
|
|||
fi
|
||||
else
|
||||
sudo systemctl stop bunkerweb
|
||||
sudo sed -i 's@SERVER_NAME=.*$@SERVER_NAME=app1.example.com@' /etc/bunkerweb/variables.env
|
||||
echo "USE_CUSTOM_SSL=no" | sudo tee -a /etc/bunkerweb/variables.env
|
||||
echo "CUSTOM_SSL_CERT=/tmp/certificate.pem" | sudo tee -a /etc/bunkerweb/variables.env
|
||||
echo "CUSTOM_SSL_KEY=/tmp/privatekey.key" | sudo tee -a /etc/bunkerweb/variables.env
|
||||
|
|
@ -49,10 +50,14 @@ cleanup_stack () {
|
|||
find . -type f -name 'docker-compose.*' -exec sed -i 's@CUSTOM_SSL_KEY: ".*"@CUSTOM_SSL_KEY: "/certs/privatekey.key"@' {} \;
|
||||
else
|
||||
sudo rm -f /tmp/certificate.pem /tmp/privatekey.key
|
||||
sudo sed -i 's@SERVER_NAME=.*$@SERVER_NAME=www.example.com@' /etc/bunkerweb/variables.env
|
||||
sudo sed -i 's@USE_CUSTOM_SSL=.*$@USE_CUSTOM_SSL=no@' /etc/bunkerweb/variables.env
|
||||
sudo sed -i 's@CUSTOM_SSL_CERT=.*$@CUSTOM_SSL_CERT=/tmp/certificate.pem@' /etc/bunkerweb/variables.env
|
||||
sudo sed -i 's@CUSTOM_SSL_KEY=.*$@CUSTOM_SSL_KEY=/tmp/privatekey.key@' /etc/bunkerweb/variables.env
|
||||
sudo sed -i '$ d' /etc/bunkerweb/variables.env
|
||||
sudo sed -i '$ d' /etc/bunkerweb/variables.env
|
||||
sudo sed -i '$ d' /etc/bunkerweb/variables.env
|
||||
unset USE_CUSTOM_SSL
|
||||
unset CUSTOM_SSL_CERT
|
||||
unset CUSTOM_SSL_KEY
|
||||
fi
|
||||
if [[ $end -eq 1 && $exit_code = 0 ]] ; then
|
||||
return
|
||||
|
|
@ -97,8 +102,8 @@ if [ "$integration" == "docker" ] ; then
|
|||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "🔏 Generating certificate for www.example.com ..."
|
||||
openssl req -nodes -x509 -newkey rsa:4096 -keyout /tmp/privatekey.key -out /tmp/certificate.pem -days 365 -subj /CN=www.example.com/
|
||||
echo "🔏 Generating certificate for app1.example.com ..."
|
||||
openssl req -nodes -x509 -newkey rsa:4096 -keyout /tmp/privatekey.key -out /tmp/certificate.pem -days 365 -subj /CN=app1.example.com/
|
||||
# shellcheck disable=SC2181
|
||||
if [ $? -ne 0 ] ; then
|
||||
echo "🔏 Certificate generation failed ❌"
|
||||
|
|
@ -126,12 +131,10 @@ do
|
|||
find . -type f -name 'docker-compose.*' -exec sed -i 's@CUSTOM_SSL_CERT: ".*"@CUSTOM_SSL_CERT: ""@' {} \;
|
||||
find . -type f -name 'docker-compose.*' -exec sed -i 's@CUSTOM_SSL_KEY: ".*"@CUSTOM_SSL_KEY: ""@' {} \;
|
||||
else
|
||||
sudo sed -i 's@USE_CUSTOM_SSL=.*$@USE_CUSTOM_SSL=yes@' /etc/bunkerweb/variables.env
|
||||
sudo sed -i 's@CUSTOM_SSL_CERT=.*$@CUSTOM_SSL_CERT=@' /etc/bunkerweb/variables.env
|
||||
sudo sed -i 's@CUSTOM_SSL_KEY=.*$@CUSTOM_SSL_KEY=@' /etc/bunkerweb/variables.env
|
||||
unset CUSTOM_SSL_CERT
|
||||
unset CUSTOM_SSL_KEY
|
||||
export USE_CUSTOM_SSL="yes"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue