membphis commented on a change in pull request #3220:
URL: https://github.com/apache/apisix/pull/3220#discussion_r555026165



##########
File path: apisix/cli/ops.lua
##########
@@ -375,6 +375,10 @@ end
 
 
 local function start(env, ...)
+    if env.is_root_path then
+        util.die("Error: It is forbidden to run APISIX in the /root 
directory.\n")

Review comment:
       the current way is right, but it is hard to read. @Firstsawyou please 
add some comment here.
   
   
![image](https://user-images.githubusercontent.com/6814606/104184835-094b2000-544f-11eb-985d-0a3a352c07f1.png)
   

##########
File path: t/cli/cli.t
##########
@@ -58,3 +58,21 @@ nameserver 172.27.0.1
 nameserver fe80::215:5dff:fec5:8e1d
 --- response_body
 ["172.27.0.1","fe80::215:5dff:fec5:8e1d"]
+
+
+
+=== TEST 2: It is forbidden to run APISIX under the /root 
directory(is_root_path is true).

Review comment:
       we should use `shell` script to test this case
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to