diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b682d6..088df83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,22 @@ This document outlines major changes between releases. ## [Unreleased] +### Added +- Multiple server listeners (#228) + +### Updating from v0.25.0 +Make sure your configuration is valid: + +If you configure application using environment variables change: +* `HTTP_GW_LISTEN_ADDRESS` -> `HTTP_GW_SERVER_0_ADDRESS` +* `HTTP_GW_TLS_CERT_FILE` -> `HTTP_GW_SERVER_0_TLS_CERT_FILE` (and set `HTTP_GW_SERVER_0_TLS_ENABLED=true`) +* `HTTP_GW_TLS_KEY_FILE` -> `HTTP_GW_SERVER_0_TLS_KEY_FILE` (and set `HTTP_GW_SERVER_0_TLS_ENABLED=true`) + +If you configure application using `.yaml` file change: +* `listen_address` -> `server.0.address` +* `tls.cert_file` -> `server.0.tls.cert_file` (and set `server.0.tls.enabled: true`) +* `tls.key_file` -> `server.0.tls.key_file` (and set `server.0.tls.enabled: true`) + ### Fixed - Download zip archive when `FilePath` is invalid (#222) - Only one peer must be healthy to init pool (#233) diff --git a/docs/gate-configuration.md b/docs/gate-configuration.md index 2a69a1a..5944e39 100644 --- a/docs/gate-configuration.md +++ b/docs/gate-configuration.md @@ -47,6 +47,7 @@ $ cat http.log | `peers` | [Nodes configuration](#peers-section) | | `logger` | [Logger configuration](#logger-section) | | `web` | [Web configuration](#web-section) | +| `server` | [Server configuration](#server-section) | | `upload-header` | [Upload header configuration](#upload-header-section) | | `zip` | [ZIP configuration](#zip-section) | | `pprof` | [Pprof configuration](#pprof-section) | @@ -56,10 +57,6 @@ $ cat http.log # General section ```yaml -listen_address: 0.0.0.0:8082 -tls_certificate: /path/to/tls/cert -tls_key: /path/to/tls/key - rpc_endpoint: http://morph-chain.neofs.devenv:30333 resolve_order: - nns @@ -74,9 +71,6 @@ pool_error_threshold: 100 | Parameter | Type | SIGHUP reload | Default value | Description | |------------------------|------------|---------------|----------------|------------------------------------------------------------------------------------| -| `listen_address` | `string` | | `0.0.0.0:8082` | The address that the gateway is listening on. | -| `tls_certificate` | `string` | yes | | Path to the TLS certificate. | -| `tls_key` | `string` | yes | | Path to the TLS key. | | `rpc_endpoint` | `string` | yes | | The address of the RPC host to which the gateway connects to resolve bucket names. | | `resolve_order` | `[]string` | yes | `[nns, dns]` | Order of bucket name resolvers to use. | | `connect_timeout` | `duration` | | `10s` | Timeout to connect to a node. | @@ -131,6 +125,32 @@ peers: | `priority` | `int` | `1` | It allows to group nodes and don't switch group until all nodes with the same priority will be unhealthy. The lower the value, the higher the priority. | | `weight` | `float` | `1` | Weight of node in the group with the same priority. Distribute requests to nodes proportionally to these values. | +# `server` section + +You can specify several listeners for server. For example, for `http` and `https`. + +```yaml +server: + - address: 0.0.0.0:8080 + tls: + enabled: false + cert_file: /path/to/cert + key_file: /path/to/key + - address: 0.0.0.0:8081 + tls: + enabled: true + cert_file: /path/to/another/cert + key_file: /path/to/another/key +``` + +| Parameter | Type | SIGHUP reload | Default value | Description | +|-----------------|----------|---------------|----------------|-----------------------------------------------| +| `address` | `string` | | `0.0.0.0:8080` | The address that the gateway is listening on. | +| `tls.enabled` | `bool` | | false | Enable TLS or not. | +| `tls.cert_file` | `string` | yes | | Path to the TLS certificate. | +| `tls.key_file` | `string` | yes | | Path to the key. | + + # `logger` section ```yaml