mirror of
https://github.com/element-hq/element-docker-demo.git
synced 2026-03-25 19:39:43 +03:00
fix mkcert
This commit is contained in:
8
setup.sh
8
setup.sh
@@ -27,7 +27,7 @@ if [[ ! -e .env ]]; then
|
|||||||
# SSL setup
|
# SSL setup
|
||||||
read -p "Use local mkcert CA for SSL? [y/n] " use_mkcert
|
read -p "Use local mkcert CA for SSL? [y/n] " use_mkcert
|
||||||
if [[ "$use_mkcert" =~ ^[Yy]$ ]]; then
|
if [[ "$use_mkcert" =~ ^[Yy]$ ]]; then
|
||||||
if [[ ! -x mkcert ]]; then
|
if ! [ -x "$(command -v mkcert)" ]; then
|
||||||
echo "Please install mkcert from brew/apt/yum etc"
|
echo "Please install mkcert from brew/apt/yum etc"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
@@ -40,12 +40,14 @@ if [[ ! -e .env ]]; then
|
|||||||
# borrow letsencrypt's SSL config
|
# borrow letsencrypt's SSL config
|
||||||
curl -s https://raw.githubusercontent.com/certbot/certbot/master/certbot-nginx/certbot_nginx/_internal/tls_configs/options-ssl-nginx.conf > "data/ssl/options-ssl-nginx.conf"
|
curl -s https://raw.githubusercontent.com/certbot/certbot/master/certbot-nginx/certbot_nginx/_internal/tls_configs/options-ssl-nginx.conf > "data/ssl/options-ssl-nginx.conf"
|
||||||
curl -s https://raw.githubusercontent.com/certbot/certbot/master/certbot/certbot/ssl-dhparams.pem > "data/ssl/ssl-dhparams.pem"
|
curl -s https://raw.githubusercontent.com/certbot/certbot/master/certbot/certbot/ssl-dhparams.pem > "data/ssl/ssl-dhparams.pem"
|
||||||
|
success=true
|
||||||
else
|
else
|
||||||
read -p "Use letsencrypt for SSL? [y/n] " use_letsencrypt
|
read -p "Use letsencrypt for SSL? [y/n] " use_letsencrypt
|
||||||
if [[ "$use_letsencrypt" =~ ^[Yy]$ ]]; then
|
if [[ "$use_letsencrypt" =~ ^[Yy]$ ]]; then
|
||||||
mkdir -p data/ssl
|
mkdir -p data/ssl
|
||||||
touch data/ssl/ca-certificates.crt # will get overwritten by init-letsencrypt.sh
|
touch data/ssl/ca-certificates.crt # will get overwritten by init-letsencrypt.sh
|
||||||
source ./init-letsencrypt.sh
|
source ./init-letsencrypt.sh
|
||||||
|
success=true
|
||||||
else
|
else
|
||||||
echo "Please put a valid {privkey,fullchain}.pem and ca-certificates.crt into data/ssl/"
|
echo "Please put a valid {privkey,fullchain}.pem and ca-certificates.crt into data/ssl/"
|
||||||
fi
|
fi
|
||||||
@@ -53,3 +55,7 @@ if [[ ! -e .env ]]; then
|
|||||||
else
|
else
|
||||||
echo ".env already exists; move it out of the way first to re-setup"
|
echo ".env already exists; move it out of the way first to re-setup"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if ! [ -z "$success" ]; then
|
||||||
|
echo ".env and SSL configured; you can now docker compose up"
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user