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

#!/bin/bash
set -e
URL=$(relation-get url) || exit 1
DOMAIN=$(relation-get domain) || exit 1
PROTO="${URL%%://*}"
ssl_enable=true
case "$PROTO" in
http)
ssl_enable=false
;;
https)
ssl_enable=true
;;
*)
err "Invalid protocol '$PROTO'."
exit 1
;;
esac
config-add "\
services:
$MASTER_BASE_SERVICE_NAME:
environment:
server_name: \"$DOMAIN\"
extra_params: \"--o:ssl.enable=false --o:ssl.termination=${ssl_enable} \"
"