diff --git a/.circleci/config.yml b/.circleci/config.yml index 5b7b008e2..41cca7a53 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,10 +20,12 @@ jobs: - run: | case $CIRCLE_NODE_INDEX in 0) sudo -E make -e lint ;; - 1) sudo -E make -e go-tests ;; + 1) sudo -E make -e go-tests ci-go-coverage;; 2) sudo -E make -e deploy-test-checks-root deploy-test-config deploy-test-multi deploy-test-go-fail-predeploy deploy-test-go-fail-postdeploy ;; esac - run: shell: /bin/bash command: sudo -E make -e test-ci no_output_timeout: 60m + - store_artifacts: + path: ./coverage.out diff --git a/.codacy.yml b/.codacy.yml new file mode 100644 index 000000000..8f6841491 --- /dev/null +++ b/.codacy.yml @@ -0,0 +1,5 @@ +exclude_paths: +- vendor/**/* +- tests/**/* +- "**_test.go" +- contrib/* diff --git a/.editorconfig b/.editorconfig index 0643f4310..2c518168b 100644 --- a/.editorconfig +++ b/.editorconfig @@ -17,5 +17,5 @@ indent_size = 4 [*.go] insert_final_newline = true -indent_style = space +indent_style = tab indent_size = 4 diff --git a/.gitignore b/.gitignore index 2794757ee..3027ddb0d 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ data/ stack.tgz tmp +coverage.out diff --git a/HISTORY.md b/HISTORY.md index 9c8b19bca..4d795e9e9 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,20 @@ # History +## 0.10.5 + +### Bug Fixes + +- #2912: @josegonzalez Add missing depends statement for rsyslog +- #2906: @manuel-colmenero Check the location of nginx in a central way +- #2895: @josegonzalez cd to app directory when calling git worktree add + +### Documentation + +- #2922: @axilleas Clarify the minimum Nginx version for HTTP/2 support +- #2919: @wootwoot1234 Update nginx documentation surrounding file uploading for php buildpack users +- #2913: @znz Fix a typo in the rpm release script +- #2910: @buckle2000 Add a note about using the full git url for non-compliant toolchains + ## 0.10.4 ### Bug Fixes diff --git a/README.md b/README.md index 0f0917dc0..95e2cd15a 100644 --- a/README.md +++ b/README.md @@ -99,8 +99,8 @@ A fresh VM running any of the following operating systems: To install the latest stable release, run the following commands as a user who has access to `sudo`: ```shell -wget https://raw.githubusercontent.com/dokku/dokku/v0.10.4/bootstrap.sh -sudo DOKKU_TAG=v0.10.4 bash bootstrap.sh +wget https://raw.githubusercontent.com/dokku/dokku/v0.10.5/bootstrap.sh +sudo DOKKU_TAG=v0.10.5 bash bootstrap.sh ``` You can then proceed to the ip address or domain name associated with your server to complete the web-based installation. diff --git a/contrib/dokku-installer.py b/contrib/dokku-installer.py index 2c6be2318..38fcabfa2 100755 --- a/contrib/dokku-installer.py +++ b/contrib/dokku-installer.py @@ -10,7 +10,7 @@ import subprocess import sys import threading -VERSION = 'v0.10.4' +VERSION = 'v0.10.5' hostname = '' try: diff --git a/debian/control b/debian/control index b2df67793..7ed5a88f3 100644 --- a/debian/control +++ b/debian/control @@ -1,5 +1,5 @@ Package: dokku -Version: 0.10.4 +Version: 0.10.5 Section: web Priority: optional Architecture: amd64 diff --git a/docs/advanced-usage/plugin-management.md b/docs/advanced-usage/plugin-management.md index ecf7a4bc9..618ed0302 100644 --- a/docs/advanced-usage/plugin-management.md +++ b/docs/advanced-usage/plugin-management.md @@ -31,30 +31,30 @@ dokku plugin ``` plugn: dev - 00_dokku-standard 0.10.4 enabled dokku core standard plugin - 20_events 0.10.4 enabled dokku core events logging plugin - apps 0.10.4 enabled dokku core apps plugin - build-env 0.10.4 enabled dokku core build-env plugin - certs 0.10.4 enabled dokku core certificate management plugin - checks 0.10.4 enabled dokku core checks plugin - common 0.10.4 enabled dokku core common plugin - config 0.10.4 enabled dokku core config plugin - docker-options 0.10.4 enabled dokku core docker-options plugin - domains 0.10.4 enabled dokku core domains plugin - enter 0.10.4 enabled dokku core enter plugin - git 0.10.4 enabled dokku core git plugin - logs 0.10.4 enabled dokku core logs plugin - named-containers 0.10.4 enabled dokku core named containers plugin - nginx-vhosts 0.10.4 enabled dokku core nginx-vhosts plugin - plugin 0.10.4 enabled dokku core plugin plugin - proxy 0.10.4 enabled dokku core proxy plugin - ps 0.10.4 enabled dokku core ps plugin - repo 0.10.4 enabled dokku core repo plugin - shell 0.10.4 enabled dokku core shell plugin - ssh-keys 0.10.4 enabled dokku core ssh-keys plugin - storage 0.10.4 enabled dokku core storage plugin - tags 0.10.4 enabled dokku core tags plugin - tar 0.10.4 enabled dokku core tar plugin + 00_dokku-standard 0.10.5 enabled dokku core standard plugin + 20_events 0.10.5 enabled dokku core events logging plugin + apps 0.10.5 enabled dokku core apps plugin + build-env 0.10.5 enabled dokku core build-env plugin + certs 0.10.5 enabled dokku core certificate management plugin + checks 0.10.5 enabled dokku core checks plugin + common 0.10.5 enabled dokku core common plugin + config 0.10.5 enabled dokku core config plugin + docker-options 0.10.5 enabled dokku core docker-options plugin + domains 0.10.5 enabled dokku core domains plugin + enter 0.10.5 enabled dokku core enter plugin + git 0.10.5 enabled dokku core git plugin + logs 0.10.5 enabled dokku core logs plugin + named-containers 0.10.5 enabled dokku core named containers plugin + nginx-vhosts 0.10.5 enabled dokku core nginx-vhosts plugin + plugin 0.10.5 enabled dokku core plugin plugin + proxy 0.10.5 enabled dokku core proxy plugin + ps 0.10.5 enabled dokku core ps plugin + repo 0.10.5 enabled dokku core repo plugin + shell 0.10.5 enabled dokku core shell plugin + ssh-keys 0.10.5 enabled dokku core ssh-keys plugin + storage 0.10.5 enabled dokku core storage plugin + tags 0.10.5 enabled dokku core tags plugin + tar 0.10.5 enabled dokku core tar plugin ``` Installing a plugin is easy as well using the `plugin:install` command. This command will also trigger the `install` pluginhook on all existing plugins. diff --git a/docs/assets/favicons/browserconfig.xml b/docs/assets/favicons/browserconfig.xml index cae873690..941a0d0a5 100644 --- a/docs/assets/favicons/browserconfig.xml +++ b/docs/assets/favicons/browserconfig.xml @@ -2,10 +2,10 @@ - - - - + + + + #da532c diff --git a/docs/assets/favicons/manifest.json b/docs/assets/favicons/manifest.json index 36db45984..83c626e10 100644 --- a/docs/assets/favicons/manifest.json +++ b/docs/assets/favicons/manifest.json @@ -2,37 +2,37 @@ "name": "Dokku", "icons": [ { - "src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.10.4\/docs\/assets\/favicons\/android-chrome-36x36.png", + "src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.10.5\/docs\/assets\/favicons\/android-chrome-36x36.png", "sizes": "36x36", "type": "image\/png", "density": "0.75" }, { - "src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.10.4\/docs\/assets\/favicons\/android-chrome-48x48.png", + "src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.10.5\/docs\/assets\/favicons\/android-chrome-48x48.png", "sizes": "48x48", "type": "image\/png", "density": "1.0" }, { - "src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.10.4\/docs\/assets\/favicons\/android-chrome-72x72.png", + "src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.10.5\/docs\/assets\/favicons\/android-chrome-72x72.png", "sizes": "72x72", "type": "image\/png", "density": "1.5" }, { - "src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.10.4\/docs\/assets\/favicons\/android-chrome-96x96.png", + "src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.10.5\/docs\/assets\/favicons\/android-chrome-96x96.png", "sizes": "96x96", "type": "image\/png", "density": "2.0" }, { - "src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.10.4\/docs\/assets\/favicons\/android-chrome-144x144.png", + "src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.10.5\/docs\/assets\/favicons\/android-chrome-144x144.png", "sizes": "144x144", "type": "image\/png", "density": "3.0" }, { - "src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.10.4\/docs\/assets\/favicons\/android-chrome-192x192.png", + "src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.10.5\/docs\/assets\/favicons\/android-chrome-192x192.png", "sizes": "192x192", "type": "image\/png", "density": "4.0" diff --git a/docs/assets/style.css b/docs/assets/style.css index 64c50df12..dab6efbe9 100644 --- a/docs/assets/style.css +++ b/docs/assets/style.css @@ -35,13 +35,13 @@ h1 { background-repeat: no-repeat; } .header .navbar-brand a { - background-image: url(https://cdn.rawgit.com/dokku/dokku/v0.10.4/docs/assets/dokku.png); + background-image: url(https://cdn.rawgit.com/dokku/dokku/v0.10.5/docs/assets/dokku.png); text-indent: 40px; } .blurb { color: #424242; background-color: #ededed; - background-image: url(https://cdn.rawgit.com/dokku/dokku/v0.10.4/docs/assets/gplaypattern.png); + background-image: url(https://cdn.rawgit.com/dokku/dokku/v0.10.5/docs/assets/gplaypattern.png); padding: 45px 0; text-align: center; } diff --git a/docs/assets/versions.json b/docs/assets/versions.json index 31ae0dea3..076eb6d9c 100644 --- a/docs/assets/versions.json +++ b/docs/assets/versions.json @@ -7,6 +7,6 @@ "0.7.2", "0.8.2", "0.9.4", - "0.10.4" + "0.10.5" ] } diff --git a/docs/configuration/ssl.md b/docs/configuration/ssl.md index de04c3348..5d2651218 100644 --- a/docs/configuration/ssl.md +++ b/docs/configuration/ssl.md @@ -117,6 +117,10 @@ The [HSTS header](https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security) Beware that if you enable the header and a subsequent deploy of your application results in an HTTP deploy (for whatever reason), the way the header works means that a browser will not attempt to request the HTTP version of your site if the HTTPS version fails. +## HTTP/2 support + +Certain versions of nginx have bugs that prevent [HTTP/2](https://nginx.org/en/docs/http/ngx_http_v2_module.html) from properly responding to all clients, thus causing applications to be unavailable. For HTTP/2 to be enabled in your applications' nginx configs, you need to have installed nginx 1.11.5 or higher. See [issue 2435](https://github.com/dokku/dokku/issues/2435) for more details. + ## Running behind a load balancer Your application has access to the HTTP headers `X-Forwarded-Proto`, `X-Forwarded-Port` and `X-Forwarded-For`. These headers indicate the protocol of the original request (HTTP or HTTPS), the port number, and the IP address of the client making the request, respectively. The default configuration is for Nginx to set these headers. @@ -162,4 +166,4 @@ This could result in security issue, for example, if your application looks at t ### SSL Port Exposure -When your app is served from port `80` then the `/home/dokku/APP/nginx.conf` file will automatically be updated to instruct nginx to respond to ssl on port 443 as a new cert is added. If your app uses a non-standard port (perhaps you have a dockerfile deploy exposing port `99999`) you may need to manually expose an ssl port via `dokku proxy:ports-add https:443:99999`. +When your app is served from port `80` then the `/home/dokku/APP/nginx.conf` file will automatically be updated to instruct nginx to respond to ssl on port 443 as a new cert is added. If your app uses a non-standard port (perhaps you have a dockerfile deploy exposing port `99999`) you may need to manually expose an ssl port via `dokku proxy:ports-add https:443:99999`. diff --git a/docs/deployment/application-deployment.md b/docs/deployment/application-deployment.md index bcad98b44..f9f33293f 100644 --- a/docs/deployment/application-deployment.md +++ b/docs/deployment/application-deployment.md @@ -60,7 +60,7 @@ git push dokku master ``` > Note: Some tools may not support the short-upstream syntax referenced above, and you may need to prefix -> the upstream with the scheme `ssh://` like so: `ssh://dokku@dokku.me/ruby-rails-sample` +> the upstream with the scheme `ssh://` like so: `ssh://dokku@dokku.me:ruby-rails-sample` > Please see the [Git](https://git-scm.com/docs/git-clone#_git_urls_a_id_urls_a) documentation for more details. ``` diff --git a/docs/development/plugin-triggers.md b/docs/development/plugin-triggers.md index 4222a9fb7..4179f1c85 100644 --- a/docs/development/plugin-triggers.md +++ b/docs/development/plugin-triggers.md @@ -344,6 +344,141 @@ if [[ ! -f "$DOKKU_ROOT/HOSTNAME" ]]; then fi ``` +### `network-build-config` + +- Description: Rebuilds network configuration +- Invoked by: `internally triggered by proxy-build-config within proxy implementations` +- Arguments: `$APP` +- Example: + +```shell +#!/usr/bin/env bash + +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x + +# TODO +``` + +### `network-compute-ports` + +- Description: Computes the ports for a given app container +- Invoked by: `internally triggered by proxy-build-config within proxy implementations` +- Arguments: `$APP` +- Example: + +```shell +#!/usr/bin/env bash + +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x + +# TODO +``` + +### `network-config-exists` + +- Description: Returns whether the network configuration for a given app exists +- Invoked by: `internally triggered by core-post-deploy within proxy implementations` +- Arguments: `$APP` +- Example: + +```shell +#!/usr/bin/env bash + +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x + +# TODO +``` + +### `network-get-ipaddr` + +- Description: Return the ipaddr for a given app container +- Invoked by: `internally triggered by a deploy` +- Arguments: `$APP $PROC_TYPE $CONTAINER_ID` +- Example: + +```shell +#!/usr/bin/env bash + +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x + +# TODO +``` + +### `network-get-listeners` + +- Description: Return the listeners (host:port combinations) for a given app container +- Invoked by: `internally triggered by a deploy` +- Arguments: `$APP` +- Example: + +```shell +#!/usr/bin/env bash + +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x + +# TODO +``` + +### `network-get-property` + +- Description: Return the network value for an application's property +- Invoked by: `internally triggered by a deploy` +- Arguments: `$APP $KEY` +- Example: + +```shell +#!/usr/bin/env bash + +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x + +# TODO +``` + +### `network-get-port` + +- Description: Return the port for a given app container +- Invoked by: `internally triggered by a deploy` +- Arguments: `$APP $PROC_TYPE $CONTAINER_ID $IS_HEROKUISH_CONTAINER` +- Example: + +```shell +#!/usr/bin/env bash + +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x + +# TODO +``` + +### `network-write-ipaddr` + +- Description: Write the ipaddr for a given app index +- Invoked by: `internally triggered by a deploy` +- Arguments: `$APP $PROC_TYPE $CONTAINER_INDEX $IP_ADDRESS` +- Example: + +```shell +#!/usr/bin/env bash + +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x + +# TODO +``` + +### `network-write-port` + +- Description: Write the port for a given app index +- Invoked by: `internally triggered by a deploy` +- Arguments: `$APP $PROC_TYPE $CONTAINER_INDEX $PORT` +- Example: + +```shell +#!/usr/bin/env bash + +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x + +# TODO +``` + ### `nginx-hostname` - Description: Allows you to customize the hostname for a given application. @@ -410,6 +545,40 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x # TODO ``` +### `post-certs-remove` + +- Description: Allows you to run commands after a cert is removed +- Invoked by: `dokku certs:remove` +- Arguments: `$APP` +- Example: + +```shell +#!/usr/bin/env bash + +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x +source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" +APP="$1"; verify_app_name "$APP" + +# TODO +``` + +### `post-certs-update` + +- Description: Allows you to run commands after a cert is added/updated +- Invoked by: `dokku certs:add`, `dokku certs:update` +- Arguments: `$APP` +- Example: + +```shell +#!/usr/bin/env bash + +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x +source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" +APP="$1"; verify_app_name "$APP" + +# TODO +``` + ### `post-create` - Description: Can be used to run commands after an application is created. @@ -763,10 +932,10 @@ APP="$1"; verify_app_name "$APP" # TODO ``` -### `post-certs-update` +### `proxy-build-config` -- Description: Allows you to run commands after a cert is added/updated -- Invoked by: `dokku certs:add`, `dokku certs:update` +- Description: Builds the proxy implementation configuration for a given app +- Invoked by: `internally triggered by ps:restore` - Arguments: `$APP` - Example: @@ -774,16 +943,29 @@ APP="$1"; verify_app_name "$APP" #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" -APP="$1"; verify_app_name "$APP" # TODO ``` -### `post-certs-remove` +### `proxy-enable` -- Description: Allows you to run commands after a cert is removed -- Invoked by: `dokku certs:remove` +- Description: Enables the configured proxy implementation for an app +- Invoked by: `internally triggered by ps:restore` +- Arguments: `$APP` +- Example: + +```shell +#!/usr/bin/env bash + +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x + +# TODO +``` + +### `proxy-disable` + +- Description: Disables the configured proxy implementation for an app +- Invoked by: `internally triggered by ps:restore` - Arguments: `$APP` - Example: @@ -791,8 +973,6 @@ APP="$1"; verify_app_name "$APP" #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" -APP="$1"; verify_app_name "$APP" # TODO ``` diff --git a/docs/development/release-process.md b/docs/development/release-process.md index 5eef03826..f4be7f759 100644 --- a/docs/development/release-process.md +++ b/docs/development/release-process.md @@ -67,7 +67,7 @@ The workflow looks like this: ```shell # having dokku-arch in ../dokku-arch vagrant up build-arch -# wait for "==> build-arch: ==> Finished making: dokku 0.10.4-2 (Mon Feb 22 23:20:37 CET 2016)" +# wait for "==> build-arch: ==> Finished making: dokku 0.10.5-2 (Mon Feb 22 23:20:37 CET 2016)" cd ../dokku-arch git add PKGBUILD .SRCINFO git commit -m 'Update to dokku 0.9.9' diff --git a/docs/getting-started/installation.md b/docs/getting-started/installation.md index 832fb0c53..49d2460b9 100644 --- a/docs/getting-started/installation.md +++ b/docs/getting-started/installation.md @@ -21,11 +21,11 @@ To install the latest stable version of dokku, you can run the following shell c ```shell # for debian systems, installs Dokku via apt-get -wget https://raw.githubusercontent.com/dokku/dokku/v0.10.4/bootstrap.sh; -sudo DOKKU_TAG=v0.10.4 bash bootstrap.sh +wget https://raw.githubusercontent.com/dokku/dokku/v0.10.5/bootstrap.sh; +sudo DOKKU_TAG=v0.10.5 bash bootstrap.sh ``` -The installation process takes about 5-10 minutes, depending upon internet connection speed. +The installation process takes about 5-10 minutes, depending upon internet connection speed. If you're using Debian 8 or Ubuntu 14.04, make sure your package manager is configured to install a sufficiently recent version of nginx[3], otherwise, the installation may fail due to "unmet dependencies" relating nginx. @@ -60,4 +60,4 @@ As well, you may wish to customize your installation in some other fashion. or e - [1]: To check whether your system has an fqdn set, run `sudo hostname -f` - [2]: If your system has less than 1GB of memory, you can use [this workaround](/docs/getting-started/advanced-installation.md#vms-with-less-than-1gb-of-memory). -- [3]: nginx >= 1.8.0 can be installed by enabling backports, or by adding [this PPA](https://launchpad.net/~nginx/+archive/ubuntu/stable) if you're using Ubuntu. +- [3]: nginx >= 1.8.0 can be installed via the [nginx repositories](https://www.nginx.com/resources/admin-guide/installing-nginx-open-source/), or by adding [this PPA](https://launchpad.net/~nginx/+archive/ubuntu/stable) if you're using Ubuntu. nginx >= 1.11.5 is necessary for HTTP/2 support diff --git a/docs/home.html b/docs/home.html index 037851209..e11a4ae6f 100644 --- a/docs/home.html +++ b/docs/home.html @@ -10,30 +10,30 @@ Dokku - The smallest PaaS implementation you've ever seen - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - + + - + @@ -98,12 +98,12 @@

$ - wget https://raw.githubusercontent.com/dokku/dokku/v0.10.4/bootstrap.sh + wget https://raw.githubusercontent.com/dokku/dokku/v0.10.5/bootstrap.sh

$ - sudo DOKKU_TAG=v0.10.4 bash bootstrap.sh + sudo DOKKU_TAG=v0.10.5 bash bootstrap.sh

 # go to your server's IP and follow the web installer diff --git a/docs/configuration/dns.md b/docs/networking/dns.md similarity index 100% rename from docs/configuration/dns.md rename to docs/networking/dns.md diff --git a/docs/networking/network.md b/docs/networking/network.md new file mode 100644 index 000000000..810b39ecc --- /dev/null +++ b/docs/networking/network.md @@ -0,0 +1,124 @@ +# Network Management + +> New as of 0.11.0 + +``` +network:report [] [] # Displays a network report for one or more apps +network:rebuild # Rebuilds network settings for an app +network:rebuildall # Rebuild network settings for all apps +network:set () # Set or clear a network property for an app +``` + +The Network plugin allows developers to abstract the concept of container network management, allowing developers to both change what networks a given container is attached to as well as rebuild the configuration on the fly. + +## Usage + +### Rebuilding network settings + +There are cases where you may need to rebuild the network configuration for an app, such as on app boot or container restart. In these cases, you can use the `network:rebuild` command: + +```shell +dokku network:rebuild node-js-app +``` + +> This command will exit a non-zero number that depends on the number of containers for which configuration could not be built + +### Rebuilding all network settings + +In some cases, a docker upgrade may reset container IPs or Ports. In both cases, you can quickly rewrite those files by using the `network:rebuildall` command: + +```shell +dokku network:rebuildall +``` + +> This command will exit a non-zero number that depends on the number of containers for which configuration could not be built + +### Container network interface binding + +> This functionality does not control the `--network` docker flag. Please use the [docker-options plugin](docs/advanced-usage/docker-options.md) to manage this flag. + +By default, an application will only bind to the internal interface. This behavior can be modified per app by changing the `bind-all-interfaces` network property. + +```shell +# bind to the default docker interface (`docker0`) with a random internal ip +# this is the default behavior +dokku network:set node-js-app bind-all-interfaces false + +# bind to all interfaces (`0.0.0.0`) on a random port for each upstream port +# this will make the app container directly accessible by other hosts on your network +# ports are randomized for every deploy, e.g. `0.0.0.0:32771->5000/tcp`. +dokku network:set node-js-app bind-all-interfaces true +``` + +By way of example, in the default case, each container is bound to the docker interface: + +```shell +docker ps +``` + +``` +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +1b88d8aec3d1 dokku/node-js-app:latest "/bin/bash -c '/star About a minute ago Up About a minute node-js-app.web.1 +``` + +As such, the container's IP address will be an internal IP, and thus it is only accessible on the host itself: + +``` +docker inspect --format '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' node-js-app.web.1 +``` + +``` +172.17.0.6 +``` + +However, you can disable the internal proxying via the `network:set` command so that it will listen on the host's IP address: + +```shell +dokku network:set node-js-app bind-all-interfaces true + +# container bound to all interfaces +docker ps +``` + +``` +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +d6499edb0edb dokku/node-js-app:latest "/bin/bash -c '/star About a minute ago Up About a minute 0.0.0.0:49153->5000/tcp node-js-app.web.1 +``` + +### Displaying network reports about an app + +You can get a report about the app's network status using the `network:report` command: + +```shell +dokku network:report +``` + +``` +=====> node-js-app network information + Network bind all interfaces: false + Network listeners: 172.17.0.1:5000 +=====> python-sample network information + Network bind all interfaces: false + Network listeners: 172.17.0.2:5000 +=====> ruby-sample network information + Network bind all interfaces: true + Network listeners: +``` + +You can run the command for a specific app also. + +```shell +dokku network:report node-js-app +``` + +``` +=====> node-js-app network information + Network bind all interfaces: false + Network listeners: 172.17.0.1:5000 +``` + +You can pass flags which will output only the value of the specific information you want. For example: + +```shell +dokku network:report node-js-app --network-bind-all-interfaces +``` diff --git a/docs/advanced-usage/proxy-management.md b/docs/networking/proxy-management.md similarity index 75% rename from docs/advanced-usage/proxy-management.md rename to docs/networking/proxy-management.md index 09f88c0c4..f4f02ef0e 100644 --- a/docs/advanced-usage/proxy-management.md +++ b/docs/networking/proxy-management.md @@ -19,46 +19,9 @@ In Dokku 0.5.0, port proxying was decoupled from the `nginx-vhosts` plugin into ### Container network interface binding -> New as of 0.5.0 +> Changed as of 0.11.0 -By default, the deployed docker container running your app's web process will bind to the internal docker network interface (i.e. `docker inspect --format '{{ .NetworkSettings.IPAddress }}' $CONTAINER_ID`). This behavior can be modified per app by disabling the proxy (i.e. `dokku proxy:disable `). In this case, the container will bind to an external interface (i.e. `0.0.0.0`) and your app container will be directly accessible by other hosts on your network. - -> If a proxy is disabled, Dokku will bind your container's port to a random port on the host for every deploy, e.g. `0.0.0.0:32771->5000/tcp`. - -By way of example, in the default case, each container is bound to the docker interface: - -```shell -docker ps -``` - -``` -CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES -1b88d8aec3d1 dokku/node-js-app:latest "/bin/bash -c '/star About a minute ago Up About a minute node-js-app.web.1 -``` - -As such, the container's IP address will be an internal IP, and thus it is only accessible on the host itself: - -``` -docker inspect --format '{{ .NetworkSettings.IPAddress }}' node-js-app.web.1 -``` - -``` -172.17.0.6 -``` - -However, you can disable the internal proxying via the `proxy:disable` command so that it will listen on the host's IP address: - -```shell -dokku proxy:disable node-js-app - -# container bound to all interfaces -docker ps -``` - -``` -CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES -d6499edb0edb dokku/node-js-app:latest "/bin/bash -c '/star About a minute ago Up About a minute 0.0.0.0:49153->5000/tcp node-js-app.web.1 -``` +From Dokku versions `0.5.0` until `0.11.0`, enabling or disabling an application's proxy would **also** control whether or not the application was bound to all interfaces - e.g. `0.0.0.0`. As of `0.10.0`, this is now controlled by the network plugin. Please see the [network documentation](/docs/networking/network.md#container-network-interface-binding) for more information. ### Displaying proxy reports about an app diff --git a/docs/template.html b/docs/template.html index a2b971f49..81ced6701 100644 --- a/docs/template.html +++ b/docs/template.html @@ -9,26 +9,26 @@ Dokku - The smallest PaaS implementation you've ever seen - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - + + - +