mirror of
https://github.com/dokku/dokku.git
synced 2026-02-23 19:50:34 +01:00
Use *_PATH consistently
GLOBAL_VHOST_PATH and GLOBAL_VHOST_FILE were used to represent the same thing. Same for APP_URLS_PATH and APP_VHOST_PATH. This normalizes all of those to _PATH.
This commit is contained in:
@@ -8,13 +8,13 @@ disable_app_vhost() {
|
||||
declare desc="disable vhost support for given application"
|
||||
declare APP=$1 RESTART_APP="$2"
|
||||
verify_app_name "$APP"
|
||||
local APP_VHOST_FILE="$DOKKU_ROOT/$APP/VHOST"
|
||||
local APP_URLS_FILE="$DOKKU_ROOT/$APP/URLS"
|
||||
local APP_VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"
|
||||
local APP_URLS_PATH="$DOKKU_ROOT/$APP/URLS"
|
||||
|
||||
plugn trigger pre-disable-vhost "$APP"
|
||||
if [[ -f "$APP_VHOST_FILE" ]] || [[ -f "$APP_URLS_FILE" ]]; then
|
||||
if [[ -f "$APP_VHOST_PATH" ]] || [[ -f "$APP_URLS_PATH" ]]; then
|
||||
dokku_log_info1 "App virtual host support disabled"
|
||||
rm -f "$APP_VHOST_FILE" "$APP_URLS_FILE"
|
||||
rm -f "$APP_VHOST_PATH" "$APP_URLS_PATH"
|
||||
fi
|
||||
|
||||
[[ "$RESTART_APP" == "--no-restart" ]] && local CONFIG_SET_ARGS=$RESTART_APP
|
||||
@@ -220,13 +220,13 @@ get_app_domains() {
|
||||
declare desc="return app domains"
|
||||
verify_app_name "$1"
|
||||
local APP=$1
|
||||
local APP_VHOST_FILE="$DOKKU_ROOT/$APP/VHOST"
|
||||
local APP_VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"
|
||||
local GLOBAL_VHOST_PATH="$DOKKU_ROOT/VHOST"
|
||||
local GLOBAL_HOSTNAME_PATH="$DOKKU_ROOT/HOSTNAME"
|
||||
|
||||
if [[ "$(is_app_vhost_enabled "$APP")" == "true" ]]; then
|
||||
if [[ -f "$APP_VHOST_FILE" ]]; then
|
||||
cat "$APP_VHOST_FILE"
|
||||
if [[ -f "$APP_VHOST_PATH" ]]; then
|
||||
cat "$APP_VHOST_PATH"
|
||||
elif [[ -f "$GLOBAL_VHOST_PATH" ]]; then
|
||||
cat "$GLOBAL_VHOST_PATH"
|
||||
elif [[ -f "$GLOBAL_HOSTNAME_PATH" ]]; then
|
||||
@@ -264,8 +264,8 @@ get_default_vhosts() {
|
||||
|
||||
get_global_vhosts() {
|
||||
declare desc="return global vhosts"
|
||||
local GLOBAL_VHOST_FILE="$DOKKU_ROOT/VHOST"
|
||||
[[ -f "$GLOBAL_VHOST_FILE" ]] && local GLOBAL_VHOSTS=$(<"$GLOBAL_VHOST_FILE")
|
||||
local GLOBAL_VHOST_PATH="$DOKKU_ROOT/VHOST"
|
||||
[[ -f "$GLOBAL_VHOST_PATH" ]] && local GLOBAL_VHOSTS=$(<"$GLOBAL_VHOST_PATH")
|
||||
echo "$GLOBAL_VHOSTS"
|
||||
}
|
||||
|
||||
|
||||
@@ -96,9 +96,9 @@ fn-domains-app-enabled() {
|
||||
|
||||
fn-domains-app-vhosts() {
|
||||
declare APP="$1"
|
||||
local APP_VHOST_FILE="$DOKKU_ROOT/$APP/VHOST"
|
||||
if [[ -f "$APP_VHOST_FILE" ]]; then
|
||||
tr '\n' ' ' <"$APP_VHOST_FILE"
|
||||
local APP_VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"
|
||||
if [[ -f "$APP_VHOST_PATH" ]]; then
|
||||
tr '\n' ' ' <"$APP_VHOST_PATH"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -315,7 +315,7 @@ nginx_build_config() {
|
||||
local DOKKU_APP_LISTEN_PORT="$2"
|
||||
local DOKKU_APP_LISTEN_IP="$3"
|
||||
local VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"
|
||||
local URLS_PATH="$DOKKU_ROOT/$APP/URLS"
|
||||
local APP_URLS_PATH="$DOKKU_ROOT/$APP/URLS"
|
||||
local NGINX_TEMPLATE_NAME="nginx.conf.sigil"
|
||||
local DEFAULT_NGINX_TEMPLATE="$PLUGIN_AVAILABLE_PATH/nginx-vhosts/templates/$NGINX_TEMPLATE_NAME"
|
||||
local NGINX_TEMPLATE="$DEFAULT_NGINX_TEMPLATE"
|
||||
@@ -484,8 +484,8 @@ nginx_build_config() {
|
||||
fi
|
||||
|
||||
if ([[ -n "$NONSSL_VHOSTS" ]] || [[ -n "$SSL_VHOSTS" ]]) && [[ "$IS_APP_VHOST_ENABLED" == "true" ]]; then
|
||||
echo "# THIS FILE IS GENERATED BY DOKKU - DO NOT EDIT, YOUR CHANGES WILL BE OVERWRITTEN" >"$URLS_PATH"
|
||||
xargs -i echo "$SCHEME://{}" <<<"$(echo "${SSL_VHOSTS}" "${NONSSL_VHOSTS}" | tr ' ' '\n' | sort -u)" >>"$URLS_PATH"
|
||||
echo "# THIS FILE IS GENERATED BY DOKKU - DO NOT EDIT, YOUR CHANGES WILL BE OVERWRITTEN" >"$APP_URLS_PATH"
|
||||
xargs -i echo "$SCHEME://{}" <<<"$(echo "${SSL_VHOSTS}" "${NONSSL_VHOSTS}" | tr ' ' '\n' | sort -u)" >>"$APP_URLS_PATH"
|
||||
fi
|
||||
else
|
||||
# note because this clause is long. if the proxy is disabled:
|
||||
|
||||
Reference in New Issue
Block a user