gnu-social/bin/bootstrap_certificates

38 lines
657 B
Plaintext
Raw Normal View History

#!/bin/sh
printf "Domain root: "
read -r domain_root
printf "Subdomain (can be empty): "
read -r sub_domain
read -r signed
2020-05-16 21:37:06 +09:00
printf "Use certificate signed by Let's Encrypt (Y/n): "
[ "${signed}" = "${signed#[Yy]}" ]
signed=$?
2020-05-16 21:37:06 +09:00
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