feat: implement nginx:show-config for k3s plugin

This allows users to see what nginx configs are in use for their applications.

Closes #7291
This commit is contained in:
Jose Diaz-Gonzalez
2024-10-21 22:08:53 -04:00
parent 778f563611
commit 90e8cac12f
7 changed files with 151 additions and 10 deletions

View File

@@ -158,8 +158,21 @@ cmd-nginx-show-config() {
declare cmd="nginx:show-config"
[[ "$1" == "$cmd" ]] && shift 1
declare APP="$1"
local proxy_type
verify_app_name "$APP"
proxy_type="$(plugn trigger proxy-type "$APP")"
local DOKKU_SCHEDULER=$(get_app_scheduler "$APP")
if [[ "$DOKKU_SCHEDULER" != "docker-local" ]]; then
plugn trigger scheduler-proxy-config "$DOKKU_SCHEDULER" "$APP" "$proxy_type"
return $?
fi
if [[ "$proxy_type" != "nginx" ]]; then
dokku_log_fail "This command is only available for apps with the nginx proxy type"
fi
if [[ ! -f "$DOKKU_ROOT/$APP/nginx.conf" ]]; then
dokku_log_fail "No nginx.conf exists for $APP"
fi