Merge pull request #3854 from dokku/remove-deprecated-code

Remove deprecated code
This commit is contained in:
Jose Diaz-Gonzalez
2020-02-17 05:51:20 -05:00
committed by GitHub
37 changed files with 297 additions and 418 deletions

View File

@@ -27,7 +27,6 @@ help_desc
fn-help-content() {
declare desc="return help content"
cat <<help_content
apps, [DEPRECATED] Alias for apps:list
apps:clone <old-app> <new-app>, Clones an app
apps:create <app>, Create a new app
apps:destroy <app>, Permanently destroy an app

View File

@@ -1,7 +1,6 @@
#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_AVAILABLE_PATH/apps/internal-functions"
source "$PLUGIN_AVAILABLE_PATH/apps/help-functions"
dokku_log_warn "Deprecated: Please use apps:list"
cmd-apps-list "$@"
cmd-apps-help "apps:help"

View File

@@ -27,11 +27,9 @@ help_desc
fn-help-content() {
declare desc="return help content"
cat <<help_content
certs <app>, [DEPRECATED] Alternative for certs:report
certs:add <app> CRT KEY, Add an ssl endpoint to an app. Can also import from a tarball on stdin
certs:chain CRT [CRT ...], [NOT IMPLEMENTED] Print the ordered and complete chain for the given certificate
certs:generate <app> DOMAIN, Generate a key and certificate signing request (and self-signed certificate)
certs:info <app>, [DEPRECATED] Alternative for certs:report
certs:key <app> CRT KEY [KEY ...], [NOT IMPLEMENTED] Print the correct key for the given certificate
certs:remove <app>, Remove an SSL Endpoint from an app
certs:report [<app>] [<flag>], Displays an ssl report for one or more apps

View File

@@ -72,42 +72,6 @@ cmd-certs-report-single() {
fi
}
cmd-certs-info() {
# This is here because it's used in both the info and the default
declare desc="prints SSL certificate info for app"
declare cmd="certs:info"
[[ "$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_SSL_PATH="$DOKKU_ROOT/$APP/tls"
if is_ssl_enabled "$APP"; then
dokku_log_info1 "Fetching SSL Endpoint info for $APP..."
dokku_log_info1 "Certificate details:"
dokku_log_info2 "Common Name(s): "
for domain in $(get_ssl_hostnames "$APP" | xargs); do
dokku_log_info2 " $domain"
done
dokku_log_info2 "Expires At: $(openssl x509 -in "$APP_SSL_PATH/server.crt" -noout -text | grep "Not After :" | awk -F " : " '{ print $2 }')"
dokku_log_info2 "Issuer: $(openssl x509 -in "$APP_SSL_PATH/server.crt" -noout -text | grep "Issuer:" | xargs | sed -e "s/Issuer: //g")"
dokku_log_info2 "Starts At: $(openssl x509 -in "$APP_SSL_PATH/server.crt" -noout -text | grep "Not Before:" | awk -F ": " '{ print $2 }')"
dokku_log_info2 "Subject: $(openssl x509 -in "$APP_SSL_PATH/server.crt" -noout -subject | sed -e "s:subject= ::g" | sed -e "s:^/::g" | sed -e "s:/:; :g")"
local SSL_VERIFY_OUTPUT="$(openssl verify -verbose -purpose sslserver "$APP_SSL_PATH/server.crt" | awk -F ':' '{ print $2 }' | tail -1 | xargs || true)"
if [[ "$SSL_VERIFY_OUTPUT" == "OK" ]]; then
local SSL_SELF_SIGNED="verified by a certificate authority."
else
local SSL_SELF_SIGNED="self signed."
fi
dokku_log_info2 "SSL certificate is $SSL_SELF_SIGNED"
else
dokku_log_info1 "$APP does not have an SSL endpoint"
fi
}
fn-ssl-enabled() {
declare APP="$1"
local SSL_ENABLED=false

View File

@@ -1,7 +1,6 @@
#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_AVAILABLE_PATH/certs/internal-functions"
source "$PLUGIN_AVAILABLE_PATH/certs/help-functions"
dokku_log_warn "Deprecated: Please use certs:report"
cmd-certs-info "$@"
cmd-certs-help "certs:help"

View File

@@ -1,7 +0,0 @@
#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_AVAILABLE_PATH/certs/internal-functions"
dokku_log_warn "Deprecated: Please use certs:report"
cmd-certs-info "$@"

View File

@@ -27,7 +27,6 @@ help_desc
fn-help-content() {
declare desc="return help content"
cat <<help_content
checks <app>, [DEPRECATED] Alternative for checks:report
checks:disable <app> [process-type(s)], Disable zero-downtime deployment for all processes (or comma-separated process-type list) ***WARNING: this will cause downtime during deployments***
checks:enable <app> [process-type(s)], Enable zero-downtime deployment for all processes (or comma-separated process-type list)
checks:report [<app>] [<flag>], Displays a checks report for one or more apps

View File

@@ -1,31 +1,6 @@
#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/checks/functions"
source "$PLUGIN_AVAILABLE_PATH/checks/help-functions"
cmd-checks-default() {
declare desc="displays app zero-downtime checks status"
declare cmd="checks"
[[ "$1" == "$cmd" ]] && shift 1
declare APP="$1"
local APPS=$(dokku_apps)
if [[ -n "$APP" ]]; then
local APPS="$APP"
fi
dokku_log_warn "Deprecated: Please use checks:report"
dokku_col_log_info1_quiet "App Name" "Proctypes Disabled" "Proctypes Skipped"
local app
for app in $APPS; do
verify_app_name "$app"
local DOKKU_CHECKS_DISABLED=$(config_get "$app" DOKKU_CHECKS_DISABLED)
local DOKKU_CHECKS_SKIPPED=$(config_get "$app" DOKKU_CHECKS_SKIPPED)
local checks_disabled="${DOKKU_CHECKS_DISABLED:-none}"
local checks_skipped="${DOKKU_CHECKS_SKIPPED:-none}"
dokku_col_log_msg "$app" "$checks_disabled" "$checks_skipped"
done
}
cmd-checks-default "$@"
cmd-checks-help "checks:help"

View File

@@ -27,7 +27,6 @@ help_desc
fn-help-content() {
declare desc="return help content"
cat <<help_content
docker-options <app> [phase(s)], [DEPRECATED] Alternative for docker-options:report
docker-options:add <app> <phase(s)> OPTION, Add Docker option to app for phase (comma separated phase list)
docker-options:clear <app> [phase(s)], Clear a docker options from application with an optional phase (comma separated phase list)
docker-options:remove <app> <phase(s)> OPTION, Remove Docker option from app for phase (comma separated phase list)

View File

@@ -63,7 +63,7 @@ cmd-docker-options-report-single() {
fi
done
[[ "$match" == "true" ]] || dokku_log_fail "Invalid flag passed, valid flags:${valid_flags}"
[[ "$value_exists" == "true" ]] || dokku_log_fail "not deployed"
echo ""
fi
}

View File

@@ -1,23 +1,6 @@
#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/docker-options/functions"
source "$PLUGIN_AVAILABLE_PATH/docker-options/help-functions"
cmd-docker-options-default() {
declare desc="Display applications docker options"
declare cmd="docker-options"
[[ "$1" == "$cmd" ]] && shift 1
declare APP="$1"
dokku_log_warn "Deprecated: Please use docker-options:report"
verify_app_name "$APP"
read -ra passed_phases <<<"$(get_phases "$2")"
if [[ ! "${passed_phases[@]}" ]]; then
display_all_phases_options
else
display_passed_phases_options passed_phases[@]
fi
}
cmd-docker-options-default "$@"
cmd-docker-options-help "docker-options:help"

View File

@@ -27,7 +27,6 @@ help_desc
fn-help-content() {
declare desc="return help content"
cat <<help_content
domains [<app>], [DEPRECATED] Alternative for domains:report
domains:add <app> <domain> [<domain> ...], Add domains to app
domains:add-global <domain> [<domain> ...], Add global domain names
domains:clear <app>, Clear all domains for app

View File

@@ -1,34 +1,6 @@
#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
source "$PLUGIN_AVAILABLE_PATH/domains/help-functions"
cmd-domains-default() {
declare desc="print app domains"
declare cmd="domains"
[[ "$1" == "$cmd" ]] && shift 1
declare APP="$1"
dokku_log_warn "Deprecated: Please use domains:report"
if [[ "$(is_global_vhost_enabled)" == "true" ]]; then
dokku_log_info2_quiet "Global Domain Name"
get_global_vhosts
fi
if [[ "$APP" == "--global" ]]; then
return
fi
if [[ -n "$APP" ]]; then
verify_app_name "$APP"
if [[ -f "$DOKKU_ROOT/$APP/VHOST" ]]; then
dokku_log_info2_quiet "$APP Domain Names"
get_app_domains "$APP"
else
dokku_log_fail "No domain names set for $APP"
fi
fi
}
cmd-domains-default "$@"
cmd-domains-help "domains:help"

View File

@@ -1,8 +1,6 @@
#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/plugin/internal-functions"
source "$PLUGIN_AVAILABLE_PATH/plugin/help-functions"
dokku_log_warn "Deprecated: Please use plugin:list"
cmd-plugin-list "$@"
cmd-plugin-help "plugin:help"

View File

@@ -27,7 +27,6 @@ help_desc
fn-help-content() {
declare desc="return help content"
cat <<help_content
proxy <app>, [DEPRECATED] Show proxy settings for app
proxy:disable <app>, Disable proxy for app
proxy:enable <app>, Enable proxy for app
proxy:ports <app>, List proxy port mappings for app

View File

@@ -1,27 +1,6 @@
#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/proxy/functions"
source "$PLUGIN_AVAILABLE_PATH/proxy/help-functions"
cmd-proxy-default() {
declare desc="displays app proxy implementation via command line"
declare cmd="proxy"
[[ "$1" == "$cmd" ]] && shift 1
declare APP="$1"
local APPS=$(dokku_apps)
if [[ -n "$APP" ]]; then
local APPS="$APP"
fi
dokku_log_warn "Deprecated: Please use proxy:report"
dokku_col_log_info1_quiet "App Name" "Proxy Type"
local app
for app in $APPS; do
verify_app_name "$app"
dokku_col_log_msg "$app" "$(get_app_proxy_type "$app")"
done
}
cmd-proxy-default "$@"
cmd-proxy-help "proxy:help"

View File

@@ -27,7 +27,6 @@ help_desc
fn-help-content() {
declare desc="return help content"
cat <<help_content
trace, [DEPRECATED] Enables/Disables trace mode
trace:on, Enable trace mode
trace:off, Disable trace mode
help_content

View File

@@ -1,30 +1,6 @@
#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/trace/help-functions"
cmd-trace-default() {
declare desc="enables/disables trace mode"
declare cmd="trace"
[[ "$1" == "$cmd" ]] && shift 1
declare ARGUMENT="$1"
[[ -d $DOKKU_ROOT/.dokkurc ]] || mkdir -p "$DOKKU_ROOT/.dokkurc"
[[ "$ARGUMENT" == "on" ]] || [[ "$ARGUMENT" == "off" ]] || {
dokku_log_fail "Valid trace options are [on/off]"
}
dokku_log_warn "Deprecated: Please use trace:on or trace:off"
if [[ "$ARGUMENT" == "on" ]]; then
dokku_log_info1 "Enabling trace mode"
echo "export DOKKU_TRACE=1" >"$DOKKU_ROOT/.dokkurc/DOKKU_TRACE"
fi
if [[ "$ARGUMENT" == "off" ]]; then
dokku_log_info1 "Disabling trace mode"
rm -f "$DOKKU_ROOT/.dokkurc/DOKKU_TRACE"
fi
}
cmd-trace-default "$@"
cmd-trace-help "trace:help"