#!/usr/bin/env bash
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions"
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x

trigger-caddy-install() {
  declare desc="installs the caddy plugin"
  declare trigger="install"

  mkdir -p "${DOKKU_LIB_ROOT}/data/caddy"
  chown -R "${DOKKU_SYSTEM_USER}:${DOKKU_SYSTEM_GROUP}" "${DOKKU_LIB_ROOT}/data/caddy"

  fn-plugin-property-setup "caddy"
}

trigger-caddy-install "$@"
