diff --git a/debian/control b/debian/control index cf778c634..ce9a2b6ed 100644 --- a/debian/control +++ b/debian/control @@ -3,9 +3,9 @@ Version: 0.20.4 Section: web Priority: optional Architecture: amd64 -Depends: locales, git, cpio, curl, man-db, netcat, sshcommand (>= 0.10.0), gliderlabs-sigil, docker-engine-cs (>= 1.13.0) | docker-engine (>= 1.13.0) | docker-io (>= 1.13.0) | docker.io (>= 1.13.0) | docker-ce (>= 1.13.0) | docker-ee (>= 1.13.0), net-tools, software-properties-common, procfile-util, python-software-properties | python3-software-properties, rsyslog, dos2unix, jq +Depends: locales, git, cpio, curl, man-db, netcat, sshcommand (>= 0.10.0), docker-engine-cs (>= 1.13.0) | docker-engine (>= 1.13.0) | docker-io (>= 1.13.0) | docker.io (>= 1.13.0) | docker-ce (>= 1.13.0) | docker-ee (>= 1.13.0), net-tools, software-properties-common, procfile-util, python-software-properties | python3-software-properties, rsyslog, dos2unix, jq Recommends: herokuish (>= 0.3.4), parallel, dokku-update, dokku-event-listener -Pre-Depends: nginx (>= 1.8.0) | openresty, dnsutils, cgroupfs-mount | cgroup-lite, plugn (>= 0.3.0), sudo, python3, debconf +Pre-Depends: gliderlabs-sigil, nginx (>= 1.8.0) | openresty, dnsutils, cgroupfs-mount | cgroup-lite, plugn (>= 0.3.0), sudo, python3, debconf Maintainer: Jose Diaz-Gonzalez Description: Docker-powered PaaS that helps build and manage the lifecycle of applications Dokku is an extensible, open source Platform as a Service diff --git a/docs/development/plugin-triggers.md b/docs/development/plugin-triggers.md index adfd0a0e4..b5142f41d 100644 --- a/docs/development/plugin-triggers.md +++ b/docs/development/plugin-triggers.md @@ -854,6 +854,21 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x # TODO ``` +### `nginx-dokku-template-source` + +- Description: Customize the source location of the `dokku.conf` nginx configuration file +- Invoked by: `nginx-vhosts#install` +- Arguments: +- 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 app diff --git a/plugins/20_events/nginx-dokku-template-source b/plugins/20_events/nginx-dokku-template-source new file mode 120000 index 000000000..5178a749f --- /dev/null +++ b/plugins/20_events/nginx-dokku-template-source @@ -0,0 +1 @@ +hook \ No newline at end of file diff --git a/plugins/nginx-vhosts/install b/plugins/nginx-vhosts/install index edf6e9969..9b7ef6d79 100755 --- a/plugins/nginx-vhosts/install +++ b/plugins/nginx-vhosts/install @@ -61,20 +61,14 @@ trigger-nginx-vhosts-install() { mkdir -p "$NGINX_ROOT/conf.d" chown root:root "$NGINX_ROOT/dhparam.pem" chown root:root "$NGINX_ROOT/conf.d" - cat <"$NGINX_ROOT/conf.d/dokku.conf" -include $DOKKU_ROOT/*/nginx.conf; + # cat <"$NGINX_ROOT/conf.d/dokku.conf" + local DOKKU_TEMPLATE="$PLUGIN_AVAILABLE_PATH/nginx-vhosts/templates/dokku.conf.sigil" + CUSTOM_DOKKU_TEMPLATE="$(plugn trigger nginx-dokku-template-source)" + if [[ -n "$CUSTOM_DOKKU_TEMPLATE" ]] && [[ -f "$CUSTOM_DOKKU_TEMPLATE" ]]; then + DOKKU_TEMPLATE="$CUSTOM_DOKKU_TEMPLATE" + fi -server_tokens off; - -# Settings from https://mozilla.github.io/server-side-tls/ssl-config-generator/ -ssl_session_cache shared:SSL:20m; -ssl_session_timeout 1d; -ssl_session_tickets off; - -ssl_dhparam $NGINX_ROOT/dhparam.pem; -ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384; - -EOF + sigil -f "$DOKKU_TEMPLATE" DOKKU_ROOT="$DOKKU_ROOT" NGINX_ROOT="$NGINX_ROOT" | cat -s >"$NGINX_ROOT/conf.d/dokku.conf" # allow users to override their server_names_hash_bucket_size if [[ ! -f "$NGINX_ROOT/conf.d/server_names_hash_bucket_size.conf" ]]; then diff --git a/plugins/nginx-vhosts/templates/dokku.conf.sigil b/plugins/nginx-vhosts/templates/dokku.conf.sigil new file mode 100644 index 000000000..ecc76fe6e --- /dev/null +++ b/plugins/nginx-vhosts/templates/dokku.conf.sigil @@ -0,0 +1,11 @@ +include {{ $.DOKKU_ROOT }}/*/nginx.conf; + +server_tokens off; + +# Settings from https://mozilla.github.io/server-side-tls/ssl-config-generator/ +ssl_session_cache shared:SSL:20m; +ssl_session_timeout 1d; +ssl_session_tickets off; + +ssl_dhparam {{ $.NGINX_ROOT }}/dhparam.pem; +ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;