fork 0k-charms
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
507 B

  1. #!/bin/bash
  2. set -e
  3. URL=$(relation-get url) || exit 1
  4. DOMAIN=$(relation-get domain) || exit 1
  5. PROTO="${URL%%://*}"
  6. ssl_enable=true
  7. case "$PROTO" in
  8. http)
  9. ssl_enable=false
  10. ;;
  11. https)
  12. ssl_enable=true
  13. ;;
  14. *)
  15. err "Invalid protocol '$PROTO'."
  16. exit 1
  17. ;;
  18. esac
  19. config-add "\
  20. services:
  21. $MASTER_BASE_SERVICE_NAME:
  22. environment:
  23. server_name: \"$DOMAIN\"
  24. extra_params: \"--o:ssl.enable=false --o:ssl.termination=${ssl_enable} \"
  25. "