feat: add verify_app_name calls to all shell subcommands

Without this, folks could potentially run commands against invalid applications.
This commit is contained in:
Jose Diaz-Gonzalez committed 2020-12-27 15:14:11 -05:00
1 parent 03e80a76b6
commit fd162f8895
28 files changed
+17 -32

No files matched your search

+1 -1
View File
@@ -10,8 +10,8 @@ cmd-domains-add() {
[[ "$1" == "$cmd" ]] && shift 1
declare APP="$1" DOMAIN_NAME="$2"
[[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
[[ -z "$DOMAIN_NAME" ]] && dokku_log_fail "Please specify a domain name. Usage: dokku $1 $2 <domain> [<domain> ...]"
verify_app_name "$APP"
domains_add "$@"
}
-1
View File
@@ -10,7 +10,6 @@ cmd-domains-clear() {
[[ "$1" == "$cmd" ]] && shift 1
declare APP="$1"
[[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
verify_app_name "$APP"
local APP_VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"
+1 -1
View File
@@ -10,7 +10,7 @@ cmd-domains-disable() {
[[ "$1" == "$cmd" ]] && shift 1
declare APP="$1"
[[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
verify_app_name "$APP"
domains_disable "$APP"
}
+1 -1
View File
@@ -10,7 +10,7 @@ cmd-domains-enable() {
[[ "$1" == "$cmd" ]] && shift 1
declare APP="$1"
[[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
verify_app_name "$APP"
domains_enable "$APP"
}
+1 -1
View File
@@ -10,8 +10,8 @@ cmd-domains-remove() {
[[ "$1" == "$cmd" ]] && shift 1
declare APP="$1" DOMAIN_NAME="$2"
[[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
[[ -z "$DOMAIN_NAME" ]] && dokku_log_fail "Please specify a domain name. Usage: dokku $1 $2 <domain> [<domain> ...]"
verify_app_name "$APP"
domains_remove "$@"
}
+1 -1
View File
@@ -10,8 +10,8 @@ cmd-domains-set() {
[[ "$1" == "$cmd" ]] && shift 1
declare APP="$1" DOMAIN_NAME="$2"
[[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
[[ -z "$DOMAIN_NAME" ]] && dokku_log_fail "Please specify a domain name. Usage: dokku $1 $2 <domain> [<domain> ...]"
verify_app_name "$APP"
domains_set "$@"
}
+1 -1
View File
@@ -10,7 +10,7 @@ cmd-domains-setup() {
[[ "$1" == "$cmd" ]] && shift 1
declare APP="$1"
[[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
verify_app_name "$APP"
domains_setup "$APP"
}