feat: expose network listeners to nginx templates for all process types
This change allows users to specify a custom nginx.conf.sigil that can expose non-web process types to the outside world in addition to the web process type. Closes #3258
This commit is contained in:
@@ -47,18 +47,38 @@ Dokku will no longer distribute packages for Debian versions that are not `stabl
|
||||
|
||||
### App report flags
|
||||
|
||||
The following changes on the `apps:report` command were made in this release
|
||||
The `--git-sha` flag was moved from the `apps:report` command to the `git:report` command.
|
||||
|
||||
## Changes
|
||||
|
||||
### App report flags
|
||||
|
||||
The following changes on the `apps:report` command were made in this release:
|
||||
|
||||
- The `--git-sha` flag was moved from the `apps:report` command to the `git:report` command.
|
||||
- The `--deploy-source` flag was renamed to `--app-deploy-source`.
|
||||
- The `--locked` flag was renamed to `--app-locked`.
|
||||
|
||||
### Network report flags
|
||||
|
||||
The following changes on the `network:report` command were made in this release:
|
||||
|
||||
- The `--network-listeners` flag was renamed to `--network-web-listeners`.
|
||||
|
||||
### Plugin Triggers
|
||||
|
||||
- The `network-get-port` trigger was incorrectly documented to have the `isHerokuishContainer` argument as the third argument. The code has been fixed to respect the documentation.
|
||||
- The `network-get-listeners` trigger now takes an additional `processType` argument. If not specified, it defaults to `web`. This default will be removed in an upcoming release.
|
||||
|
||||
## Deprecations
|
||||
|
||||
- `nginx:show-conf` has been deprecated in favor of `nginx:show-config`.
|
||||
- `proxy#is_app_proxy_enabled()` is deprecated in favor of `plugn trigger proxy-is-enabled`
|
||||
- `proxy#get_app_proxy_type()` is deprecated in favor of `plugn trigger proxy-type`
|
||||
- `apps#apps_create()` is deprecated in favor of `plugn trigger app-create`
|
||||
- `apps#apps_destroy()` is deprecated in favor of `plugn trigger app-destroy`
|
||||
- `apps#apps_exists()` is deprecated in favor of `plugn trigger app-exists`
|
||||
- `apps#apps_maybe_create()` is deprecated in favor of `plugn trigger app-maybe-create`
|
||||
- `proxy#is_app_proxy_enabled()` is deprecated in favor of `plugn trigger proxy-is-enabled`.
|
||||
- `proxy#get_app_proxy_type()` is deprecated in favor of `plugn trigger proxy-type`.
|
||||
- `apps#apps_create()` is deprecated in favor of `plugn trigger app-create`.
|
||||
- `apps#apps_destroy()` is deprecated in favor of `plugn trigger app-destroy`.
|
||||
- `apps#apps_exists()` is deprecated in favor of `plugn trigger app-exists`.
|
||||
- `apps#apps_maybe_create()` is deprecated in favor of `plugn trigger app-maybe-create`.
|
||||
- `plugin trigger network-get-listeners` usage without a second `processType` argument is deprecated.
|
||||
- `.NGINX_PORT` variable usage within `nginx.conf.sigil` templates is deprecated in favor of `.PROXY_PORT`.
|
||||
- `.NGINX_SSL_PORT` variable usage within `nginx.conf.sigil` templates is deprecated in favor of `.PROXY_SSL_PORT`.
|
||||
- `.DOKKU_APP_LISTENERS` variable usage within `nginx.conf.sigil` templates is deprecated in favor of `.DOKKU_APP_WEB_LISTENERS`.
|
||||
|
||||
@@ -143,7 +143,6 @@ Dokku uses a templating library by the name of [sigil](https://github.com/glider
|
||||
{{ .APP }} Application name
|
||||
{{ .APP_SSL_PATH }} Path to SSL certificate and key
|
||||
{{ .DOKKU_ROOT }} Global Dokku root directory (ex: app dir would be `{{ .DOKKU_ROOT }}/{{ .APP }}`)
|
||||
{{ .DOKKU_APP_LISTENERS }} List of IP:PORT pairs of app containers
|
||||
{{ .PROXY_PORT }} Non-SSL nginx listener port (same as `DOKKU_PROXY_PORT` config var)
|
||||
{{ .PROXY_SSL_PORT }} SSL nginx listener port (same as `DOKKU_PROXY_SSL_PORT` config var)
|
||||
{{ .NOSSL_SERVER_NAME }} List of non-SSL VHOSTS
|
||||
@@ -154,6 +153,8 @@ Dokku uses a templating library by the name of [sigil](https://github.com/glider
|
||||
{{ .SSL_SERVER_NAME }} List of SSL VHOSTS
|
||||
```
|
||||
|
||||
Finally, each process type has it's network listeners - a list of IP:PORT pairs for the respective app containers - exposed via an `.DOKKU_APP_${PROCESS_TYPE}_LISTENERS` variable - the `PROCESS_TYPE` will be upper-cased with hyphens transformed into underscores. Users can use the new variables to expose non-web processes via the nginx proxy.
|
||||
|
||||
> Note: Application config variables are available for use in custom templates. To do so, use the form of `{{ var "FOO" }}` to access a variable named `FOO`.
|
||||
|
||||
### Customizing via configuration files included by the default templates
|
||||
|
||||
@@ -150,7 +150,7 @@ server {
|
||||
}
|
||||
|
||||
upstream {{ .APP }} {
|
||||
{{ range .DOKKU_APP_LISTENERS | split " " }}
|
||||
{{ range .DOKKU_APP_WEB_LISTENERS | split " " }}
|
||||
server {{ . }};
|
||||
{{ end }}
|
||||
}
|
||||
|
||||
@@ -678,7 +678,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
- Description: Return the listeners (host:port combinations) for a given app container
|
||||
- Invoked by: `internally triggered by a deploy`
|
||||
- Arguments: `$APP`
|
||||
- Arguments: `$APP $PROCESS_TYPE`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
|
||||
Reference in New Issue
Block a user