-
-
-
-
-
-"""
-
-if __name__ == "__main__":
- main()
diff --git a/contrib/release-dokku b/contrib/release-dokku
index 09a8649fe..29eef5055 100755
--- a/contrib/release-dokku
+++ b/contrib/release-dokku
@@ -204,7 +204,6 @@ fn-repo-update() {
return
fi
- fn-replace-version "$CURRENT_VERSION" "$NEXT_VERSION" contrib/dokku-installer.py
fn-replace-version "$CURRENT_VERSION" "$NEXT_VERSION" debian/control
fn-replace-version "$CURRENT_VERSION" "$NEXT_VERSION" Dockerfile
fn-replace-version "$CURRENT_VERSION" "$NEXT_VERSION" docs/advanced-usage/plugin-management.md
diff --git a/debian/config b/debian/config
index 664060915..e4bcc25be 100755
--- a/debian/config
+++ b/debian/config
@@ -10,14 +10,6 @@ fi
readonly ACTION="${1:-configure}"
readonly VERSION="${2:-dev}"
-db_input "high" "dokku/web_config" || true
-db_go || true
-
-db_get "dokku/web_config"
-if [ $RET = "true" ]; then
- exit 0
-fi
-
db_input "high" "dokku/nginx_enable" || true
db_input "high" "dokku/hostname" || true
db_input "high" "dokku/vhost_enable" || true
diff --git a/debian/lintian-overrides b/debian/lintian-overrides
index 31e14eb7e..b659deeeb 100644
--- a/debian/lintian-overrides
+++ b/debian/lintian-overrides
@@ -10,6 +10,3 @@ dokku: hardening-no-relro
# Built golang binaries link to libc
dokku: missing-dependency-on-libc
-
-# Temporary python dependency until #2247 is resolved
-dokku: python-script-but-no-python-dep usr/share/dokku/contrib/dokku-installer.py
diff --git a/debian/postinst b/debian/postinst
index d3da1c214..6ec201193 100755
--- a/debian/postinst
+++ b/debian/postinst
@@ -102,40 +102,7 @@ setup-sshcommand() {
fi
}
-setup-dokku-installer() {
- NGINX_ROOT="/etc/nginx"
- [[ -x /usr/bin/openresty ]] && NGINX_ROOT="/usr/local/openresty/nginx/conf"
-
- if command -v "python3" &>/dev/null; then
- sed -i '1 s/^.*$/#!\/usr\/bin\/env python3/' /usr/share/dokku/contrib/dokku-installer.py
- elif command -v "python2.7" &>/dev/null; then
- sed -i '1 s/^.*$/#!\/usr\/bin\/env python2.7/' /usr/share/dokku/contrib/dokku-installer.py
- fi
-
- if [[ -f "$NGINX_ROOT/conf.d/dokku-installer.conf" ]]; then
- echo "Setting up dokku-installer"
- /usr/share/dokku/contrib/dokku-installer.py onboot
-
- if command -v systemctl &>/dev/null; then
- echo "Enabling dokku-installer"
- systemctl enable dokku-installer
- fi
-
- installer_status="$(service dokku-installer status 2>/dev/null || true)"
- if echo $installer_status | grep -Eq "(inactive|waiting)" >/dev/null; then
- echo "Starting dokku-installer"
- service dokku-installer start || echo "Unable to start dokku-installer"
- fi
- fi
-}
-
dpkg-handling() {
- db_get "dokku/web_config"
- if [ "$RET" = "true" ]; then
- db_stop
- exit 0
- fi
-
if [ -f "${DOKKU_ROOT}/VHOST" ]; then
echo "VHOST file detected, skipping modification"
else
@@ -147,9 +114,6 @@ dpkg-handling() {
fi
fi
- db_get "dokku/hostname"
- echo "$RET" >"${DOKKU_ROOT}/HOSTNAME"
-
if [ -z "${DEBCONF_RECONFIGURE}" ]; then
db_get "dokku/key_file"
if [ -f "$RET" ]; then
@@ -173,7 +137,6 @@ case "$1" in
setup-storage
setup-plugins
setup-sshcommand
- setup-dokku-installer
dpkg-handling
;;
diff --git a/debian/preinst b/debian/preinst
index 256b1a4cb..7493eca05 100755
--- a/debian/preinst
+++ b/debian/preinst
@@ -7,55 +7,8 @@ if [[ -e /usr/share/debconf/confmodule ]]; then
. /usr/share/debconf/confmodule
fi
-setup_dokku_installer() {
- NGINX_BASE_PATH="$1"
- NGINX_INIT_NAME="$2"
-
- NGINX_CONF="${NGINX_BASE_PATH}/conf.d/dokku-installer.conf"
-
- rm -f $NGINX_CONF
- touch $NGINX_CONF
-
- {
- echo 'upstream dokku-installer { server 127.0.0.1:2000; }'
- echo 'server {'
- echo ' listen 80;'
- echo ' location / {'
- echo ' proxy_pass http://dokku-installer;'
- echo ' }'
- echo '}'
- } >>$NGINX_CONF
-
- rm -f $NGINX_BASE_PATH/sites-enabled/*
- DOKKU_DISTRO="$(
- . /etc/os-release >/dev/null 2>&1 || true
- echo "$ID"
- )"
- case "$DOKKU_DISTRO" in
- debian)
- /usr/sbin/invoke-rc.d "$NGINX_INIT_NAME" reload || /usr/sbin/invoke-rc.d "$NGINX_INIT_NAME" start
- ;;
- ubuntu)
- if [[ -x /usr/bin/sv ]]; then
- /usr/bin/sv reload "$NGINX_INIT_NAME" || /usr/bin/sv start "$NGINX_INIT_NAME"
- else
- "/etc/init.d/$NGINX_INIT_NAME" reload || "/etc/init.d/$NGINX_INIT_NAME" start
- fi
- ;;
- esac
-}
-
case "$1" in
install)
- db_get "dokku/web_config"
- if [ "$RET" = "true" ]; then
- if [[ -x /usr/bin/openresty ]]; then
- setup_dokku_installer "/usr/local/openresty/nginx/conf" "openresty"
- else
- setup_dokku_installer "/etc/nginx" "nginx"
- fi
- fi
-
db_get "dokku/skip_key_file"
if [ -z "${DEBCONF_RECONFIGURE}" ] && [ "$RET" != "true" ]; then
db_get "dokku/key_file"
diff --git a/debian/templates b/debian/templates
index e5f314de4..93e7a9768 100644
--- a/debian/templates
+++ b/debian/templates
@@ -1,8 +1,3 @@
-Template: dokku/web_config
-Description: Enable the web-based config page?
-Type: boolean
-Default: true
-
Template: dokku/vhost_enable
Description: Enable vhost-based deployments?
Type: boolean
diff --git a/docs/appendices/0.25.0-migration-guide.md b/docs/appendices/0.25.0-migration-guide.md
index bac49ac9d..4a59b285b 100644
--- a/docs/appendices/0.25.0-migration-guide.md
+++ b/docs/appendices/0.25.0-migration-guide.md
@@ -30,3 +30,4 @@ The [dokku-registry](https://github.com/dokku/dokku-registry) plugin is now buil
## Removals
- As of April 2021, Ubuntu 16.04 is no longer an LTS release, and support has been removed. Packages may still install on older versions of Ubuntu, but are no longer tested, and therefore no support will be provided.
+- The web installer has been removed. Users are now required to setup Dokku via cli commands. This change was made to combat potential security issues where users ignored the web installer, allowing unauthorized users to add their keys to the host.
diff --git a/docs/deployment/user-management.md b/docs/deployment/user-management.md
index 23a5ac4ff..356cc60e7 100644
--- a/docs/deployment/user-management.md
+++ b/docs/deployment/user-management.md
@@ -18,7 +18,7 @@ Users in Dokku are managed via the `~/dokku/.ssh/authorized_keys` file. It is *h
### Listing SSH keys
-You can use the `ssh-keys:list` command to show all configured SSH keys. Any key added via the `dokku-installer` will be associated with the `admin` key name.
+You can use the `ssh-keys:list` command to show all configured SSH keys.
```shell
dokku ssh-keys:list
diff --git a/docs/development/plugin-triggers.md b/docs/development/plugin-triggers.md
index ded3a5092..d2b0416d3 100644
--- a/docs/development/plugin-triggers.md
+++ b/docs/development/plugin-triggers.md
@@ -799,8 +799,8 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
-if [[ ! -f "$DOKKU_ROOT/HOSTNAME" ]]; then
- hostname -f > $DOKKU_ROOT/HOSTNAME
+if [[ ! -f "$DOKKU_ROOT/VHOST" ]]; then
+ hostname -f > $DOKKU_ROOT/VHOST
fi
```
@@ -2375,7 +2375,7 @@ Note that the trigger should exit as follows:
The `SSH_USER` is the original ssh user. If you are running remote commands, this user will typically be `dokku`, and as such should not be trusted when checking permissions. If you are connected via ssh as a different user who then invokes `dokku`, the value of this variable will be that user's name (`root`, `myuser`, etc.).
-The `SSH_NAME` is the `NAME` variable set via the `sshcommand acl-add` command. If you have set a user via the `dokku-installer`, this value will be set to `admin`. For installs via debian package, this value _may_ be `default`. For reference, the following command can be run as the root user to specify a specific `NAME` for a given ssh key:
+The `SSH_NAME` is the `NAME` variable set via the `sshcommand acl-add` command. For reference, the following command can be run as the root user to specify a specific `NAME` for a given ssh key:
```shell
sshcommand acl-add dokku NAME < $PATH_TO_SSH_KEY
diff --git a/docs/getting-started/advanced-installation.md b/docs/getting-started/advanced-installation.md
index ef0de6233..397145af3 100644
--- a/docs/getting-started/advanced-installation.md
+++ b/docs/getting-started/advanced-installation.md
@@ -50,12 +50,10 @@ The Herokuish package is recommended but not required if not using Heroku buildp
## Configuring an unattended installation
-Once Dokku is installed, if you are not using the web-installer, you'll want to configure the virtualhost setup as well as the push user. If you do not, your installation will be considered incomplete and you will not be able to deploy applications.
+Once Dokku is installed, you'll want to configure the virtualhost setup as well as the push user. If you do not, your installation will be considered incomplete and you will not be able to deploy applications.
For Debian, unattended installation is described [Debian installation guide](/docs/getting-started/install/debian.md).
-> Warning: You should also stop and disable the `dokku-installer` service to remove public access to adding SSH keys.
-
Set up a domain using your preferred vendor and a wildcard domain pointing to the host running Dokku. You can manage this global domain using the [domains plugin](/docs/configuration/domains.md).
Follow the [user management documentation](/docs/deployment/user-management.md) in order to add SSH keys for users to Dokku, or to give other Unix accounts access to Dokku.
diff --git a/docs/getting-started/install/debian.md b/docs/getting-started/install/debian.md
index 0acad0bbc..259c1d531 100644
--- a/docs/getting-started/install/debian.md
+++ b/docs/getting-started/install/debian.md
@@ -36,7 +36,6 @@ After setting the desired options, proceed with the installation as described ab
| Name | Type | Default | Description |
| ------------------ | ------- | --------------------- | ------------------------------------------------------------------------ |
-| dokku/web_config | boolean | true | Use web-based config for below options |
| dokku/vhost_enable | boolean | false | Use vhost-based deployments (e.g. `[yourapp].dokku.me`) |
| dokku/hostname | string | dokku.me | Hostname, used as vhost domain and for showing app URL after deploy |
| dokku/skip_key_file| boolean | false | Don't check for the existence of the dokku/key_file. Warning: Setting this to true, will require you to manually add an SSH key later on. |
diff --git a/docs/getting-started/install/docker.md b/docs/getting-started/install/docker.md
index 1494a4d50..7915bb034 100644
--- a/docs/getting-started/install/docker.md
+++ b/docs/getting-started/install/docker.md
@@ -29,7 +29,6 @@ Dokku is run in the following configuration:
- Container HTTPS port 443 is exposed on the host as 8443.
- Data within the container is stored on the host within the `/var/lib/dokku` directory.
- The docker socket is mounted into container
-- The "web installer" is not supported.
Application repositories, plugin config, as well as plugin data are persisted to disk within the specified host directory for `/var/lib/dokku`.
diff --git a/docs/getting-started/install/dreamhost.md b/docs/getting-started/install/dreamhost.md
index e989c9d33..aec0d306d 100644
--- a/docs/getting-started/install/dreamhost.md
+++ b/docs/getting-started/install/dreamhost.md
@@ -180,7 +180,6 @@ apt:
-----END PGP PUBLIC KEY BLOCK-----
debconf_selections:
- web: dokku dokku/web_config boolean false
vhost: dokku dokku/vhost_enable boolean true
# set the domain name of the new Dokku server
hostname: dokku dokku/hostname string $YOUR_FULL_QUALIFIED_DOMAIN
diff --git a/docs/getting-started/install/vagrant.md b/docs/getting-started/install/vagrant.md
index 5b8055ed6..dc79175b6 100644
--- a/docs/getting-started/install/vagrant.md
+++ b/docs/getting-started/install/vagrant.md
@@ -38,8 +38,16 @@
> For users that have customized the IP address of their VM - either in a custom `Vagrantfile` or via the `DOKKU_IP` environment variable - and are not using `10.0.0.2` for the Vagrant IP, you'll need to instead use the output of `vagrant ssh-config dokku` for your `~/.ssh/config` entry.
-6. Copy your SSH key via `cat ~/.ssh/id_rsa.pub | pbcopy` and paste it into the dokku-installer at http://dokku.me . Change the `Hostname` field on the Dokku Setup screen to your domain and then check the box that says **Use virtualhost naming**. Then click **Finish Setup** to install your key. You'll be directed to application deployment instructions from here.
+6. Connect to the server and add your ssh key to the install. Additionally, set the global domain name to `dokku.me`.
-Please note, the `dokku.me` domain is setup to point to `10.0.0.2` along with all subdomains (i.e. `yourapp.dokku.me`). If you change the `DOKKU_IP` in your Vagrant setup you'll need to update your `/etc/hosts` file to point your reconfigured IP address.
+ ```shell
+ # usually your key is already available under the current user's `~/.ssh/authorized_keys` file
+ cat ~/.ssh/authorized_keys | dokku ssh-keys:add admin
+
+ # you can use any domain you already have access to
+ dokku domains:set-global dokku.me
+ ```
+
+ > Please note, the `dokku.me` domain is setup to point to `10.0.0.2` along with all subdomains (i.e. `yourapp.dokku.me`). If you change the `DOKKU_IP` in your Vagrant setup you'll need to update your `/etc/hosts` file to point your reconfigured IP address.
You are now ready to deploy an app or install plugins.
diff --git a/docs/getting-started/installation.md b/docs/getting-started/installation.md
index 0c50040e3..84b376187 100644
--- a/docs/getting-started/installation.md
+++ b/docs/getting-started/installation.md
@@ -35,17 +35,23 @@ When connecting a domain, either a single domain or a wildcard may be associated
#### 3. Setup SSH key and Virtualhost Settings
-Once the installation is complete, you can open a browser to setup your SSH key and virtualhost settings. Open your browser of choice and navigate to the host's IP address - or the domain you assigned to that IP previously - and configure Dokku via the web admin.
+Once the installation is complete, you should configure an ssh key and set your global domain:from-archive
-Alternatively, instructions to skip the web installer with an unattended installation are available in the [advanced install guide](/docs/getting-started/advanced-installation.md#configuring).
+```shell
+# usually your key is already available under the current user's `~/.ssh/authorized_keys` file
+cat ~/.ssh/authorized_keys | dokku ssh-keys:add admin
-> **Warning:** If you don't complete setup via the web installer (even if you set up SSH keys and virtual hosts otherwise) your Dokku installation will remain vulnerable to anyone finding the setup page and inserting their key. You can check if it is still running via `ps auxf | grep dokku-installer`, and it may be stopped via your server's init system - usually either `service dokku-installer stop` or `stop dokku-installer`.
+# you can use any domain you already have access to
+dokku domains:set-global dokku.me
+```
-> **Warning:** Web installer is not available on CentOS and Arch Linux. You will need to configure [SSH keys](/docs/deployment/user-management.md#adding-ssh-keys) and [virtual hosts](/docs/configuration/domains.md#customizing-hostnames) using dokku command line interface - see unattended installation linked above.
+See the [user management](/docs/deployment/user-management.md#adding-ssh-keys) and [domains documentation](/docs/configuration/domains.md#customizing-hostnames) for more information.
+
+Alternatively, instructions for an unattended installation are available in the [advanced install guide](/docs/getting-started/advanced-installation.md#configuring).
#### 4. Deploy your first application
-Once you save your settings, the web admin will self-terminate and you should be able to run or [deploy to the Dokku installation](/docs/deployment/application-deployment.md).
+At this point, you should be able to run or [deploy to the Dokku installation](/docs/deployment/application-deployment.md).
### Installing via other methods
diff --git a/package.mk b/package.mk
index 2b9a3dc01..dbfa1eaac 100644
--- a/package.mk
+++ b/package.mk
@@ -3,7 +3,6 @@
mkdir -p /tmp/build-dokku/usr/share/bash-completion/completions
mkdir -p /tmp/build-dokku/usr/bin
mkdir -p /tmp/build-dokku/usr/share/doc/dokku
- mkdir -p /tmp/build-dokku/usr/share/dokku/contrib
mkdir -p /tmp/build-dokku/usr/share/lintian/overrides
mkdir -p /tmp/build-dokku/usr/share/man/man1
mkdir -p /tmp/build-dokku/var/lib/dokku/core-plugins/available
@@ -22,7 +21,6 @@
$(MAKE) addman
cp /usr/local/share/man/man1/dokku.1 /tmp/build-dokku/usr/share/man/man1/dokku.1
gzip -9 /tmp/build-dokku/usr/share/man/man1/dokku.1
- cp contrib/dokku-installer.py /tmp/build-dokku/usr/share/dokku/contrib
ifeq ($(DOKKU_VERSION),master)
git describe --tags > /tmp/build-dokku/var/lib/dokku/VERSION
else
diff --git a/plugins/00_dokku-standard/install b/plugins/00_dokku-standard/install
index 7ca975665..640db6f3e 100755
--- a/plugins/00_dokku-standard/install
+++ b/plugins/00_dokku-standard/install
@@ -2,12 +2,8 @@
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
-if [[ ! -f "$DOKKU_ROOT/HOSTNAME" ]]; then
- hostname -f >"$DOKKU_ROOT/HOSTNAME"
-fi
-
if [[ ! -f "$DOKKU_ROOT/VHOST" ]]; then
- [[ $(dig +short "$(<"$DOKKU_ROOT/HOSTNAME")") ]] && cp "$DOKKU_ROOT/HOSTNAME" "$DOKKU_ROOT/VHOST"
+ [[ $(dig +short "$(hostname -f)") ]] && hostname -f >"$DOKKU_ROOT/VHOST"
fi
dokku_path="$(which dokku)"
@@ -48,21 +44,34 @@ EOF
fi
mkdir -p /etc/update-motd.d
-cat </etc/update-motd.d/99-dokku
+cat </etc/update-motd.d/99-dokku
#!/bin/sh
-if [ ! -f "/home/dokku/HOSTNAME" ]; then
- echo "\nTo avoid cli-based dokku configuration, use the web installer"
- echo "Debian-based installs should have this running and available"
- echo "on port 80. You can also install it via the following commands:"
- echo ""
- echo " cd /root/dokku"
- echo " sudo make dokku-installer\n"
-fi
-EOF
-chmod +x /etc/update-motd.d/99-dokku
+if [ ! -s "$DOKKU_ROOT/VHOST" ]; then
+cat <<'EOF'
-chown dokku:dokku "$DOKKU_ROOT/HOSTNAME"
+ ! If using virtualhost routing is desired (eg. my-app => my-app.dokku.me), set a global domain for your server:
+
+ dokku domains:set-global dokku.me
+EOF
+fi
+
+if [ ! -s "$DOKKU_ROOT/.ssh/authorized_keys" ]; then
+cat <<'EOF'
+
+ ! Setup a user's ssh key for deployment by passing in the public ssh key as shown:
+
+ echo 'CONTENTS_OF_ID_RSA_PUB_FILE' | dokku ssh-keys:add admin
+EOF
+fi
+
+if [ ! -f "$DOKKU_ROOT/VHOST" ] || [ ! -s "$DOKKU_ROOT/.ssh/authorized_keys" ]; then
+cat <<'EOF'
+
+EOF
+fi
+DOKKU_EOF
+chmod +x /etc/update-motd.d/99-dokku
if [[ -f "$DOKKU_ROOT/VHOST" ]]; then
chown dokku:dokku "$DOKKU_ROOT/VHOST"
diff --git a/plugins/common/functions b/plugins/common/functions
index bac347ab5..9bd8d8c97 100755
--- a/plugins/common/functions
+++ b/plugins/common/functions
@@ -933,7 +933,6 @@ internal_get_app_urls() {
source "$PLUGIN_AVAILABLE_PATH/config/functions"
local APP="$2"
- local RAW_TCP_PORTS="$(get_app_raw_tcp_ports "$APP")"
local URLS_FILE="$DOKKU_ROOT/$APP/URLS"
local DOKKU_PROXY_PORT_MAP=$(config_get "$APP" DOKKU_PROXY_PORT_MAP || true)
@@ -969,42 +968,56 @@ internal_get_app_urls() {
;;
esac
else
- local SCHEME="http"
- local SSL="$DOKKU_ROOT/$APP/tls"
- if [[ -e "$SSL/server.crt" && -e "$SSL/server.key" ]]; then
- local SCHEME="https"
+ if [[ -s "$DOKKU_ROOT/VHOST" ]]; then
+ while read -r VHOST || [[ -n "$VHOST" ]]; do
+ internal_get_app_url_with_vhost "$APP" "$VHOST"
+ done <"$DOKKU_ROOT/VHOST"
+ else
+ internal_get_app_url_with_vhost "$APP" "$(hostname -f)"
fi
+ fi
+}
- if [[ "$(plugn trigger proxy-is-enabled "$APP")" == "false" ]]; then
- if [[ -n "$RAW_TCP_PORTS" ]]; then
- local APP_CONTAINER_PORTS="$(get_container_ports "$APP")"
- local app_port
- for app_port in $APP_CONTAINER_PORTS; do
- echo "$(<"$DOKKU_ROOT/HOSTNAME"):$app_port (container)"
- done
- else
- local DOKKU_APP_WEB_LISTENERS PORT
- DOKKU_APP_WEB_LISTENERS="$(plugn trigger network-get-listeners "$APP" "web" | xargs)"
- for DOKKU_APP_WEB_LISTENER in $DOKKU_APP_WEB_LISTENERS; do
- PORT="$(echo "$DOKKU_APP_WEB_LISTENER" | cut -d ':' -f2)"
- echo "$SCHEME://$(<"$DOKKU_ROOT/HOSTNAME"):$PORT (container)"
- done
- shopt -u nullglob
- fi
- elif [[ -n "$DOKKU_PROXY_PORT_MAP" ]]; then
- local port_map
- for port_map in $DOKKU_PROXY_PORT_MAP; do
- local scheme="$(awk -F ':' '{ print $1 }' <<<"$port_map")"
- local listen_port="$(awk -F ':' '{ print $2 }' <<<"$port_map")"
- echo "$scheme://$(<"$DOKKU_ROOT/HOSTNAME"):$listen_port"
- done
- elif [[ -n "$RAW_TCP_PORTS" ]]; then
- for p in $RAW_TCP_PORTS; do
- echo "http://$(<"$DOKKU_ROOT/HOSTNAME"):$p"
+internal_get_app_url_with_vhost() {
+ declare APP="$1" VHOST="$2"
+
+ local RAW_TCP_PORTS="$(get_app_raw_tcp_ports "$APP")"
+ local DOKKU_PROXY_PORT_MAP=$(config_get "$APP" DOKKU_PROXY_PORT_MAP || true)
+ local SCHEME="http"
+ local SSL="$DOKKU_ROOT/$APP/tls"
+ if [[ -e "$SSL/server.crt" && -e "$SSL/server.key" ]]; then
+ local SCHEME="https"
+ fi
+
+ if [[ "$(plugn trigger proxy-is-enabled "$APP")" == "false" ]]; then
+ if [[ -n "$RAW_TCP_PORTS" ]]; then
+ local APP_CONTAINER_PORTS="$(get_container_ports "$APP")"
+ local app_port
+ for app_port in $APP_CONTAINER_PORTS; do
+ echo "$VHOST:$app_port (container)"
done
else
- echo "$SCHEME://$(<"$DOKKU_ROOT/HOSTNAME")"
+ local DOKKU_APP_WEB_LISTENERS PORT
+ DOKKU_APP_WEB_LISTENERS="$(plugn trigger network-get-listeners "$APP" "web" | xargs)"
+ for DOKKU_APP_WEB_LISTENER in $DOKKU_APP_WEB_LISTENERS; do
+ PORT="$(echo "$DOKKU_APP_WEB_LISTENER" | cut -d ':' -f2)"
+ echo "$SCHEME://$VHOST:$PORT (container)"
+ done
+ shopt -u nullglob
fi
+ elif [[ -n "$DOKKU_PROXY_PORT_MAP" ]]; then
+ local port_map
+ for port_map in $DOKKU_PROXY_PORT_MAP; do
+ local scheme="$(awk -F ':' '{ print $1 }' <<<"$port_map")"
+ local listen_port="$(awk -F ':' '{ print $2 }' <<<"$port_map")"
+ echo "$scheme://$VHOST:$listen_port"
+ done
+ elif [[ -n "$RAW_TCP_PORTS" ]]; then
+ for p in $RAW_TCP_PORTS; do
+ echo "http://$VHOST:$p"
+ done
+ else
+ echo "$SCHEME://$VHOST"
fi
}
diff --git a/plugins/domains/functions b/plugins/domains/functions
index 4c2874f08..e995c8cf3 100755
--- a/plugins/domains/functions
+++ b/plugins/domains/functions
@@ -206,14 +206,9 @@ get_app_domains() {
declare desc="return app domains"
local APP=$1
local APP_VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"
- local GLOBAL_HOSTNAME_PATH="$DOKKU_ROOT/HOSTNAME"
- if [[ "$(is_app_vhost_enabled "$APP")" == "true" ]]; then
- if [[ -f "$APP_VHOST_PATH" ]]; then
- cat "$APP_VHOST_PATH"
- elif [[ -f "$GLOBAL_HOSTNAME_PATH" ]]; then
- cat "$GLOBAL_HOSTNAME_PATH"
- fi
+ if [[ "$(is_app_vhost_enabled "$APP")" == "true" ]] && [[ -f "$APP_VHOST_PATH" ]]; then
+ cat "$APP_VHOST_PATH"
fi
}
diff --git a/plugins/nginx-vhosts/functions b/plugins/nginx-vhosts/functions
index c97805a24..646b70838 100755
--- a/plugins/nginx-vhosts/functions
+++ b/plugins/nginx-vhosts/functions
@@ -160,7 +160,7 @@ configure_nginx_ports() {
local DOKKU_PROXY_PORT_MAP=$(config_get "$APP" DOKKU_PROXY_PORT_MAP)
local IS_APP_VHOST_ENABLED=true
local UPSTREAM_PORT="5000"
- plugn trigger domains-vhost-enabled "$APP" || IS_APP_VHOST_ENABLED=false
+ plugn trigger domains-vhost-enabled "$APP" 2>/dev/null || IS_APP_VHOST_ENABLED=false
if [[ -z "$DOKKU_PROXY_PORT" ]] && [[ -z "$RAW_TCP_PORTS" ]]; then
if [[ "$IS_APP_VHOST_ENABLED" == "false" ]]; then
@@ -370,7 +370,7 @@ nginx_build_config() {
fi
local IS_APP_VHOST_ENABLED=true
- plugn trigger domains-vhost-enabled "$APP" || IS_APP_VHOST_ENABLED=false
+ plugn trigger domains-vhost-enabled "$APP" 2>/dev/null || IS_APP_VHOST_ENABLED=false
if [[ "$(plugn trigger proxy-is-enabled "$APP")" == "true" ]]; then
if [[ -z "$DOKKU_APP_LISTEN_PORT" ]] && [[ -z "$DOKKU_APP_LISTEN_IP" ]]; then
@@ -407,7 +407,7 @@ nginx_build_config() {
if [[ "$IS_APP_VHOST_ENABLED" == "true" ]]; then
local SSL_VHOSTS=$(grep -E "^${SSL_HOSTNAME_REGEX}$" "$VHOST_PATH" || true)
else
- local SSL_VHOSTS=$(<"$DOKKU_ROOT/HOSTNAME")
+ local SSL_VHOSTS=$(<"$DOKKU_ROOT/VHOST")
fi
local SSL_SERVER_NAME
local host
diff --git a/tests/ci/setup.sh b/tests/ci/setup.sh
index 716e3431a..d5bf11440 100755
--- a/tests/ci/setup.sh
+++ b/tests/ci/setup.sh
@@ -90,7 +90,6 @@ dokku dokku/key_file string /root/.ssh/id_rsa.pub
dokku dokku/nginx_enable boolean true
dokku dokku/skip_key_file boolean true
dokku dokku/vhost_enable boolean true
-dokku dokku/web_config boolean false
EOF
echo "-----> Start debconf selections"
diff --git a/tests/unit/domains.bats b/tests/unit/domains.bats
index f437a75e2..96743cfd7 100644
--- a/tests/unit/domains.bats
+++ b/tests/unit/domains.bats
@@ -5,14 +5,12 @@ load test_helper
setup() {
global_setup
[[ -f "$DOKKU_ROOT/VHOST" ]] && cp -fp "$DOKKU_ROOT/VHOST" "$DOKKU_ROOT/VHOST.bak"
- [[ -f "$DOKKU_ROOT/HOSTNAME" ]] && cp -fp "$DOKKU_ROOT/HOSTNAME" "$DOKKU_ROOT/HOSTNAME.bak"
create_app
}
teardown() {
destroy_app
[[ -f "$DOKKU_ROOT/VHOST.bak" ]] && mv "$DOKKU_ROOT/VHOST.bak" "$DOKKU_ROOT/VHOST" && chown dokku:dokku "$DOKKU_ROOT/VHOST"
- [[ -f "$DOKKU_ROOT/HOSTNAME.bak" ]] && mv "$DOKKU_ROOT/HOSTNAME.bak" "$DOKKU_ROOT/HOSTNAME" && chown dokku:dokku "$DOKKU_ROOT/HOSTNAME"
global_teardown
}
diff --git a/tests/unit/network.bats b/tests/unit/network.bats
index 596699448..db5ca41bf 100644
--- a/tests/unit/network.bats
+++ b/tests/unit/network.bats
@@ -5,14 +5,12 @@ load test_helper
setup() {
global_setup
[[ -f "$DOKKU_ROOT/VHOST" ]] && cp -fp "$DOKKU_ROOT/VHOST" "$DOKKU_ROOT/VHOST.bak"
- [[ -f "$DOKKU_ROOT/HOSTNAME" ]] && cp -fp "$DOKKU_ROOT/HOSTNAME" "$DOKKU_ROOT/HOSTNAME.bak"
create_app
}
teardown() {
destroy_app 0 $TEST_APP
[[ -f "$DOKKU_ROOT/VHOST.bak" ]] && mv "$DOKKU_ROOT/VHOST.bak" "$DOKKU_ROOT/VHOST" && chown dokku:dokku "$DOKKU_ROOT/VHOST"
- [[ -f "$DOKKU_ROOT/HOSTNAME.bak" ]] && mv "$DOKKU_ROOT/HOSTNAME.bak" "$DOKKU_ROOT/HOSTNAME" && chown dokku:dokku "$DOKKU_ROOT/HOSTNAME"
docker network rm create-network || true
docker network rm deploy-network || true
docker network rm initial-network || true
diff --git a/tests/unit/nginx-vhosts_1.bats b/tests/unit/nginx-vhosts_1.bats
index 2995e478c..3e1fb17f2 100644
--- a/tests/unit/nginx-vhosts_1.bats
+++ b/tests/unit/nginx-vhosts_1.bats
@@ -6,14 +6,11 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/config/functions"
setup() {
global_setup
[[ -f "$DOKKU_ROOT/VHOST" ]] && cp -fp "$DOKKU_ROOT/VHOST" "$DOKKU_ROOT/VHOST.bak"
- [[ -f "$DOKKU_ROOT/HOSTNAME" ]] && cp -fp "$DOKKU_ROOT/HOSTNAME" "$DOKKU_ROOT/HOSTNAME.bak"
}
teardown() {
- detach_delete_network
destroy_app
[[ -f "$DOKKU_ROOT/VHOST.bak" ]] && mv "$DOKKU_ROOT/VHOST.bak" "$DOKKU_ROOT/VHOST" && chown dokku:dokku "$DOKKU_ROOT/VHOST"
- [[ -f "$DOKKU_ROOT/HOSTNAME.bak" ]] && mv "$DOKKU_ROOT/HOSTNAME.bak" "$DOKKU_ROOT/HOSTNAME" && chown dokku:dokku "$DOKKU_ROOT/HOSTNAME"
global_teardown
}
@@ -35,7 +32,7 @@ teardown() {
deploy_app
dokku domains:disable $TEST_APP
- HOSTNAME=$(< "$DOKKU_ROOT/HOSTNAME")
+ HOSTNAME=$(< "$DOKKU_ROOT/VHOST")
check_urls http://${HOSTNAME}:[0-9]+
URLS=$(dokku --quiet urls "$TEST_APP")
diff --git a/tests/unit/nginx-vhosts_10.bats b/tests/unit/nginx-vhosts_10.bats
index ede218143..7377d6e32 100644
--- a/tests/unit/nginx-vhosts_10.bats
+++ b/tests/unit/nginx-vhosts_10.bats
@@ -5,14 +5,12 @@ load test_helper
setup() {
global_setup
[[ -f "$DOKKU_ROOT/VHOST" ]] && cp -fp "$DOKKU_ROOT/VHOST" "$DOKKU_ROOT/VHOST.bak"
- [[ -f "$DOKKU_ROOT/HOSTNAME" ]] && cp -fp "$DOKKU_ROOT/HOSTNAME" "$DOKKU_ROOT/HOSTNAME.bak"
create_app
}
teardown() {
destroy_app 0 $TEST_APP
[[ -f "$DOKKU_ROOT/VHOST.bak" ]] && mv "$DOKKU_ROOT/VHOST.bak" "$DOKKU_ROOT/VHOST" && chown dokku:dokku "$DOKKU_ROOT/VHOST"
- [[ -f "$DOKKU_ROOT/HOSTNAME.bak" ]] && mv "$DOKKU_ROOT/HOSTNAME.bak" "$DOKKU_ROOT/HOSTNAME" && chown dokku:dokku "$DOKKU_ROOT/HOSTNAME"
global_teardown
}
diff --git a/tests/unit/nginx-vhosts_11.bats b/tests/unit/nginx-vhosts_11.bats
index f7d1a1a2b..dfba17844 100644
--- a/tests/unit/nginx-vhosts_11.bats
+++ b/tests/unit/nginx-vhosts_11.bats
@@ -5,14 +5,12 @@ load test_helper
setup() {
global_setup
[[ -f "$DOKKU_ROOT/VHOST" ]] && cp -fp "$DOKKU_ROOT/VHOST" "$DOKKU_ROOT/VHOST.bak"
- [[ -f "$DOKKU_ROOT/HOSTNAME" ]] && cp -fp "$DOKKU_ROOT/HOSTNAME" "$DOKKU_ROOT/HOSTNAME.bak"
create_app
}
teardown() {
destroy_app 0 $TEST_APP
[[ -f "$DOKKU_ROOT/VHOST.bak" ]] && mv "$DOKKU_ROOT/VHOST.bak" "$DOKKU_ROOT/VHOST" && chown dokku:dokku "$DOKKU_ROOT/VHOST"
- [[ -f "$DOKKU_ROOT/HOSTNAME.bak" ]] && mv "$DOKKU_ROOT/HOSTNAME.bak" "$DOKKU_ROOT/HOSTNAME" && chown dokku:dokku "$DOKKU_ROOT/HOSTNAME"
global_teardown
}
diff --git a/tests/unit/nginx-vhosts_2.bats b/tests/unit/nginx-vhosts_2.bats
index 7769a058d..f8f26ea5c 100644
--- a/tests/unit/nginx-vhosts_2.bats
+++ b/tests/unit/nginx-vhosts_2.bats
@@ -5,14 +5,12 @@ load test_helper
setup() {
global_setup
[[ -f "$DOKKU_ROOT/VHOST" ]] && cp -fp "$DOKKU_ROOT/VHOST" "$DOKKU_ROOT/VHOST.bak"
- [[ -f "$DOKKU_ROOT/HOSTNAME" ]] && cp -fp "$DOKKU_ROOT/HOSTNAME" "$DOKKU_ROOT/HOSTNAME.bak"
create_app
}
teardown() {
destroy_app 0 $TEST_APP
[[ -f "$DOKKU_ROOT/VHOST.bak" ]] && mv "$DOKKU_ROOT/VHOST.bak" "$DOKKU_ROOT/VHOST" && chown dokku:dokku "$DOKKU_ROOT/VHOST"
- [[ -f "$DOKKU_ROOT/HOSTNAME.bak" ]] && mv "$DOKKU_ROOT/HOSTNAME.bak" "$DOKKU_ROOT/HOSTNAME" && chown dokku:dokku "$DOKKU_ROOT/HOSTNAME"
global_teardown
}
diff --git a/tests/unit/nginx-vhosts_3.bats b/tests/unit/nginx-vhosts_3.bats
index 65e184986..babc690c5 100644
--- a/tests/unit/nginx-vhosts_3.bats
+++ b/tests/unit/nginx-vhosts_3.bats
@@ -6,7 +6,6 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/config/functions"
setup() {
global_setup
[[ -f "$DOKKU_ROOT/VHOST" ]] && cp -fp "$DOKKU_ROOT/VHOST" "$DOKKU_ROOT/VHOST.bak"
- [[ -f "$DOKKU_ROOT/HOSTNAME" ]] && cp -fp "$DOKKU_ROOT/HOSTNAME" "$DOKKU_ROOT/HOSTNAME.bak"
create_app
docker build "${BATS_TEST_DIRNAME}/../../tests/apps/gogrpc" -t ${TEST_APP}-docker-image
}
@@ -14,7 +13,6 @@ setup() {
teardown() {
destroy_app 0 $TEST_APP
[[ -f "$DOKKU_ROOT/VHOST.bak" ]] && mv "$DOKKU_ROOT/VHOST.bak" "$DOKKU_ROOT/VHOST" && chown dokku:dokku "$DOKKU_ROOT/VHOST"
- [[ -f "$DOKKU_ROOT/HOSTNAME.bak" ]] && mv "$DOKKU_ROOT/HOSTNAME.bak" "$DOKKU_ROOT/HOSTNAME" && chown dokku:dokku "$DOKKU_ROOT/HOSTNAME"
global_teardown
}
diff --git a/tests/unit/nginx-vhosts_4.bats b/tests/unit/nginx-vhosts_4.bats
index 97f576b87..f46d7b68f 100644
--- a/tests/unit/nginx-vhosts_4.bats
+++ b/tests/unit/nginx-vhosts_4.bats
@@ -6,23 +6,24 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/config/functions"
setup() {
global_setup
[[ -f "$DOKKU_ROOT/VHOST" ]] && cp -fp "$DOKKU_ROOT/VHOST" "$DOKKU_ROOT/VHOST.bak"
- [[ -f "$DOKKU_ROOT/HOSTNAME" ]] && cp -fp "$DOKKU_ROOT/HOSTNAME" "$DOKKU_ROOT/HOSTNAME.bak"
}
teardown() {
- detach_delete_network
destroy_app
[[ -f "$DOKKU_ROOT/VHOST.bak" ]] && mv "$DOKKU_ROOT/VHOST.bak" "$DOKKU_ROOT/VHOST" && chown dokku:dokku "$DOKKU_ROOT/VHOST"
- [[ -f "$DOKKU_ROOT/HOSTNAME.bak" ]] && mv "$DOKKU_ROOT/HOSTNAME.bak" "$DOKKU_ROOT/HOSTNAME" && chown dokku:dokku "$DOKKU_ROOT/HOSTNAME"
global_teardown
}
-@test "(nginx-vhosts) nginx:build-config (without global VHOST but real HOSTNAME)" {
+@test "(nginx-vhosts) nginx:build-config (without global VHOST)" {
rm "$DOKKU_ROOT/VHOST"
- echo "${TEST_APP}.dokku.me" > "$DOKKU_ROOT/HOSTNAME"
deploy_app
- HOSTNAME=$(< "$DOKKU_ROOT/HOSTNAME")
+ run /bin/bash -c "dokku --quiet urls $TEST_APP"
+ echo "output: $output"
+ echo "status: $status"
+ assert_success
+
+ HOSTNAME="$(hostname -f)"
check_urls http://${HOSTNAME}:[0-9]+
URLS=$(dokku --quiet urls "$TEST_APP")
@@ -33,10 +34,10 @@ teardown() {
@test "(nginx-vhosts) nginx:build-config (without global VHOST and IPv4 address set as HOSTNAME)" {
rm "$DOKKU_ROOT/VHOST"
- echo "127.0.0.1" > "$DOKKU_ROOT/HOSTNAME"
+ echo "127.0.0.1" > "$DOKKU_ROOT/VHOST"
deploy_app
- HOSTNAME=$(< "$DOKKU_ROOT/HOSTNAME")
+ HOSTNAME=$(< "$DOKKU_ROOT/VHOST")
check_urls http://${HOSTNAME}:[0-9]+
URLS=$(dokku --quiet urls "$TEST_APP")
@@ -47,10 +48,10 @@ teardown() {
@test "(nginx-vhosts) nginx:build-config (without global VHOST and IPv6 address set as HOSTNAME)" {
rm "$DOKKU_ROOT/VHOST"
- echo "fda5:c7db:a520:bb6d::aabb:ccdd:eeff" > "$DOKKU_ROOT/HOSTNAME"
+ echo "fda5:c7db:a520:bb6d::aabb:ccdd:eeff" > "$DOKKU_ROOT/VHOST"
deploy_app
- HOSTNAME=$(< "$DOKKU_ROOT/HOSTNAME")
+ HOSTNAME=$(< "$DOKKU_ROOT/VHOST")
check_urls http://${HOSTNAME}:[0-9]+
}
diff --git a/tests/unit/nginx-vhosts_5.bats b/tests/unit/nginx-vhosts_5.bats
index 3724d5801..a6c38ed00 100644
--- a/tests/unit/nginx-vhosts_5.bats
+++ b/tests/unit/nginx-vhosts_5.bats
@@ -6,14 +6,12 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/config/functions"
setup() {
global_setup
[[ -f "$DOKKU_ROOT/VHOST" ]] && cp -fp "$DOKKU_ROOT/VHOST" "$DOKKU_ROOT/VHOST.bak"
- [[ -f "$DOKKU_ROOT/HOSTNAME" ]] && cp -fp "$DOKKU_ROOT/HOSTNAME" "$DOKKU_ROOT/HOSTNAME.bak"
}
teardown() {
detach_delete_network
destroy_app
[[ -f "$DOKKU_ROOT/VHOST.bak" ]] && mv "$DOKKU_ROOT/VHOST.bak" "$DOKKU_ROOT/VHOST" && chown dokku:dokku "$DOKKU_ROOT/VHOST"
- [[ -f "$DOKKU_ROOT/HOSTNAME.bak" ]] && mv "$DOKKU_ROOT/HOSTNAME.bak" "$DOKKU_ROOT/HOSTNAME" && chown dokku:dokku "$DOKKU_ROOT/HOSTNAME"
global_teardown
}
diff --git a/tests/unit/nginx-vhosts_6.bats b/tests/unit/nginx-vhosts_6.bats
index 1ba3aecd1..38ad54a0b 100644
--- a/tests/unit/nginx-vhosts_6.bats
+++ b/tests/unit/nginx-vhosts_6.bats
@@ -5,14 +5,12 @@ load test_helper
setup() {
global_setup
[[ -f "$DOKKU_ROOT/VHOST" ]] && cp -fp "$DOKKU_ROOT/VHOST" "$DOKKU_ROOT/VHOST.bak"
- [[ -f "$DOKKU_ROOT/HOSTNAME" ]] && cp -fp "$DOKKU_ROOT/HOSTNAME" "$DOKKU_ROOT/HOSTNAME.bak"
create_app
}
teardown() {
destroy_app 0 $TEST_APP
[[ -f "$DOKKU_ROOT/VHOST.bak" ]] && mv "$DOKKU_ROOT/VHOST.bak" "$DOKKU_ROOT/VHOST" && chown dokku:dokku "$DOKKU_ROOT/VHOST"
- [[ -f "$DOKKU_ROOT/HOSTNAME.bak" ]] && mv "$DOKKU_ROOT/HOSTNAME.bak" "$DOKKU_ROOT/HOSTNAME" && chown dokku:dokku "$DOKKU_ROOT/HOSTNAME"
global_teardown
}
diff --git a/tests/unit/nginx-vhosts_7.bats b/tests/unit/nginx-vhosts_7.bats
index d1eefcda9..52417e403 100644
--- a/tests/unit/nginx-vhosts_7.bats
+++ b/tests/unit/nginx-vhosts_7.bats
@@ -5,14 +5,12 @@ load test_helper
setup() {
global_setup
[[ -f "$DOKKU_ROOT/VHOST" ]] && cp -fp "$DOKKU_ROOT/VHOST" "$DOKKU_ROOT/VHOST.bak"
- [[ -f "$DOKKU_ROOT/HOSTNAME" ]] && cp -fp "$DOKKU_ROOT/HOSTNAME" "$DOKKU_ROOT/HOSTNAME.bak"
create_app
}
teardown() {
destroy_app 0 $TEST_APP
[[ -f "$DOKKU_ROOT/VHOST.bak" ]] && mv "$DOKKU_ROOT/VHOST.bak" "$DOKKU_ROOT/VHOST" && chown dokku:dokku "$DOKKU_ROOT/VHOST"
- [[ -f "$DOKKU_ROOT/HOSTNAME.bak" ]] && mv "$DOKKU_ROOT/HOSTNAME.bak" "$DOKKU_ROOT/HOSTNAME" && chown dokku:dokku "$DOKKU_ROOT/HOSTNAME"
global_teardown
}
diff --git a/tests/unit/nginx-vhosts_8.bats b/tests/unit/nginx-vhosts_8.bats
index 2bdca9259..00f202748 100644
--- a/tests/unit/nginx-vhosts_8.bats
+++ b/tests/unit/nginx-vhosts_8.bats
@@ -5,14 +5,12 @@ load test_helper
setup() {
global_setup
[[ -f "$DOKKU_ROOT/VHOST" ]] && cp -fp "$DOKKU_ROOT/VHOST" "$DOKKU_ROOT/VHOST.bak"
- [[ -f "$DOKKU_ROOT/HOSTNAME" ]] && cp -fp "$DOKKU_ROOT/HOSTNAME" "$DOKKU_ROOT/HOSTNAME.bak"
create_app
}
teardown() {
destroy_app 0 $TEST_APP
[[ -f "$DOKKU_ROOT/VHOST.bak" ]] && mv "$DOKKU_ROOT/VHOST.bak" "$DOKKU_ROOT/VHOST" && chown dokku:dokku "$DOKKU_ROOT/VHOST"
- [[ -f "$DOKKU_ROOT/HOSTNAME.bak" ]] && mv "$DOKKU_ROOT/HOSTNAME.bak" "$DOKKU_ROOT/HOSTNAME" && chown dokku:dokku "$DOKKU_ROOT/HOSTNAME"
global_teardown
}
diff --git a/tests/unit/nginx-vhosts_9.bats b/tests/unit/nginx-vhosts_9.bats
index 7a44e6ea2..552ba2785 100644
--- a/tests/unit/nginx-vhosts_9.bats
+++ b/tests/unit/nginx-vhosts_9.bats
@@ -5,14 +5,12 @@ load test_helper
setup() {
global_setup
[[ -f "$DOKKU_ROOT/VHOST" ]] && cp -fp "$DOKKU_ROOT/VHOST" "$DOKKU_ROOT/VHOST.bak"
- [[ -f "$DOKKU_ROOT/HOSTNAME" ]] && cp -fp "$DOKKU_ROOT/HOSTNAME" "$DOKKU_ROOT/HOSTNAME.bak"
create_app
}
teardown() {
destroy_app 0 $TEST_APP
[[ -f "$DOKKU_ROOT/VHOST.bak" ]] && mv "$DOKKU_ROOT/VHOST.bak" "$DOKKU_ROOT/VHOST" && chown dokku:dokku "$DOKKU_ROOT/VHOST"
- [[ -f "$DOKKU_ROOT/HOSTNAME.bak" ]] && mv "$DOKKU_ROOT/HOSTNAME.bak" "$DOKKU_ROOT/HOSTNAME" && chown dokku:dokku "$DOKKU_ROOT/HOSTNAME"
global_teardown
}
diff --git a/tests/unit/proxy.bats b/tests/unit/proxy.bats
index 43b9b7e8f..6b2188961 100644
--- a/tests/unit/proxy.bats
+++ b/tests/unit/proxy.bats
@@ -5,14 +5,12 @@ load test_helper
setup() {
global_setup
[[ -f "$DOKKU_ROOT/VHOST" ]] && cp -fp "$DOKKU_ROOT/VHOST" "$DOKKU_ROOT/VHOST.bak"
- [[ -f "$DOKKU_ROOT/HOSTNAME" ]] && cp -fp "$DOKKU_ROOT/HOSTNAME" "$DOKKU_ROOT/HOSTNAME.bak"
create_app
}
teardown() {
destroy_app 0 $TEST_APP
[[ -f "$DOKKU_ROOT/VHOST.bak" ]] && mv "$DOKKU_ROOT/VHOST.bak" "$DOKKU_ROOT/VHOST" && chown dokku:dokku "$DOKKU_ROOT/VHOST"
- [[ -f "$DOKKU_ROOT/HOSTNAME.bak" ]] && mv "$DOKKU_ROOT/HOSTNAME.bak" "$DOKKU_ROOT/HOSTNAME" && chown dokku:dokku "$DOKKU_ROOT/HOSTNAME"
global_teardown
}
diff --git a/tests/unit/test_helper.bash b/tests/unit/test_helper.bash
index d6d37ed6d..69ac92f55 100644
--- a/tests/unit/test_helper.bash
+++ b/tests/unit/test_helper.bash
@@ -228,7 +228,7 @@ add_domain() {
# shellcheck disable=SC2119
check_urls() {
local PATTERN="$1"
- run /bin/bash -c "dokku --quiet urls $TEST_APP | grep -E \"${PATTERN}\""
+ run /bin/bash -c "dokku urls $TEST_APP | grep -E \"${PATTERN}\""
echo "output: $output"
echo "status: $status"
assert_success