Merge remote-tracking branch 'origin/reduce-trace-output' into 1123_mh-nginx-novhost
This commit is contained in:
commit
fd44635e74
20 files changed
+83
-65
No files matched your search
+1
-1
@@ -42,7 +42,7 @@ dokku ps:rebuildall
|
|||||||
If dokku was installed via a debian package, you can upgrade herokuish via the following command:
|
If dokku was installed via a debian package, you can upgrade herokuish via the following command:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
sudo apt-get install Herokush
|
sudo apt-get install herokuish
|
||||||
```
|
```
|
||||||
|
|
||||||
For unattended upgrades, you may run the following command:
|
For unattended upgrades, you may run the following command:
|
||||||
|
|||||||
@@ -80,6 +80,16 @@ case "$1" in
|
|||||||
DOKKU_RESTART_LIMIT=$(dokku config:get $APP DOKKU_RESTART_LIMIT || echo 10)
|
DOKKU_RESTART_LIMIT=$(dokku config:get $APP DOKKU_RESTART_LIMIT || echo 10)
|
||||||
DOKKU_RESTART_LIMIT=${DOKKU_RESTART_LIMIT:=10}
|
DOKKU_RESTART_LIMIT=${DOKKU_RESTART_LIMIT:=10}
|
||||||
|
|
||||||
|
DOKKU_APP_SKIP_ALL_CHECKS=$(dokku config:get $APP DOKKU_SKIP_ALL_CHECKS || true)
|
||||||
|
DOKKU_APP_SKIP_DEFAULT_CHECKS=$(dokku config:get $APP DOKKU_SKIP_DEFAULT_CHECKS || true)
|
||||||
|
DOKKU_GLOBAL_SKIP_ALL_CHECKS=$(dokku config:get --global DOKKU_SKIP_ALL_CHECKS || true)
|
||||||
|
DOKKU_GLOBAL_SKIP_DEFAULT_CHECKS=$(dokku config:get --global DOKKU_SKIP_DEFAULT_CHECKS || true)
|
||||||
|
|
||||||
|
DOKKU_SKIP_ALL_CHECKS=${DOKKU_APP_SKIP_ALL_CHECKS:="$DOKKU_GLOBAL_SKIP_ALL_CHECKS"}
|
||||||
|
DOKKU_SKIP_DEFAULT_CHECKS=${DOKKU_APP_SKIP_DEFAULT_CHECKS:="$DOKKU_GLOBAL_SKIP_DEFAULT_CHECKS"}
|
||||||
|
|
||||||
|
DOKKU_DEFAULT_DOCKER_ARGS=$(: | plugn trigger docker-args-deploy $APP $IMAGE_TAG)
|
||||||
|
|
||||||
while read line || [[ -n "$line" ]]; do
|
while read line || [[ -n "$line" ]]; do
|
||||||
TRIM=${line%#*}
|
TRIM=${line%#*}
|
||||||
PROC_TYPE=${TRIM%%=*}
|
PROC_TYPE=${TRIM%%=*}
|
||||||
@@ -93,9 +103,9 @@ case "$1" in
|
|||||||
DOKKU_PORT_FILE="$DOKKU_ROOT/$APP/PORT.$PROC_TYPE.$CONTAINER_INDEX"
|
DOKKU_PORT_FILE="$DOKKU_ROOT/$APP/PORT.$PROC_TYPE.$CONTAINER_INDEX"
|
||||||
|
|
||||||
# start the app
|
# start the app
|
||||||
DOCKER_ARGS=" -e DYNO='$PROC_TYPE.$CONTAINER_INDEX' "
|
DOCKER_ARGS="$DOKKU_DEFAULT_DOCKER_ARGS"
|
||||||
|
DOCKER_ARGS+=" -e DYNO='$PROC_TYPE.$CONTAINER_INDEX' "
|
||||||
DOCKER_ARGS+=" --restart=on-failure:$DOKKU_RESTART_LIMIT"
|
DOCKER_ARGS+=" --restart=on-failure:$DOKKU_RESTART_LIMIT"
|
||||||
DOCKER_ARGS+=$(: | plugn trigger docker-args-deploy $APP $IMAGE_TAG)
|
|
||||||
[[ "$DOKKU_TRACE" ]] && DOCKER_ARGS+=" -e TRACE=true "
|
[[ "$DOKKU_TRACE" ]] && DOCKER_ARGS+=" -e TRACE=true "
|
||||||
BIND_EXTERNAL=$(plugn trigger bind-external-ip $APP)
|
BIND_EXTERNAL=$(plugn trigger bind-external-ip $APP)
|
||||||
|
|
||||||
@@ -127,14 +137,6 @@ case "$1" in
|
|||||||
kill -9 $$
|
kill -9 $$
|
||||||
}
|
}
|
||||||
|
|
||||||
DOKKU_APP_SKIP_ALL_CHECKS=$(dokku config:get $APP DOKKU_SKIP_ALL_CHECKS || true)
|
|
||||||
DOKKU_APP_SKIP_DEFAULT_CHECKS=$(dokku config:get $APP DOKKU_SKIP_DEFAULT_CHECKS || true)
|
|
||||||
DOKKU_GLOBAL_SKIP_ALL_CHECKS=$(dokku config:get --global DOKKU_SKIP_ALL_CHECKS || true)
|
|
||||||
DOKKU_GLOBAL_SKIP_DEFAULT_CHECKS=$(dokku config:get --global DOKKU_SKIP_DEFAULT_CHECKS || true)
|
|
||||||
|
|
||||||
DOKKU_SKIP_ALL_CHECKS=${DOKKU_APP_SKIP_ALL_CHECKS:="$DOKKU_GLOBAL_SKIP_ALL_CHECKS"}
|
|
||||||
DOKKU_SKIP_DEFAULT_CHECKS=${DOKKU_APP_SKIP_DEFAULT_CHECKS:="$DOKKU_GLOBAL_SKIP_DEFAULT_CHECKS"}
|
|
||||||
|
|
||||||
# run checks first, then post-deploy hooks, which switches Nginx traffic
|
# run checks first, then post-deploy hooks, which switches Nginx traffic
|
||||||
if [[ "$DOKKU_SKIP_ALL_CHECKS" = "true" ]]; then
|
if [[ "$DOKKU_SKIP_ALL_CHECKS" = "true" ]]; then
|
||||||
dokku_log_info1 "Skipping pre-flight checks"
|
dokku_log_info1 "Skipping pre-flight checks"
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
[[ " build release trace delete ls logs run url urls version help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
[[ " events events:on events:off events:list help events:help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
|
|
||||||
PLUGIN_DIR="$(dirname $0)"
|
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
events)
|
events)
|
||||||
if [[ -f $DOKKU_EVENTS_LOGFILE ]]; then
|
if [[ -f $DOKKU_EVENTS_LOGFILE ]]; then
|
||||||
@@ -27,6 +26,7 @@ case "$1" in
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
events:list)
|
events:list)
|
||||||
|
PLUGIN_DIR="$(dirname $0)"
|
||||||
if [[ "$DOKKU_EVENTS" ]]; then
|
if [[ "$DOKKU_EVENTS" ]]; then
|
||||||
logged="$(find $PLUGIN_DIR -type l -printf '%f ' | sort)"
|
logged="$(find $PLUGIN_DIR -type l -printf '%f ' | sort)"
|
||||||
dokku_col_log_info2_quiet "Events currently logged"
|
dokku_col_log_info2_quiet "Events currently logged"
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
[[ " apps apps:create apps:destroy help apps:help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
[[ " backup:export backup:import help backup:help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
CURRENT_BACKUP_VERSION=1
|
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
backup:export)
|
backup:export)
|
||||||
|
CURRENT_BACKUP_VERSION=1
|
||||||
OUTPUT_FILE="$2"
|
OUTPUT_FILE="$2"
|
||||||
BACKUP_DIR="$DOKKU_ROOT"
|
BACKUP_DIR="$DOKKU_ROOT"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
[[ " certs:add certs:generate certs:info certs:remove certs:update help certs:help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/certs/functions"
|
source "$PLUGIN_AVAILABLE_PATH/certs/functions"
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
[[ " config config:get config:set config:unset help config:help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ config_unset() {
|
|||||||
|
|
||||||
for var in $VARS; do
|
for var in $VARS; do
|
||||||
dokku_log_info1 "Unsetting $var"
|
dokku_log_info1 "Unsetting $var"
|
||||||
ENV_TEMP=$(echo -e "${ENV_TEMP}" | sed "/^export $var=/ d")
|
ENV_TEMP=$(echo "${ENV_TEMP}" | sed "/^export $var=/ d")
|
||||||
|
|
||||||
config_write "$ENV_TEMP"
|
config_write "$ENV_TEMP"
|
||||||
[[ "$var" == "NO_VHOST" ]] && config_set --no-restart $APP NO_VHOST=0 && DOKKU_CONFIG_RESTART=true
|
[[ "$var" == "NO_VHOST" ]] && config_set --no-restart $APP NO_VHOST=0 && DOKKU_CONFIG_RESTART=true
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
[[ " docker-options docker-options:add docker-options:remove help docker-options:help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
|
|
||||||
PHASES=(build deploy run)
|
|
||||||
|
|
||||||
FILE_PREFIX="DOCKER_OPTIONS_"
|
|
||||||
|
|
||||||
get_app() {
|
get_app() {
|
||||||
[[ -z $1 ]] && dokku_log_fail "Please specify an app to run the command on"
|
[[ -z $1 ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||||
verify_app_name "$1"
|
verify_app_name "$1"
|
||||||
@@ -25,17 +22,19 @@ get_phases() {
|
|||||||
|
|
||||||
verify_phase() {
|
verify_phase() {
|
||||||
local phase
|
local phase
|
||||||
for phase in "${PHASES[@]}"; do
|
local phases=(build deploy run)
|
||||||
|
for phase in "${phases[@]}"; do
|
||||||
if [[ "$phase" = "$1" ]]; then
|
if [[ "$phase" = "$1" ]]; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
dokku_log_fail "Phase(s) must be one of [${PHASES[@]}]"
|
dokku_log_fail "Phase(s) must be one of [${phases[@]}]"
|
||||||
}
|
}
|
||||||
|
|
||||||
get_phase_file_path() {
|
get_phase_file_path() {
|
||||||
local phase=$1
|
local phase=$1
|
||||||
phase_file_path="${DOKKU_ROOT}/${APP}/${FILE_PREFIX}${phase^^}"
|
local prefix="DOCKER_OPTIONS_"
|
||||||
|
phase_file_path="${DOKKU_ROOT}/${APP}/${prefix}${phase^^}"
|
||||||
}
|
}
|
||||||
|
|
||||||
create_phase_file_if_required() {
|
create_phase_file_if_required() {
|
||||||
@@ -53,7 +52,8 @@ display_phase_options() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
display_all_phases_options() {
|
display_all_phases_options() {
|
||||||
for phase in "${PHASES[@]}"; do
|
local phases=(build deploy run)
|
||||||
|
for phase in "${phases[@]}"; do
|
||||||
get_phase_file_path $phase
|
get_phase_file_path $phase
|
||||||
if [[ -s $phase_file_path ]]; then
|
if [[ -s $phase_file_path ]]; then
|
||||||
display_phase_options $phase $phase_file_path
|
display_phase_options $phase $phase_file_path
|
||||||
@@ -139,7 +139,7 @@ case "$1" in
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
# Display usage help
|
# Display usage help
|
||||||
help)
|
help | docker-options:help)
|
||||||
cat<<EOF
|
cat<<EOF
|
||||||
docker-options <app>, Display apps docker options for all phases
|
docker-options <app>, Display apps docker options for all phases
|
||||||
docker-options <app> <phase(s)>, Display apps docker options for phase (comma separated phase list)
|
docker-options <app> <phase(s)>, Display apps docker options for phase (comma separated phase list)
|
||||||
|
|||||||
@@ -1,29 +1,10 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
[[ " domains domains:setup domains:add domains:clear domains:remove help domains:help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/functions"
|
source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/functions"
|
||||||
|
|
||||||
RE_IPV4="([0-9]{1,3}[\.]){3}[0-9]{1,3}"
|
|
||||||
|
|
||||||
RE_IPV6="([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|" # TEST: 1:2:3:4:5:6:7:8
|
|
||||||
RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,7}:|" # TEST: 1:: 1:2:3:4:5:6:7::
|
|
||||||
RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|" # TEST: 1::8 1:2:3:4:5:6::8 1:2:3:4:5:6::8
|
|
||||||
RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|" # TEST: 1::7:8 1:2:3:4:5::7:8 1:2:3:4:5::8
|
|
||||||
RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|" # TEST: 1::6:7:8 1:2:3:4::6:7:8 1:2:3:4::8
|
|
||||||
RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|" # TEST: 1::5:6:7:8 1:2:3::5:6:7:8 1:2:3::8
|
|
||||||
RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|" # TEST: 1::4:5:6:7:8 1:2::4:5:6:7:8 1:2::8
|
|
||||||
RE_IPV6="${RE_IPV6}[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|" # TEST: 1::3:4:5:6:7:8 1::3:4:5:6:7:8 1::8
|
|
||||||
RE_IPV6="${RE_IPV6}:((:[0-9a-fA-F]{1,4}){1,7}|:)|" # TEST: ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::
|
|
||||||
RE_IPV6="${RE_IPV6}fe08:(:[0-9a-fA-F]{1,4}){2,2}%[0-9a-zA-Z]{1,}|" # TEST: fe08::7:8%eth0 fe08::7:8%1 (link-local IPv6 addresses with zone index)
|
|
||||||
RE_IPV6="${RE_IPV6}::(ffff(:0{1,4}){0,1}:){0,1}${RE_IPV4}|" # TEST: ::255.255.255.255 ::ffff:255.255.255.255 ::ffff:0:255.255.255.255 (IPv4-mapped IPv6 addresses and IPv4-translated addresses)
|
|
||||||
RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,4}:${RE_IPV4}" # TEST: 2001:db8:3:4::192.0.2.33 64:ff9b::192.0.2.33
|
|
||||||
|
|
||||||
# Ensure the ip address continues to the end of the line
|
|
||||||
# Fixes using a wildcard dns service such as xip.io which allows for *.<ip address>.xip.io
|
|
||||||
RE_IPV4="${RE_IPV4}\$"
|
|
||||||
RE_IPV6="${RE_IPV6}\$"
|
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
domains)
|
domains)
|
||||||
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
|
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||||
@@ -43,6 +24,7 @@ case "$1" in
|
|||||||
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
|
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||||
verify_app_name "$2"
|
verify_app_name "$2"
|
||||||
APP="$2"; VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"
|
APP="$2"; VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"
|
||||||
|
RE_IPV4="$(get_ipv4_regex)"; RE_IPV6="$(get_ipv6_regex)"
|
||||||
|
|
||||||
if [[ ! -f $VHOST_PATH ]]; then
|
if [[ ! -f $VHOST_PATH ]]; then
|
||||||
if [[ -f "$DOKKU_ROOT/VHOST" ]]; then
|
if [[ -f "$DOKKU_ROOT/VHOST" ]]; then
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
[[ " enter help enter:help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
[[ " nginx:build-config nginx:access-logs nginx:error-logs nginx:disable nginx:enable help nginx:help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||||
|
|||||||
@@ -5,6 +5,41 @@ source "$PLUGIN_AVAILABLE_PATH/certs/functions"
|
|||||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
||||||
|
|
||||||
|
_ipv4_regex() {
|
||||||
|
echo "([0-9]{1,3}[\.]){3}[0-9]{1,3}"
|
||||||
|
}
|
||||||
|
|
||||||
|
_ipv6_regex() {
|
||||||
|
local RE_IPV4="$(_ipv4_regex)"
|
||||||
|
local RE_IPV6="([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|" # TEST: 1:2:3:4:5:6:7:8
|
||||||
|
RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,7}:|" # TEST: 1:: 1:2:3:4:5:6:7::
|
||||||
|
RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|" # TEST: 1::8 1:2:3:4:5:6::8 1:2:3:4:5:6::8
|
||||||
|
RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|" # TEST: 1::7:8 1:2:3:4:5::7:8 1:2:3:4:5::8
|
||||||
|
RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|" # TEST: 1::6:7:8 1:2:3:4::6:7:8 1:2:3:4::8
|
||||||
|
RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|" # TEST: 1::5:6:7:8 1:2:3::5:6:7:8 1:2:3::8
|
||||||
|
RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|" # TEST: 1::4:5:6:7:8 1:2::4:5:6:7:8 1:2::8
|
||||||
|
RE_IPV6="${RE_IPV6}[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|" # TEST: 1::3:4:5:6:7:8 1::3:4:5:6:7:8 1::8
|
||||||
|
RE_IPV6="${RE_IPV6}:((:[0-9a-fA-F]{1,4}){1,7}|:)|" # TEST: ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::
|
||||||
|
RE_IPV6="${RE_IPV6}fe08:(:[0-9a-fA-F]{1,4}){2,2}%[0-9a-zA-Z]{1,}|" # TEST: fe08::7:8%eth0 fe08::7:8%1 (link-local IPv6 addresses with zone index)
|
||||||
|
RE_IPV6="${RE_IPV6}::(ffff(:0{1,4}){0,1}:){0,1}${RE_IPV4}|" # TEST: ::255.255.255.255 ::ffff:255.255.255.255 ::ffff:0:255.255.255.255 (IPv4-mapped IPv6 addresses and IPv4-translated addresses)
|
||||||
|
RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,4}:${RE_IPV4}" # TEST: 2001:db8:3:4::192.0.2.33 64:ff9b::192.0.2.33
|
||||||
|
echo "$RE_IPV6"
|
||||||
|
}
|
||||||
|
|
||||||
|
get_ipv4_regex() {
|
||||||
|
local RE_IPV4="$(_ipv4_regex)"
|
||||||
|
# Ensure the ip address continues to the end of the line
|
||||||
|
# Fixes using a wildcard dns service such as xip.io which allows for *.<ip address>.xip.io
|
||||||
|
echo "${RE_IPV4}\$"
|
||||||
|
}
|
||||||
|
|
||||||
|
get_ipv6_regex() {
|
||||||
|
local RE_IPV6="$(_ipv4_regex)"
|
||||||
|
# Ensure the ip address continues to the end of the line
|
||||||
|
# Fixes using a wildcard dns service such as xip.io which allows for *.<ip address>.xip.io
|
||||||
|
echo "${RE_IPV6}\$"
|
||||||
|
}
|
||||||
|
|
||||||
is_app_nginx_enabled() {
|
is_app_nginx_enabled() {
|
||||||
local APP="$1"
|
local APP="$1"
|
||||||
verify_app_name "$APP"
|
verify_app_name "$APP"
|
||||||
@@ -22,26 +57,10 @@ is_global_vhost_enabled() {
|
|||||||
local GLOBAL_VHOST_ENABLED=true
|
local GLOBAL_VHOST_ENABLED=true
|
||||||
[[ -f "$GLOBAL_VHOST_FILE" ]] && local GLOBAL_VHOST=$(< "$GLOBAL_VHOST_FILE")
|
[[ -f "$GLOBAL_VHOST_FILE" ]] && local GLOBAL_VHOST=$(< "$GLOBAL_VHOST_FILE")
|
||||||
|
|
||||||
local RE_IPV4="([0-9]{1,3}[\.]){3}[0-9]{1,3}"
|
|
||||||
|
|
||||||
local RE_IPV6="([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|" # TEST: 1:2:3:4:5:6:7:8
|
|
||||||
local RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,7}:|" # TEST: 1:: 1:2:3:4:5:6:7::
|
|
||||||
local RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|" # TEST: 1::8 1:2:3:4:5:6::8 1:2:3:4:5:6::8
|
|
||||||
local RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|" # TEST: 1::7:8 1:2:3:4:5::7:8 1:2:3:4:5::8
|
|
||||||
local RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|" # TEST: 1::6:7:8 1:2:3:4::6:7:8 1:2:3:4::8
|
|
||||||
local RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|" # TEST: 1::5:6:7:8 1:2:3::5:6:7:8 1:2:3::8
|
|
||||||
local RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|" # TEST: 1::4:5:6:7:8 1:2::4:5:6:7:8 1:2::8
|
|
||||||
local RE_IPV6="${RE_IPV6}[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|" # TEST: 1::3:4:5:6:7:8 1::3:4:5:6:7:8 1::8
|
|
||||||
local RE_IPV6="${RE_IPV6}:((:[0-9a-fA-F]{1,4}){1,7}|:)|" # TEST: ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::
|
|
||||||
local RE_IPV6="${RE_IPV6}fe08:(:[0-9a-fA-F]{1,4}){2,2}%[0-9a-zA-Z]{1,}|" # TEST: fe08::7:8%eth0 fe08::7:8%1 (link-local IPv6 addresses with zone index)
|
|
||||||
local RE_IPV6="${RE_IPV6}::(ffff(:0{1,4}){0,1}:){0,1}${RE_IPV4}|" # TEST: ::255.255.255.255 ::ffff:255.255.255.255 ::ffff:0:255.255.255.255 (IPv4-mapped IPv6 addresses and IPv4-translated addresses)
|
|
||||||
local RE_IPV6="${RE_IPV6}([0-9a-fA-F]{1,4}:){1,4}:${RE_IPV4}" # TEST: 2001:db8:3:4::192.0.2.33 64:ff9b::192.0.2.33
|
|
||||||
|
|
||||||
|
|
||||||
# Ensure the ip address continues to the end of the line
|
# Ensure the ip address continues to the end of the line
|
||||||
# Fixes using a wildcard dns service such as xip.io which allows for *.<ip address>.xip.io
|
# Fixes using a wildcard dns service such as xip.io which allows for *.<ip address>.xip.io
|
||||||
local RE_IPV4="${RE_IPV4}\$"
|
local RE_IPV4="$(get_ipv4_regex)"
|
||||||
local RE_IPV6="${RE_IPV6}\$"
|
local RE_IPV6="$(get_ipv6_regex)"
|
||||||
|
|
||||||
if [[ -z "$GLOBAL_VHOST" ]] || [[ "$GLOBAL_VHOST" =~ $RE_IPV4 ]] || [[ "$GLOBAL_VHOST" =~ $RE_IPV6 ]]; then
|
if [[ -z "$GLOBAL_VHOST" ]] || [[ "$GLOBAL_VHOST" =~ $RE_IPV4 ]] || [[ "$GLOBAL_VHOST" =~ $RE_IPV6 ]]; then
|
||||||
local GLOBAL_VHOST_ENABLED=false
|
local GLOBAL_VHOST_ENABLED=false
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
[[ " plugin plugin:install plugin:install-dependencies plugin:update plugin:disable plugin:enable plugin:uninstall help plugin:help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/plugin/functions"
|
source "$PLUGIN_AVAILABLE_PATH/plugin/functions"
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
[[ " ps ps:start ps:stop ps:rebuild ps:rebuildall ps:restart ps:restartall ps:scale help ps:help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/ps/functions"
|
source "$PLUGIN_AVAILABLE_PATH/ps/functions"
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
[[ " shell help shell:help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
[[ " tags tags:create tags:deploy tags:destroy help tags:help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/tags/functions"
|
source "$PLUGIN_AVAILABLE_PATH/tags/functions"
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
[[ " tar-from tar:from tar-in tar:in tar-build tar-build-locked help tar:help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
|
|
||||||
@@ -57,7 +58,7 @@ case "$1" in
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
help)
|
help | tar:help)
|
||||||
cat && cat<<EOF
|
cat && cat<<EOF
|
||||||
tar:in <app>, Reads an tarball containing the app from stdin
|
tar:in <app>, Reads an tarball containing the app from stdin
|
||||||
tar:from <app> <url>, Loads an app tarball from url.
|
tar:from <app> <url>, Loads an app tarball from url.
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ teardown() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@test "(config) config:unset" {
|
@test "(config) config:unset" {
|
||||||
run ssh dokku@dokku.me config:set $TEST_APP test_var=true test_var2=\"hello world\"
|
run ssh dokku@dokku.me config:set $TEST_APP test_var=true test_var2=\"hello world\" test_var3=\"with\\nnewline\"
|
||||||
echo "output: "$output
|
echo "output: "$output
|
||||||
echo "status: "$status
|
echo "status: "$status
|
||||||
assert_success
|
assert_success
|
||||||
@@ -93,6 +93,10 @@ teardown() {
|
|||||||
echo "output: "$output
|
echo "output: "$output
|
||||||
echo "status: "$status
|
echo "status: "$status
|
||||||
assert_output ""
|
assert_output ""
|
||||||
|
run dokku config:get $TEST_APP test_var3
|
||||||
|
echo "output: "$output
|
||||||
|
echo "status: "$status
|
||||||
|
assert_output 'with\nnewline'
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "(config) global config (herokuish)" {
|
@test "(config) global config (herokuish)" {
|
||||||
|
|||||||
Reference in new issue
Block a user