You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/01/08 07:16:53 UTC
[GitHub] [apisix] Firstsawyou opened a new pull request #3220: chore: it is forbidden to execute make run in the /root directory to run apisix.
Firstsawyou opened a new pull request #3220:
URL: https://github.com/apache/apisix/pull/3220
### What this PR does / why we need it:
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->
close #3207
### Pre-submission checklist:
* [x] Did you explain what problem does this PR solve? Or what new features have been added?
* [ ] Have you added corresponding test cases?
* [ ] Have you modified the corresponding document?
* [x] Is this PR backward compatible? **If it is not backward compatible, please discuss on the [mailing list](https://github.com/apache/apisix/tree/master#community) first**
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix] membphis commented on a change in pull request #3220: chore: it is forbidden to execute make run in the /root directory to run apisix.
Posted by GitBox <gi...@apache.org>.
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.

##########
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:
users@infra.apache.org
[GitHub] [apisix] moonming commented on a change in pull request #3220: chore: it is forbidden to execute make run in the /root directory to run apisix.
Posted by GitBox <gi...@apache.org>.
moonming commented on a change in pull request #3220:
URL: https://github.com/apache/apisix/pull/3220#discussion_r554283435
##########
File path: Makefile
##########
@@ -83,7 +83,10 @@ init: default
### run: Start the apisix server
.PHONY: run
run: default
-ifeq ("$(wildcard logs/nginx.pid)", "")
+ifeq ("$(findstring /root, ${PWD})", "/root")
Review comment:
We need a thorough solution, not a temporary patch
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix] Firstsawyou commented on a change in pull request #3220: chore: it is forbidden to execute make run in the /root directory to run apisix.
Posted by GitBox <gi...@apache.org>.
Firstsawyou commented on a change in pull request #3220:
URL: https://github.com/apache/apisix/pull/3220#discussion_r554286060
##########
File path: Makefile
##########
@@ -83,7 +83,10 @@ init: default
### run: Start the apisix server
.PHONY: run
run: default
-ifeq ("$(wildcard logs/nginx.pid)", "")
+ifeq ("$(findstring /root, ${PWD})", "/root")
Review comment:
Ok, got it.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix] moonming commented on a change in pull request #3220: chore: it is forbidden to execute make run in the /root directory to run apisix.
Posted by GitBox <gi...@apache.org>.
moonming commented on a change in pull request #3220:
URL: https://github.com/apache/apisix/pull/3220#discussion_r554539863
##########
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:
I think you don’t understand the permissions issues under Linux at all
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix] spacewander commented on a change in pull request #3220: chore: it is forbidden to execute make run in the /root directory to run apisix.
Posted by GitBox <gi...@apache.org>.
spacewander commented on a change in pull request #3220:
URL: https://github.com/apache/apisix/pull/3220#discussion_r553802247
##########
File path: Makefile
##########
@@ -83,7 +83,10 @@ init: default
### run: Start the apisix server
.PHONY: run
run: default
-ifeq ("$(wildcard logs/nginx.pid)", "")
+ifeq ("$(findstring /root, ${PWD})", "/root")
+ @echo "Non-zero exit status: 1"
Review comment:
I mean to exit the `make run` with non-zero exit code.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix] Firstsawyou commented on a change in pull request #3220: chore: it is forbidden to execute make run in the /root directory to run apisix.
Posted by GitBox <gi...@apache.org>.
Firstsawyou commented on a change in pull request #3220:
URL: https://github.com/apache/apisix/pull/3220#discussion_r554533628
##########
File path: Makefile
##########
@@ -83,7 +83,10 @@ init: default
### run: Start the apisix server
.PHONY: run
run: default
-ifeq ("$(wildcard logs/nginx.pid)", "")
+ifeq ("$(findstring /root, ${PWD})", "/root")
Review comment:
updated.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix] spacewander commented on a change in pull request #3220: chore: it is forbidden to execute make run in the /root directory to run apisix.
Posted by GitBox <gi...@apache.org>.
spacewander commented on a change in pull request #3220:
URL: https://github.com/apache/apisix/pull/3220#discussion_r553854742
##########
File path: Makefile
##########
@@ -84,8 +84,8 @@ init: default
.PHONY: run
run: default
ifeq ("$(findstring /root, ${PWD})", "/root")
- @echo "Non-zero exit status: 1"
- @echo "Error, It is forbidden to run APISIX in the /root directory."
+ @echo "Error: It is forbidden to run APISIX in the /root directory."
+ @exit 1
Review comment:
We need to add a test for it.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix] spacewander commented on a change in pull request #3220: chore: it is forbidden to execute make run in the /root directory to run apisix.
Posted by GitBox <gi...@apache.org>.
spacewander commented on a change in pull request #3220:
URL: https://github.com/apache/apisix/pull/3220#discussion_r553860547
##########
File path: Makefile
##########
@@ -84,8 +84,8 @@ init: default
.PHONY: run
run: default
ifeq ("$(findstring /root, ${PWD})", "/root")
- @echo "Non-zero exit status: 1"
- @echo "Error, It is forbidden to run APISIX in the /root directory."
+ @echo "Error: It is forbidden to run APISIX in the /root directory."
+ @exit 1
Review comment:
See https://github.com/apache/apisix/blob/ebd158a8583306183533e92cb87d39854b0af42a/.travis/apisix_cli_test/test_main.sh#L920
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix] Firstsawyou commented on a change in pull request #3220: chore: it is forbidden to execute make run in the /root directory to run apisix.
Posted by GitBox <gi...@apache.org>.
Firstsawyou commented on a change in pull request #3220:
URL: https://github.com/apache/apisix/pull/3220#discussion_r555459724
##########
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:
updated.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix] Firstsawyou commented on a change in pull request #3220: chore: it is forbidden to execute make run in the /root directory to run apisix.
Posted by GitBox <gi...@apache.org>.
Firstsawyou commented on a change in pull request #3220:
URL: https://github.com/apache/apisix/pull/3220#discussion_r556226898
##########
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:
A note has been added here: [https://github.com/apache/apisix/pull/3220/files#diff-c25d1a2aac172147aa01feec3fa29bfe6c4625cda4773719a1cf13e67fd54da2R42 ](https://github.com/apache/apisix/pull/3220/files#diff-c25d1a2aac172147aa01feec3fa29bfe6c4625cda4773719a1cf13e67fd54da2R42)
I will add more comments here later:
https://github.com/apache/apisix/pull/3220/files#diff-228a51571b53709ad043d1c6c14fc8e508c248a84f8014fe548b5d259cedd5ddR378
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix] membphis commented on a change in pull request #3220: chore: it is forbidden to execute make run in the /root directory to run apisix.
Posted by GitBox <gi...@apache.org>.
membphis commented on a change in pull request #3220:
URL: https://github.com/apache/apisix/pull/3220#discussion_r556215763
##########
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:
any news? @Firstsawyou
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix] Firstsawyou commented on a change in pull request #3220: chore: it is forbidden to execute make run in the /root directory to run apisix.
Posted by GitBox <gi...@apache.org>.
Firstsawyou commented on a change in pull request #3220:
URL: https://github.com/apache/apisix/pull/3220#discussion_r553800652
##########
File path: Makefile
##########
@@ -83,7 +83,9 @@ init: default
### run: Start the apisix server
.PHONY: run
run: default
-ifeq ("$(wildcard logs/nginx.pid)", "")
+ifeq ("$(findstring /root, ${PWD})", "/root")
+ @echo "Warning! It is forbidden to run APISIX in the /root directory."
Review comment:
updated.
##########
File path: Makefile
##########
@@ -83,7 +83,10 @@ init: default
### run: Start the apisix server
.PHONY: run
run: default
-ifeq ("$(wildcard logs/nginx.pid)", "")
+ifeq ("$(findstring /root, ${PWD})", "/root")
+ @echo "Non-zero exit status: 1"
Review comment:
@spacewander
Updated, please help me to see, is this right?
##########
File path: Makefile
##########
@@ -84,8 +84,8 @@ init: default
.PHONY: run
run: default
ifeq ("$(findstring /root, ${PWD})", "/root")
- @echo "Non-zero exit status: 1"
- @echo "Error, It is forbidden to run APISIX in the /root directory."
+ @echo "Error: It is forbidden to run APISIX in the /root directory."
+ @exit 1
Review comment:
I don't know how to add test cases for Makefile. Can you give me some suggestions?
##########
File path: Makefile
##########
@@ -84,8 +84,8 @@ init: default
.PHONY: run
run: default
ifeq ("$(findstring /root, ${PWD})", "/root")
- @echo "Non-zero exit status: 1"
- @echo "Error, It is forbidden to run APISIX in the /root directory."
+ @echo "Error: It is forbidden to run APISIX in the /root directory."
+ @exit 1
Review comment:
好的,我知道了。
##########
File path: Makefile
##########
@@ -84,8 +84,8 @@ init: default
.PHONY: run
run: default
ifeq ("$(findstring /root, ${PWD})", "/root")
- @echo "Non-zero exit status: 1"
- @echo "Error, It is forbidden to run APISIX in the /root directory."
+ @echo "Error: It is forbidden to run APISIX in the /root directory."
+ @exit 1
Review comment:
Ok, got it.
##########
File path: Makefile
##########
@@ -83,7 +83,10 @@ init: default
### run: Start the apisix server
.PHONY: run
run: default
-ifeq ("$(wildcard logs/nginx.pid)", "")
+ifeq ("$(findstring /root, ${PWD})", "/root")
Review comment:
Ok, got it.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix] spacewander commented on a change in pull request #3220: chore: it is forbidden to execute make run in the /root directory to run apisix.
Posted by GitBox <gi...@apache.org>.
spacewander commented on a change in pull request #3220:
URL: https://github.com/apache/apisix/pull/3220#discussion_r553802247
##########
File path: Makefile
##########
@@ -83,7 +83,10 @@ init: default
### run: Start the apisix server
.PHONY: run
run: default
-ifeq ("$(wildcard logs/nginx.pid)", "")
+ifeq ("$(findstring /root, ${PWD})", "/root")
+ @echo "Non-zero exit status: 1"
Review comment:
I mean to exit the Makefile with non-zero exit code.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix] Firstsawyou commented on a change in pull request #3220: fix: APISIX runs in the `/root` directory and reports errors
Posted by GitBox <gi...@apache.org>.
Firstsawyou commented on a change in pull request #3220:
URL: https://github.com/apache/apisix/pull/3220#discussion_r556240672
##########
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:
> any news? @Firstsawyou
updated.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix] Firstsawyou commented on pull request #3220: chore: it is forbidden to execute make run in the /root directory to run apisix.
Posted by GitBox <gi...@apache.org>.
Firstsawyou commented on pull request #3220:
URL: https://github.com/apache/apisix/pull/3220#issuecomment-757081068
> I don't think this method can completely solve the permission problem. Can an error be thrown if the code file cannot be found in the init phase of apisix?
There will be no errors when executing `make init`. Only when `make run` is executed, it will cause an error that dependent files cannot be found. Therefore, I think prohibiting the execution of `make run` under `/root` can solve this problem.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix] membphis commented on pull request #3220: chore: it is forbidden to execute make run in the /root directory to run apisix.
Posted by GitBox <gi...@apache.org>.
membphis commented on pull request #3220:
URL: https://github.com/apache/apisix/pull/3220#issuecomment-758526368
@Firstsawyou CI failed, please fix it first
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix] Firstsawyou commented on a change in pull request #3220: chore: it is forbidden to execute make run in the /root directory to run apisix.
Posted by GitBox <gi...@apache.org>.
Firstsawyou commented on a change in pull request #3220:
URL: https://github.com/apache/apisix/pull/3220#discussion_r553839780
##########
File path: Makefile
##########
@@ -83,7 +83,10 @@ init: default
### run: Start the apisix server
.PHONY: run
run: default
-ifeq ("$(wildcard logs/nginx.pid)", "")
+ifeq ("$(findstring /root, ${PWD})", "/root")
+ @echo "Non-zero exit status: 1"
Review comment:
@spacewander
Updated, please help me to see, is this right?
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix] Firstsawyou commented on a change in pull request #3220: chore: it is forbidden to execute make run in the /root directory to run apisix.
Posted by GitBox <gi...@apache.org>.
Firstsawyou commented on a change in pull request #3220:
URL: https://github.com/apache/apisix/pull/3220#discussion_r553800652
##########
File path: Makefile
##########
@@ -83,7 +83,9 @@ init: default
### run: Start the apisix server
.PHONY: run
run: default
-ifeq ("$(wildcard logs/nginx.pid)", "")
+ifeq ("$(findstring /root, ${PWD})", "/root")
+ @echo "Warning! It is forbidden to run APISIX in the /root directory."
Review comment:
updated.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix] Firstsawyou commented on pull request #3220: chore: it is forbidden to execute make run in the /root directory to run apisix.
Posted by GitBox <gi...@apache.org>.
Firstsawyou commented on pull request #3220:
URL: https://github.com/apache/apisix/pull/3220#issuecomment-757081068
> I don't think this method can completely solve the permission problem. Can an error be thrown if the code file cannot be found in the init phase of apisix?
There will be no errors when executing `make init`. Only when `make run` is executed, it will cause an error that dependent files cannot be found. Therefore, I think prohibiting the execution of `make run` under `/root` can solve this problem.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix] Firstsawyou commented on a change in pull request #3220: chore: it is forbidden to execute make run in the /root directory to run apisix.
Posted by GitBox <gi...@apache.org>.
Firstsawyou commented on a change in pull request #3220:
URL: https://github.com/apache/apisix/pull/3220#discussion_r556227795
##########
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:
Cause of the bug: After APISIX is started, the `worker process` has the authority of nobody ordinary user. When APISIX is in the /root directory, ordinary users do not have the authority to access the `/root` directory. Therefore, when APISIX is started, the error log `error.log` will show the following error message:
```
init_worker_by_lua error: /root/apisix-2.1/apisix/init.lua:89: module 'resty.worker.events' not found:
no field package.preload['resty.worker.events']
no file '/root/apisix-2.1//deps/share/lua/5.1/resty/worker/events.lua'
no file '/root/apisix-2.1//deps/share/lua/5.1/resty/worker/events/init.lua'
no file '/root/apisix-2.1/resty/worker/events.lua'
no file '/root/apisix-2.1/resty/worker/events/init.lua'
```
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix] Firstsawyou commented on pull request #3220: chore: it is forbidden to execute make run in the /root directory to run apisix.
Posted by GitBox <gi...@apache.org>.
Firstsawyou commented on pull request #3220:
URL: https://github.com/apache/apisix/pull/3220#issuecomment-758531655
> @Firstsawyou CI failed, please fix it first
Okay, I will fix it later.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix] Firstsawyou commented on a change in pull request #3220: chore: it is forbidden to execute make run in the /root directory to run apisix.
Posted by GitBox <gi...@apache.org>.
Firstsawyou commented on a change in pull request #3220:
URL: https://github.com/apache/apisix/pull/3220#discussion_r553866774
##########
File path: Makefile
##########
@@ -84,8 +84,8 @@ init: default
.PHONY: run
run: default
ifeq ("$(findstring /root, ${PWD})", "/root")
- @echo "Non-zero exit status: 1"
- @echo "Error, It is forbidden to run APISIX in the /root directory."
+ @echo "Error: It is forbidden to run APISIX in the /root directory."
+ @exit 1
Review comment:
Ok, got it.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix] moonming commented on pull request #3220: chore: it is forbidden to execute make run in the /root directory to run apisix.
Posted by GitBox <gi...@apache.org>.
moonming commented on pull request #3220:
URL: https://github.com/apache/apisix/pull/3220#issuecomment-757074466
I don't think this method can completely solve the permission problem. Can an error be thrown if the code file cannot be found in the init phase of apisix?
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix] moonming commented on a change in pull request #3220: chore: it is forbidden to execute make run in the /root directory to run apisix.
Posted by GitBox <gi...@apache.org>.
moonming commented on a change in pull request #3220:
URL: https://github.com/apache/apisix/pull/3220#discussion_r554283435
##########
File path: Makefile
##########
@@ -83,7 +83,10 @@ init: default
### run: Start the apisix server
.PHONY: run
run: default
-ifeq ("$(wildcard logs/nginx.pid)", "")
+ifeq ("$(findstring /root, ${PWD})", "/root")
Review comment:
We need a thorough solution, not a temporary patch
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix] Firstsawyou commented on a change in pull request #3220: chore: it is forbidden to execute make run in the /root directory to run apisix.
Posted by GitBox <gi...@apache.org>.
Firstsawyou commented on a change in pull request #3220:
URL: https://github.com/apache/apisix/pull/3220#discussion_r553866774
##########
File path: Makefile
##########
@@ -84,8 +84,8 @@ init: default
.PHONY: run
run: default
ifeq ("$(findstring /root, ${PWD})", "/root")
- @echo "Non-zero exit status: 1"
- @echo "Error, It is forbidden to run APISIX in the /root directory."
+ @echo "Error: It is forbidden to run APISIX in the /root directory."
+ @exit 1
Review comment:
好的,我知道了。
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix] membphis commented on pull request #3220: fix: APISIX runs in the `/root` directory and reports errors
Posted by GitBox <gi...@apache.org>.
membphis commented on pull request #3220:
URL: https://github.com/apache/apisix/pull/3220#issuecomment-762542775
ping @moonming
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix] spacewander commented on a change in pull request #3220: chore: it is forbidden to execute make run in the /root directory to run apisix.
Posted by GitBox <gi...@apache.org>.
spacewander commented on a change in pull request #3220:
URL: https://github.com/apache/apisix/pull/3220#discussion_r553781415
##########
File path: Makefile
##########
@@ -83,7 +83,9 @@ init: default
### run: Start the apisix server
.PHONY: run
run: default
-ifeq ("$(wildcard logs/nginx.pid)", "")
+ifeq ("$(findstring /root, ${PWD})", "/root")
+ @echo "Warning! It is forbidden to run APISIX in the /root directory."
Review comment:
It should be an error and exit with nonzero code, as APISIX won't be run.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix] spacewander commented on a change in pull request #3220: chore: it is forbidden to execute make run in the /root directory to run apisix.
Posted by GitBox <gi...@apache.org>.
spacewander commented on a change in pull request #3220:
URL: https://github.com/apache/apisix/pull/3220#discussion_r553802247
##########
File path: Makefile
##########
@@ -83,7 +83,10 @@ init: default
### run: Start the apisix server
.PHONY: run
run: default
-ifeq ("$(wildcard logs/nginx.pid)", "")
+ifeq ("$(findstring /root, ${PWD})", "/root")
+ @echo "Non-zero exit status: 1"
Review comment:
I mean to exit the Makefile with non-zero exit code.
##########
File path: Makefile
##########
@@ -83,7 +83,10 @@ init: default
### run: Start the apisix server
.PHONY: run
run: default
-ifeq ("$(wildcard logs/nginx.pid)", "")
+ifeq ("$(findstring /root, ${PWD})", "/root")
+ @echo "Non-zero exit status: 1"
Review comment:
I mean to exit the `make run` with non-zero exit code.
##########
File path: Makefile
##########
@@ -84,8 +84,8 @@ init: default
.PHONY: run
run: default
ifeq ("$(findstring /root, ${PWD})", "/root")
- @echo "Non-zero exit status: 1"
- @echo "Error, It is forbidden to run APISIX in the /root directory."
+ @echo "Error: It is forbidden to run APISIX in the /root directory."
+ @exit 1
Review comment:
We need to add a test for it.
##########
File path: Makefile
##########
@@ -84,8 +84,8 @@ init: default
.PHONY: run
run: default
ifeq ("$(findstring /root, ${PWD})", "/root")
- @echo "Non-zero exit status: 1"
- @echo "Error, It is forbidden to run APISIX in the /root directory."
+ @echo "Error: It is forbidden to run APISIX in the /root directory."
+ @exit 1
Review comment:
See https://github.com/apache/apisix/blob/ebd158a8583306183533e92cb87d39854b0af42a/.travis/apisix_cli_test/test_main.sh#L920
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix] moonming commented on pull request #3220: chore: it is forbidden to execute make run in the /root directory to run apisix.
Posted by GitBox <gi...@apache.org>.
moonming commented on pull request #3220:
URL: https://github.com/apache/apisix/pull/3220#issuecomment-757074466
I don't think this method can completely solve the permission problem. Can an error be thrown if the code file cannot be found in the init phase of apisix?
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix] Firstsawyou commented on a change in pull request #3220: chore: it is forbidden to execute make run in the /root directory to run apisix.
Posted by GitBox <gi...@apache.org>.
Firstsawyou commented on a change in pull request #3220:
URL: https://github.com/apache/apisix/pull/3220#discussion_r553857954
##########
File path: Makefile
##########
@@ -84,8 +84,8 @@ init: default
.PHONY: run
run: default
ifeq ("$(findstring /root, ${PWD})", "/root")
- @echo "Non-zero exit status: 1"
- @echo "Error, It is forbidden to run APISIX in the /root directory."
+ @echo "Error: It is forbidden to run APISIX in the /root directory."
+ @exit 1
Review comment:
I don't know how to add test cases for Makefile. Can you give me some suggestions?
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix] spacewander merged pull request #3220: fix: APISIX runs in the `/root` directory and reports errors
Posted by GitBox <gi...@apache.org>.
spacewander merged pull request #3220:
URL: https://github.com/apache/apisix/pull/3220
----------------------------------------------------------------
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:
users@infra.apache.org