2020-05-06 20:57:32 +09:00
|
|
|
#!/bin/sh
|
|
|
|
|
2020-05-11 06:33:03 +09:00
|
|
|
printf "Domain root: "
|
|
|
|
read -r domain_root
|
|
|
|
printf "Subdomain (can be empty): "
|
|
|
|
read -r sub_domain
|
2020-05-16 21:37:06 +09:00
|
|
|
printf "Use certificate signed by Let's Encrypt (Y/n): "
|
2020-07-06 07:28:40 +09:00
|
|
|
read -r signed
|
2020-05-06 20:57:32 +09:00
|
|
|
|
2020-05-11 06:33:03 +09:00
|
|
|
[ "${signed}" = "${signed#[Yy]}" ]
|
|
|
|
signed=$?
|
|
|
|
|
2020-07-06 07:28:40 +09:00
|
|
|
if [ $signed -ne 0 ]; then
|
2020-05-16 21:37:06 +09:00
|
|
|
printf "Email: "
|
|
|
|
read -r email
|
|
|
|
fi
|
|
|
|
|
2020-05-11 06:33:03 +09:00
|
|
|
if [ -z "$sub_domain" ]
|
|
|
|
then
|
|
|
|
domain="${domain_root}"
|
2020-05-06 20:57:32 +09:00
|
|
|
else
|
2020-05-11 06:33:03 +09:00
|
|
|
domain="${sub_domain}.${domain_root}"
|
2020-05-06 20:57:32 +09:00
|
|
|
fi
|
|
|
|
|
|
|
|
mkdir -p ./docker/bootstrap
|
|
|
|
|
|
|
|
cat > ./docker/bootstrap/bootstrap.env <<EOF
|
2020-05-11 06:33:03 +09:00
|
|
|
#!/bin/sh
|
2020-05-06 20:57:32 +09:00
|
|
|
email=${email}
|
|
|
|
domain=${domain}
|
|
|
|
domain_root=${domain_root}
|
2020-05-11 06:33:03 +09:00
|
|
|
signed=${signed}
|
2020-05-06 20:57:32 +09:00
|
|
|
EOF
|
|
|
|
|
2020-05-11 06:33:03 +09:00
|
|
|
chmod +x ./docker/bootstrap/bootstrap.env
|
|
|
|
|
2020-05-06 20:57:32 +09:00
|
|
|
docker-compose -f docker/bootstrap/bootstrap.yaml up
|