If a user implements the user-auth-service trigger in a plugin and that plugin does not echo the passed in app(s) on stdout, the app is assumed to not exist. This mirrors the functionality for applications in regards to auth filtering. This may still need auditing to ensure it covers everything and doesn't cause issues, but local testing implies that everything is working as expected.
37 lines
963 B
Bash
Executable File
37 lines
963 B
Bash
Executable File
#!/usr/bin/env bash
|
|
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/config"
|
|
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/common-functions"
|
|
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/functions"
|
|
set -eo pipefail
|
|
[[ $DOKKU_TRACE ]] && set -x
|
|
|
|
plugin-pre-restore() {
|
|
declare SCHEDULER="$1" APP="$2"
|
|
local status
|
|
|
|
if [[ "$SCHEDULER" != "docker-local" ]]; then
|
|
return
|
|
fi
|
|
|
|
for SERVICE in $(fn-services-list false); do
|
|
if ! in_links_file "$SERVICE" "$APP"; then
|
|
continue
|
|
fi
|
|
|
|
status="$(service_status "$SERVICE")"
|
|
if [[ "$status" == "running" ]]; then
|
|
continue
|
|
fi
|
|
|
|
if [[ "$status" == "restarting" ]]; then
|
|
dokku_log_warn "$PLUGIN_SERVICE service $SERVICE is restarting and may cause issues with linked app $APP"
|
|
continue
|
|
fi
|
|
|
|
dokku_log_warn "$PLUGIN_SERVICE service $SERVICE is not running, issuing service start"
|
|
service_start "$SERVICE"
|
|
done
|
|
}
|
|
|
|
plugin-pre-restore "$@"
|