bootstrap_certificates 663 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/sh
  2. printf "Domain root: "
  3. read -r domain_root
  4. printf "Subdomain (can be empty): "
  5. read -r sub_domain
  6. printf "Use certificate signed by Let's Encrypt (Y/n): "
  7. read -r signed
  8. [ "${signed}" = "${signed#[Yy]}" ]
  9. signed=$?
  10. if [ $signed -ne 0 ]; then
  11. printf "Email: "
  12. read -r email
  13. fi
  14. if [ -z "$sub_domain" ]
  15. then
  16. domain="${domain_root}"
  17. else
  18. domain="${sub_domain}.${domain_root}"
  19. fi
  20. mkdir -p ./docker/bootstrap
  21. cat > ./docker/bootstrap/bootstrap.env <<EOF
  22. #!/bin/sh
  23. email=${email}
  24. domain=${domain}
  25. domain_root=${domain_root}
  26. signed=${signed}
  27. EOF
  28. chmod +x ./docker/bootstrap/bootstrap.env
  29. docker-compose -f docker/bootstrap/bootstrap.yaml up