box: support TT_* uri env vars with query params
`TT_LISTEN` and `TT_REPLICATION` environment variables were interpreted by `box.cfg()` in a confusing way if query parameters with values are present. For example, `localhost:3301?transport=plain` was interpreted as the following map: `{['localhost:3301?transport'] = 'plain'}`. Later, `box.cfg()` looks into this map for known URI fields like `login`, `password`, `uri`, `host`, `service` and so on. It found nothing and doesn't start a listening socket. The reason of such a behaviour is that the environment value is interpreted as a mapping in the `key=value,key=value` format, because there is `=` in it. The patch changes this behavior for an `key=value,key=value` environment variable that contains `?` in a key: now such a value is not interpreted as a mapping. Note: Everything said above is also applicable to the so called multilisten case: when several URIs are defined in the environment variable. The following URI list is interpreted correctly now. NOWRAP ```sh export TT_LISTEN=localhost:3301?transport=plain,localhost:3302?transport=plain ``` NOWRAP Note 2: Examples are given with the `plain` transport, which is default, but the query parameters are the way to define TLS options. They're supported in Tarantool Enterprise Edition, see [1]. Fixes #9539 NO_DOC=bugfix [1]: https://www.tarantool.io/en/doc/latest/enterprise/security/#traffic-encryption
Showing
- changelogs/unreleased/gh-9539-box-cfg-env-vars-with-query-params.md 4 additions, 0 deletions.../unreleased/gh-9539-box-cfg-env-vars-with-query-params.md
- src/box/lua/load_cfg.lua 36 additions, 9 deletionssrc/box/lua/load_cfg.lua
- test/box-luatest/box_cfg_env_test.lua 255 additions, 0 deletionstest/box-luatest/box_cfg_env_test.lua
Loading
Please register or sign in to comment