Merge pull request #2058 from dokku/2057_mh-remove-global-tls-refs
remove references to global TLS certs
This commit is contained in:
commit
8cbc36fd22
5 files changed
+4
-34
No files matched your search
@@ -64,34 +64,6 @@ root@dokku:~/dokku# dokku certs:info node-js-app
|
|||||||
|
|
||||||
The `certs:remove` command only works on app-specific certificates. It will `rm` the app-specific tls directory, rebuild the nginx configuration, and reload nginx.
|
The `certs:remove` command only works on app-specific certificates. It will `rm` the app-specific tls directory, rebuild the nginx configuration, and reload nginx.
|
||||||
|
|
||||||
## Global Certification
|
|
||||||
|
|
||||||
Global certificate management is a manual process. To enable TLS connections for all your applications at once you will need a wildcard TLS certificate.
|
|
||||||
|
|
||||||
To enable TLS across all apps, you can run the following commands:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
mkdir -p /home/dokku/tls
|
|
||||||
cp server.crt /home/dokku/tls/server.crt
|
|
||||||
cp server.key /home/dokku/tls/server.key
|
|
||||||
```
|
|
||||||
|
|
||||||
Next, you will want to enable the certificates by editing `/etc/nginx/conf.d/dokku.conf` and uncommenting these two lines (remove the `#`):
|
|
||||||
|
|
||||||
```
|
|
||||||
ssl_certificate /home/dokku/tls/server.crt;
|
|
||||||
ssl_certificate_key /home/dokku/tls/server.key;
|
|
||||||
```
|
|
||||||
|
|
||||||
The settings will take affect at the next deploy. If you would like to propagate the change to all apps immediately, you can also run the following command:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
dokku ps:restartall
|
|
||||||
```
|
|
||||||
|
|
||||||
Once TLS is enabled, the application will be accessible by `https://` (redirection from `http://` is applied as well).
|
|
||||||
|
|
||||||
> Note: TLS will not be enabled unless the application's VHOST matches the certificate's name. (i.e. if you have a cert for `*.example.com` TLS won't be enabled for `something.example.org` or `example.net`)
|
|
||||||
|
|
||||||
## HSTS Header
|
## HSTS Header
|
||||||
|
|
||||||
|
|||||||
@@ -156,8 +156,8 @@ checks_check_deploy() {
|
|||||||
local CURL_OPTIONS="-q --compressed --fail --location --max-time $TIMEOUT"
|
local CURL_OPTIONS="-q --compressed --fail --location --max-time $TIMEOUT"
|
||||||
|
|
||||||
# Set X-Forwarded-Proto header if TLS is enabled.
|
# Set X-Forwarded-Proto header if TLS is enabled.
|
||||||
local SSL="$DOKKU_ROOT/$APP/tls"; local WILDCARD_SSL="$DOKKU_ROOT/tls"
|
local SSL="$DOKKU_ROOT/$APP/tls"
|
||||||
if [[ -e "$SSL/server.crt" && -e "$SSL/server.key" ]] || [[ -e "$WILDCARD_SSL/server.crt" && -e "$WILDCARD_SSL/server.key" ]]; then
|
if [[ -e "$SSL/server.crt" && -e "$SSL/server.key" ]]; then
|
||||||
local CURL_OPTIONS+=" -H X-Forwarded-Proto:https"
|
local CURL_OPTIONS+=" -H X-Forwarded-Proto:https"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -33,8 +33,6 @@ ssl_session_timeout 10m;
|
|||||||
|
|
||||||
ssl_ciphers EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
|
ssl_ciphers EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
|
||||||
|
|
||||||
# ssl_certificate $DOKKU_ROOT/tls/server.crt;
|
|
||||||
# ssl_certificate_key $DOKKU_ROOT/tls/server.key;
|
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ setup() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
teardown() {
|
teardown() {
|
||||||
rm -rf /home/dokku/$TEST_APP/tls /home/dokku/tls
|
rm -rf /home/dokku/$TEST_APP/tls
|
||||||
destroy_app
|
destroy_app
|
||||||
dokku config:unset --global DOKKU_RM_CONTAINER
|
dokku config:unset --global DOKKU_RM_CONTAINER
|
||||||
rm -f "$DOCKERFILE"
|
rm -f "$DOCKERFILE"
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ setup() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
teardown() {
|
teardown() {
|
||||||
rm -rf /home/dokku/$TEST_APP/tls /home/dokku/tls
|
rm -rf /home/dokku/$TEST_APP/tls
|
||||||
destroy_app
|
destroy_app
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user