Add user-auth plugin trigger
This plugin trigger should allow users to pair down the available commands for a given user. While this does not affect help output - or any output at all - this is a good first step in allowing administrative access to certain commands while still allowing users to deploy/manage given applications. Note that because of how dokku works, all parsing of commands must be done within the pluginhook, and we cannot give visibility into the actual command or application that will be affected by a given run.
This commit is contained in:
1 parent
0eab678fcc
commit
fc125d41e8
3 files changed
+56
No files matched your search
@@ -50,6 +50,7 @@ fi
|
||||
! has_tty && DOKKU_QUIET_OUTPUT=1
|
||||
|
||||
if [[ $(id -un) != "dokku" && $1 != plugin:*install* && $1 != "plugin:update" ]]; then
|
||||
export SSH_USER=$(id -un)
|
||||
sudo -u dokku -E -H $0 "$@"
|
||||
exit $?
|
||||
fi
|
||||
@@ -65,6 +66,11 @@ if [[ -n "$SSH_ORIGINAL_COMMAND" ]]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if ! dokku_auth "$@" ; then
|
||||
dokku_log_fail "Access denied"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
receive)
|
||||
APP="$2"; IMAGE=$(get_app_image_name $APP); IMAGE_SOURCE_TYPE="$3"; TMP_WORK_DIR="$4"
|
||||
|
||||
Reference in new issue
Block a user