feat: prohibit non-dns names for apps and process types
This is necessary for ensuring ssl certificates can be auto-retrieved for apps, and also easing integration into schedulers that use names and process types as part of DNS records. As well, this fixes an issue where we may potentially have invalid DNS entries when adding apps to custom networks. Closes #4102 Closes #4114
This commit is contained in:
@@ -185,13 +185,13 @@ is_valid_app_name() {
|
||||
local APP="$1"
|
||||
[[ -z "$APP" ]] && dokku_log_fail "APP must not be null"
|
||||
if [[ "$APP" =~ ^[a-z].* ]] || [[ "$APP" =~ ^[0-9].* ]]; then
|
||||
if [[ ! $APP =~ [A-Z] ]] && [[ ! $APP =~ [:] ]]; then
|
||||
if [[ ! $APP =~ [A-Z] ]] && [[ ! $APP =~ [:] ]] && [[ ! $APP =~ [_] ]]; then
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
|
||||
[[ -d "$DOKKU_ROOT/$APP" ]] && rm -rf "${DOKKU_ROOT:?}/$APP"
|
||||
dokku_log_fail "App name must begin with lowercase alphanumeric character"
|
||||
dokku_log_fail "App name must begin with lowercase alphanumeric character, and cannot include uppercase characters, colons, or underscores"
|
||||
}
|
||||
|
||||
verify_app_name() {
|
||||
|
||||
Reference in New Issue
Block a user