Paramaters for le init script on docker-compose file and domain name
#!/bin/bash
+#
+# Part of RedELK
+# Script to bootstrap certbot tls certificates for nginx
+#
+# Authors:
+# - Lorenzo Bernardi (@fastlorenzo)
+# - Outflank B.V. / Marc Smeets
+#
+
+rsa_key_size=4096
+data_path="./mounts/certbot"
+email="$(cat ./mounts/redelk-config/etc/redelk/config.json | jq -r .redelkserver_letsencrypt.le_email)" # Adding a valid address is strongly recommended
+staging=0 # Set to 1 if you're testing your setup to avoid hitting request limits
if ! [ -x "$(command -v docker-compose)" ]; then
echo 'Error: docker-compose is not installed.' >&2
exit 1
fi
-domain=$(cat ./mounts/redelk-config/etc/redelk/config.json | jq -r .external_domain)
-rsa_key_size=4096
-data_path="./mounts/certbot"
-email="$(cat ./mounts/redelk-config/etc/redelk/config.json | jq -r .le_email)" # Adding a valid address is strongly recommended
-staging=0 # Set to 1 if you're testing your setup to avoid hitting request limits
-compose_file=redelk-full.yml
+if [ ${#} -eq 2 ] && [[ -f $1 ]]; then
+ compose_file=$1
+ domain=$2
+else
+ echo "[X] Error: 1st parameter should be input file for docker-compose, 2nd the domain name. Exiting."
+ ecit 1
+fi
# if [ -d "$data_path" ]; then
# read -p "Existing data found for $domains. Continue and replace existing certificate? (y/N) " decision
