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.

29 lines
463 B

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