This is an automated email from the ASF dual-hosted git repository.

spacewander pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git


The following commit(s) were added to refs/heads/master by this push:
     new 7abd958  chore: update tinyyaml lib and remove unnecessary quotes in 
config (#4484)
7abd958 is described below

commit 7abd9585cfab2bc69dfd2ccfd26bbac1b75ddbfc
Author: Shuyang Wu <[email protected]>
AuthorDate: Tue Jul 13 02:49:30 2021 -0400

    chore: update tinyyaml lib and remove unnecessary quotes in config (#4484)
---
 conf/config-default.yaml          | 48 +++++++++++++++++++--------------------
 conf/config.yaml                  |  6 ++---
 rockspec/apisix-master-0.rockspec |  2 +-
 t/cli/test_etcd.sh                | 16 ++++++-------
 t/cli/test_main.sh                | 19 ++++++++++++++++
 5 files changed, 55 insertions(+), 36 deletions(-)

diff --git a/conf/config-default.yaml b/conf/config-default.yaml
index ebd28c7..ab75004 100644
--- a/conf/config-default.yaml
+++ b/conf/config-default.yaml
@@ -52,8 +52,8 @@ apisix:
                                    # which cache to use by name in the admin 
api
         memory_size: 50m           # The size of shared memory, it's used to 
store the cache index
         disk_size: 1G              # The size of disk, it's used to store the 
cache data
-        disk_path: "/tmp/disk_cache_one"  # The path to store the cache data
-        cache_levels: "1:2"        # The hierarchy levels of a cache
+        disk_path: /tmp/disk_cache_one  # The path to store the cache data
+        cache_levels: 1:2        # The hierarchy levels of a cache
       #- name: disk_cache_two
       #  memory_size: 50m
       #  disk_size: 1G
@@ -77,12 +77,12 @@ apisix:
   # require any authentication.
   admin_key:
     -
-      name: "admin"
+      name: admin
       key: edd1c9f034335f136f87ad84b625c8f1
       role: admin                 # admin: manage all configuration data
                                   # viewer: only can view configuration data
     -
-      name: "viewer"
+      name: viewer
       key: 4054f7cf07e344346cd3f287985e76a2
       role: viewer
 
@@ -90,12 +90,12 @@ apisix:
   global_rule_skip_internal_api: true    # does not run global rule in 
internal apis
                                          # api that path starts with "/apisix" 
is considered to be internal api
   router:
-    http: 'radixtree_uri'         # radixtree_uri: match route by uri(base on 
radixtree)
+    http: radixtree_uri         # radixtree_uri: match route by uri(base on 
radixtree)
                                   # radixtree_host_uri: match route by host + 
uri(base on radixtree)
                                   # radixtree_uri_with_parameter: like 
radixtree_uri but match uri with parameters,
                                   #   see 
https://github.com/api7/lua-resty-radixtree/#parameters-in-path for
                                   #   more details.
-    ssl: 'radixtree_sni'          # radixtree_sni: match route by SNI(base on 
radixtree)
+    ssl: radixtree_sni          # radixtree_sni: match route by SNI(base on 
radixtree)
   #stream_proxy:                  # TCP/UDP proxy
   #  tcp:                         # TCP proxy port list
   #    - addr: 9100
@@ -117,25 +117,25 @@ apisix:
     #ssl_trusted_certificate: /path/to/ca-cert  # Specifies a file path with 
trusted CA certificates in the PEM format
                                                 # used to verify the 
certificate when APISIX needs to do SSL/TLS handshaking
                                                 # with external services (e.g. 
etcd)
-    ssl_protocols: "TLSv1.2 TLSv1.3"
-    ssl_ciphers: 
"ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384"
+    ssl_protocols: TLSv1.2 TLSv1.3
+    ssl_ciphers: 
ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384
     ssl_session_tickets: false              #  disable ssl_session_tickets by 
default for 'ssl_session_tickets' would make Perfect Forward Secrecy useless.
                                             #  ref: 
https://github.com/mozilla/server-side-tls/issues/135
-    key_encrypt_salt: "edd1c9f0985e76a2"    #  If not set, will save origin 
ssl key into etcd.
+    key_encrypt_salt: edd1c9f0985e76a2      #  If not set, will save origin 
ssl key into etcd.
                                             #  If set this, must be a string 
of length 16. And it will encrypt ssl key with AES-128-CBC
                                             #  !!! So do not change it after 
saving your ssl, it can't decrypt the ssl keys have be saved if you change !!
   enable_control: true
   #control:
-  #  ip: "127.0.0.1"
+  #  ip: 127.0.0.1
   #  port: 9090
   disable_sync_configuration_during_start: false  # safe exit. Remove this 
once the feature is stable
 
 nginx_config:                     # config for render the template to generate 
nginx.conf
-  #user: "root"                   # specifies the execution user of the worker 
process.
+  #user: root                     # specifies the execution user of the worker 
process.
                                   # the "user" directive makes sense only if 
the master process runs with super-user privileges.
                                   # if you're not root user,the default is 
current user.
-  error_log: "logs/error.log"
-  error_log_level: "warn"         # warn,error
+  error_log: logs/error.log
+  error_log_level:  warn          # warn,error
   worker_processes: auto          # if you want use multiple cores in 
container, you can inject the number of cpu as environment variable 
"APISIX_WORKER_PROCESSES"
   enable_cpu_affinity: true       # enable cpu affinity, this is just work 
well only on physical machine
   worker_rlimit_nofile: 20480     # the number of files a worker process can 
open, should be larger than worker_connections
@@ -174,7 +174,7 @@ nginx_config:                     # config for render the 
template to generate n
 
   http:
     enable_access_log: true        # enable access log or not, default true
-    access_log: "logs/access.log"
+    access_log: logs/access.log
     access_log_format: "$remote_addr - $remote_user [$time_local] $http_host 
\"$request\" $status $body_bytes_sent $request_time \"$http_referer\" 
\"$http_user_agent\" $upstream_addr $upstream_status $upstream_response_time 
\"$upstream_scheme://$upstream_host$upstream_uri\""
     access_log_format_escape: default       # allows setting json or default 
characters escaping in variables
     keepalive_timeout: 60s         # timeout during which a keep-alive client 
connection will stay open on the server side.
@@ -186,11 +186,11 @@ nginx_config:                     # config for render the 
template to generate n
 
     send_timeout: 10s              # timeout for transmitting a response to 
the client.then the connection is closed
     underscores_in_headers: "on"   # default enables the use of underscores in 
client request header fields
-    real_ip_header: "X-Real-IP"    # 
http://nginx.org/en/docs/http/ngx_http_realip_module.html#real_ip_header
+    real_ip_header: X-Real-IP      # 
http://nginx.org/en/docs/http/ngx_http_realip_module.html#real_ip_header
     real_ip_recursive: "off"       # 
http://nginx.org/en/docs/http/ngx_http_realip_module.html#real_ip_recursive
     real_ip_from:                  # 
http://nginx.org/en/docs/http/ngx_http_realip_module.html#set_real_ip_from
       - 127.0.0.1
-      - 'unix:'
+      - "unix:"
     #lua_shared_dicts:             # add custom shared cache to nginx.conf
     #  ipc_shared_dict: 100m       # custom shared cache, format: `cache-key: 
cache-size`
 
@@ -230,9 +230,9 @@ nginx_config:                     # config for render the 
template to generate n
 
 etcd:
   host:                           # it's possible to define multiple etcd 
hosts addresses of the same etcd cluster.
-    - "http://127.0.0.1:2379";     # multiple etcd address, if your etcd 
cluster enables TLS, please use https scheme,
-                                  # e.g. "https://127.0.0.1:2379";.
-  prefix: "/apisix"               # apisix configurations prefix
+    - http://127.0.0.1:2379       # multiple etcd address, if your etcd 
cluster enables TLS, please use https scheme,
+                                  # e.g. https://127.0.0.1:2379.
+  prefix: /apisix                 # apisix configurations prefix
   timeout: 30                     # 30 seconds
   #resync_delay: 5                # when sync failed and a rest is needed, 
resync after the configured seconds plus 50% random jitter
   #health_check_timeout: 10       # etcd retry the unhealthy nodes after the 
configured seconds
@@ -250,11 +250,11 @@ etcd:
 #discovery:                       # service discovery center
 #  dns:
 #    servers:
-#      - "127.0.0.1:8600"         # use the real address of your dns server
+#      - 127.0.0.1:8600           # use the real address of your dns server
 #  eureka:
 #    host:                        # it's possible to define multiple eureka 
hosts addresses of the same eureka cluster.
-#      - "http://127.0.0.1:8761";
-#    prefix: "/eureka/"
+#      - http://127.0.0.1:8761
+#    prefix: /eureka/
 #    fetch_interval: 30           # default 30s
 #    weight: 100                  # default weight for node
 #    timeout:
@@ -330,13 +330,13 @@ plugin_attr:
     max_kept: 168     # max number of log files will be kept
   skywalking:
     service_name: APISIX
-    service_instance_name: "APISIX Instance Name"
+    service_instance_name: APISIX Instance Name
     endpoint_addr: http://127.0.0.1:12800
   prometheus:
     export_uri: /apisix/prometheus/metrics
     enable_export_server: true
     export_addr:
-      ip: "127.0.0.1"
+      ip: 127.0.0.1
       port: 9091
   server-info:
     report_interval: 60  # server info report interval (unit: second)
diff --git a/conf/config.yaml b/conf/config.yaml
index 59a6a2c..b45fa5e 100644
--- a/conf/config.yaml
+++ b/conf/config.yaml
@@ -19,19 +19,19 @@
 #
 # etcd:
 #     host:
-#       - "http://127.0.0.1:2379";
+#       - http://127.0.0.1:2379
 #
 # To configure via environment variables, you can use `${{VAR}}` syntax. For 
instance:
 #
 # etcd:
 #     host:
-#       - "http://${{ETCD_HOST}}:2379";
+#       - http://${{ETCD_HOST}}:2379
 #
 # And then run `export ETCD_HOST=$your_host` before `make init`.
 #
 # If the configured environment variable can't be found, an error will be 
thrown.
 apisix:
   admin_key:
-    - name: "admin"
+    - name: admin
       key: edd1c9f034335f136f87ad84b625c8f1  # using fixed API token has 
security risk, please update it when you deploy to production environment
       role: admin
diff --git a/rockspec/apisix-master-0.rockspec 
b/rockspec/apisix-master-0.rockspec
index 9232050..78438c9 100644
--- a/rockspec/apisix-master-0.rockspec
+++ b/rockspec/apisix-master-0.rockspec
@@ -48,7 +48,7 @@ dependencies = {
     "lua-protobuf = 0.3.2",
     "lua-resty-openidc = 1.7.2-1",
     "luafilesystem = 1.7.0-2",
-    "lua-tinyyaml = 1.0",
+    "api7-lua-tinyyaml = 0.3.0",
     "nginx-lua-prometheus = 0.20210206",
     "jsonschema = 0.9.5",
     "lua-resty-ipmatcher = 0.6",
diff --git a/t/cli/test_etcd.sh b/t/cli/test_etcd.sh
index 30f5e4d..c417baa 100755
--- a/t/cli/test_etcd.sh
+++ b/t/cli/test_etcd.sh
@@ -34,8 +34,8 @@ etcdctl --endpoints=127.0.0.1:2379 --user=root:apache-api6 
del /apisix --prefix
 echo '
 etcd:
   host:
-    - "http://127.0.0.1:2379";
-  prefix: "/apisix"
+    - http://127.0.0.1:2379
+  prefix: /apisix
   timeout: 30
   user: root
   password: apache-api6
@@ -86,8 +86,8 @@ git checkout conf/config.yaml
 echo '
 etcd:
   host:
-    - "http://127.0.0.1:2389";
-  prefix: "/apisix"
+    - http://127.0.0.1:2389
+  prefix: /apisix
 ' > conf/config.yaml
 
 out=$(make init 2>&1 || true)
@@ -104,8 +104,8 @@ git checkout conf/config.yaml
 echo '
 etcd:
   host:
-    - "http://127.0.0.1:2389";
-  prefix: "/apisix"
+    - http://127.0.0.1:2389
+  prefix: /apisix
 ' > conf/config.yaml
 
 out=$(make init 2>&1 || true)
@@ -131,8 +131,8 @@ etcdctl --endpoints=127.0.0.1:2379 --user=root:apache-api6 
del /apisix --prefix
 echo '
 etcd:
   host:
-    - "http://127.0.0.1:2379";
-  prefix: "/apisix"
+    - http://127.0.0.1:2379
+  prefix: /apisix
   timeout: 30
   user: root
   password: apache-api7
diff --git a/t/cli/test_main.sh b/t/cli/test_main.sh
index 593dc68..74dd79d 100755
--- a/t/cli/test_main.sh
+++ b/t/cli/test_main.sh
@@ -681,6 +681,25 @@ fi
 
 echo "passed: found the 'variables_hash_max_size 1024;' in nginx.conf"
 
+# test disk_path without quotes
+git checkout conf/config.yaml
+
+echo '
+apisix:
+  proxy_cache:
+    zones:
+      - disk_path: /tmp/disk_cache_one
+' > conf/config.yaml
+
+make init
+
+if ! grep "proxy_cache_path /tmp/disk_cache_one" conf/nginx.conf > /dev/null; 
then
+    echo "failed: disk_path could not work without quotes"
+    exit 1
+fi
+
+echo "passed: disk_path could work without quotes"
+
 # check the stream lua_shared_dict lrucache_lock value
 git checkout conf/config.yaml
 

Reply via email to