start.sh 708 B

12345678910111213141516171819202122
  1. #!/usr/bin/env bash
  2. # If the transient local TLS certificate doesn't exist, mint a new one
  3. if [ ! -f ../pki/caddy.local.cetacean.club/cert.pem ]; then
  4. # Subshell to contain the directory change
  5. (
  6. cd ../pki \
  7. && mkdir -p caddy.local.cetacean.club \
  8. && \
  9. # Try using https://github.com/FiloSottile/mkcert for better DevEx,
  10. # but fall back to using https://github.com/jsha/minica in case
  11. # you don't have that installed.
  12. (
  13. mkcert \
  14. --cert-file ./caddy.local.cetacean.club/cert.pem \
  15. --key-file ./caddy.local.cetacean.club/key.pem caddy.local.cetacean.club \
  16. || go tool minica -domains caddy.local.cetacean.club
  17. )
  18. )
  19. fi
  20. docker compose up --build