gnu-social/bin/bootstrap_certificates
2021-04-14 15:37:20 +00:00

38 lines
657 B
Bash
Executable File

#!/bin/sh
printf "Domain root: "
read -r domain_root
printf "Subdomain (can be empty): "
read -r sub_domain
read -r signed
printf "Use certificate signed by Let's Encrypt (Y/n): "
[ "${signed}" = "${signed#[Yy]}" ]
signed=$?
if [ $signed ]; then
printf "Email: "
read -r email
fi
if [ -z "$sub_domain" ]
then
domain="${domain_root}"
else
domain="${sub_domain}.${domain_root}"
fi
mkdir -p ./docker/bootstrap
cat > ./docker/bootstrap/bootstrap.env <<EOF
#!/bin/sh
email=${email}
domain=${domain}
domain_root=${domain_root}
signed=${signed}
EOF
chmod +x ./docker/bootstrap/bootstrap.env
docker-compose -f docker/bootstrap/bootstrap.yaml up