This is an automated email from the ASF dual-hosted git repository. membphis pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git
The following commit(s) were added to refs/heads/master by this push: new e33f75d bugfix: use `ss.listen_port` to generate https listening port. (#1133) e33f75d is described below commit e33f75da4ea2beaba1e271aa990fd9f9acd73304 Author: YuanSheng Wang <membp...@gmail.com> AuthorDate: Tue Feb 18 12:40:15 2020 +0800 bugfix: use `ss.listen_port` to generate https listening port. (#1133) --- .gitignore | 1 - .travis/{check-nginxconf.sh => apisix_cli_test.sh} | 37 ++++++++++++++++++---- .travis/linux_apisix_luarocks_runner.sh | 8 ++--- bin/apisix | 3 +- 4 files changed, 34 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index c95899a..3255856 100644 --- a/.gitignore +++ b/.gitignore @@ -44,7 +44,6 @@ luac.out *.pid t/servroot go -\.* conf/apisix.uid conf/nginx.conf deps diff --git a/.travis/check-nginxconf.sh b/.travis/apisix_cli_test.sh old mode 100644 new mode 100755 similarity index 50% rename from .travis/check-nginxconf.sh rename to .travis/apisix_cli_test.sh index 938325a..7ef2089 --- a/.travis/check-nginxconf.sh +++ b/.travis/apisix_cli_test.sh @@ -17,13 +17,38 @@ # limitations under the License. # -#check whether the 'reuseport' is in nginx.conf . -matched=`grep -E "listen.*reuseport" conf/nginx.conf | wc -l` -if [ $matched -eq 0 ]; then +# 'make init' operates scripts and related configuration files in the current directory +# The 'apisix' command is a command in the /usr/local/apisix, +# and the configuration file for the operation is in the /usr/local/apisix/conf + +set -ex + +# check whether the 'reuseport' is in nginx.conf . +make init + +grep -E "listen 9080.*reuseport" conf/nginx.conf > /dev/null +if [ ! $? -eq 0 ]; then echo "failed: nginx.conf file is missing reuseport configuration" exit 1 -else - echo "passed: nginx.conf file contains reuseport configuration" fi -exit 0 +echo "passed: nginx.conf file contains reuseport configuration" + +# check default ssl port +sed -i 's/listen_port: 9443/listen_port: 8443/g' conf/config.yaml + +make init + +grep "listen 8443 ssl" conf/nginx.conf > /dev/null +if [ ! $? -eq 0 ]; then + echo "failed: failed to update ssl port" + exit 1 +fi + +grep "listen \[::\]:8443 ssl" conf/nginx.conf > /dev/null +if [ ! $? -eq 0 ]; then + echo "failed: failed to update ssl port" + exit 1 +fi + +echo "passed: change default ssl port" diff --git a/.travis/linux_apisix_luarocks_runner.sh b/.travis/linux_apisix_luarocks_runner.sh index 9327a47..d3e2e23 100755 --- a/.travis/linux_apisix_luarocks_runner.sh +++ b/.travis/linux_apisix_luarocks_runner.sh @@ -58,12 +58,8 @@ script() { sudo PATH=$PATH apisix start sudo PATH=$PATH apisix stop - # make init - # 'make init' operates scripts and related configuration files in the current directory - # The 'apisix' command is a command in the /usr/local/apisix, - # and the configuration file for the operation is in the /usr/local/apisix/conf - sudo PATH=$PATH make init - sudo PATH=$PATH bash .travis/check-nginxconf.sh + # apisix cli test + sudo PATH=$PATH .travis/apisix_cli_test.sh sudo luarocks remove rockspec/apisix-master-0.rockspec } diff --git a/bin/apisix b/bin/apisix index d91e163..7e4b89a 100755 --- a/bin/apisix +++ b/bin/apisix @@ -295,7 +295,7 @@ http { {% if enable_ipv6 then %} listen [::]:{* node_listen *} {% if enable_reuseport then %} reuseport {% end %}; {% if ssl.enable then %} - listen [::]:{* node_ssl_listen *} ssl {% if ssl.enable_http2 then %} http2 {% end %} {% if enable_reuseport then %} reuseport {% end %}; + listen [::]:{* ssl.listen_port *} ssl {% if ssl.enable_http2 then %} http2 {% end %} {% if enable_reuseport then %} reuseport {% end %}; {% end %} {% end %} {% -- if enable_ipv6 %} @@ -566,7 +566,6 @@ local function init() os_name = exec("uname"), apisix_lua_home = apisix_home, with_module_status = with_module_status, - node_ssl_listen = 9443, -- default value error_log = {level = "warn"}, }