feat: implement proxy container :label functionality

This commit is contained in:
dragonhunt02
2025-03-22 22:01:00 +00:00
committed by Jose Diaz-Gonzalez
parent e93175b37e
commit 4eafd3b5b7
18 changed files with 273 additions and 0 deletions

View File

@@ -2,6 +2,7 @@
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/proxy/functions"
source "$PLUGIN_AVAILABLE_PATH/openresty-vhosts/internal-functions"
trigger-openresty-vhosts-docker-args-process-deploy() {
@@ -181,6 +182,15 @@ trigger-openresty-vhosts-docker-args-process-deploy() {
value="$(fn-openresty-x-forwarded-ssl "$APP")"
[[ -n "$value" ]] && output="$output '--label=openresty.x-forwarded-ssl=$value'"
local proxy_labels_file_path=$(fn-proxy-get-labels-file-path "$APP" openresty)
fn-proxy-report-label-overwrite "$output" "$proxy_labels_file_path"
if [[ -f "$proxy_labels_file_path" ]]; then
local user_proxy_labels="$(<"$proxy_labels_file_path")"
user_proxy_labels="$(echo "$user_proxy_labels" | tr '\r\n' ' ')"
output="$output $user_proxy_labels"
fi
echo -n "$STDIN$output"
}