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 2022/02/07 00:11:45 UTC

[GitHub] [apisix] leslie-tsang opened a new issue #6250: request help: remove `sudo` in utils script as it has been started with `sudo`

leslie-tsang opened a new issue #6250:
URL: https://github.com/apache/apisix/issues/6250


   ### Issue description
   
   It is **rarely** a good idea to have `sudo` inside scripts.
   Instead, remove the `sudo` from the script and run it with sudo, as APISIX GitHub Action does.
   That way, all commands within the script will be run with root privileges and you only need to give the password once when launching the script.
   
   ## Solution
   I think we should remove all `sudo` in the script, I would like to know what is your opinion on this issue :)
   
   ### Environment
   
   - apisix version (cmd: `apisix version`):
   - OS (cmd: `uname -a`):
   - OpenResty / Nginx version (cmd: `nginx -V` or `openresty -V`):
   - etcd version, if have (cmd: run `curl http://127.0.0.1:9090/v1/server_info` to get the info from server-info API):
   - apisix-dashboard version, if have:
   - the plugin runner version, if the issue is about a plugin runner (cmd: depended on the kind of runner):
   - luarocks version, if the issue is about installation (cmd: `luarocks --version`):
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] leslie-tsang closed issue #6250: request help: remove `sudo` in utils script as it has been started with `sudo`

Posted by GitBox <gi...@apache.org>.
leslie-tsang closed issue #6250:
URL: https://github.com/apache/apisix/issues/6250


   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] spacewander commented on issue #6250: request help: remove `sudo` in utils script as it has been started with `sudo`

Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #6250:
URL: https://github.com/apache/apisix/issues/6250#issuecomment-1031123553


   This thing has happened before.
   
   Take `utils/linux-install-luarocks.sh` as example:
   1. the first version used `sudo` to install
   2. I removed the sudo in https://github.com/apache/apisix/commit/32d6b6e03ae593b74c6c2952f23b01197b5058df#diff-4fc86c1a9aa8e4ff0b1e5767d2d2bfa32579829c477d034bea4e8f96fe7ab69d
   3. several months later, we got in trouble and added the sudo back in https://github.com/apache/apisix/commit/d96a0f9c74f1690b841c5cd099f7b57c771da84c#diff-4fc86c1a9aa8e4ff0b1e5767d2d2bfa32579829c477d034bea4e8f96fe7ab69d
   
   To prevent another `sudo -> remove sudo -> add sudo back` cycle, I suggest we should only do that when people are requiring.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] zaunist commented on issue #6250: request help: remove `sudo` in utils script as it has been started with `sudo`

Posted by GitBox <gi...@apache.org>.
zaunist commented on issue #6250:
URL: https://github.com/apache/apisix/issues/6250#issuecomment-1030975368


   This can lead to a problem where a command in a script that should not use sudo permissions is also run with sudo permissions.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] leslie-tsang commented on issue #6250: request help: remove `sudo` in utils script as it has been started with `sudo`

Posted by GitBox <gi...@apache.org>.
leslie-tsang commented on issue #6250:
URL: https://github.com/apache/apisix/issues/6250#issuecomment-1031129819


   > I suggest we should only do that when people are requiring.
   
   Makes sense, thanks for the reply.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] leslie-tsang commented on issue #6250: request help: remove `sudo` in utils script as it has been started with `sudo`

Posted by GitBox <gi...@apache.org>.
leslie-tsang commented on issue #6250:
URL: https://github.com/apache/apisix/issues/6250#issuecomment-1030978471


   > This can lead to a problem where a command in a script that should not use sudo permissions is also run with sudo permissions.
   
   I don't think so, as [.github/workflows/build.yml](https://github.com/apache/apisix/blob/master/.github/workflows/build.yml#L107) already uses `sudo` to launch the script by default.
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] zaunist commented on issue #6250: request help: remove `sudo` in utils script as it has been started with `sudo`

Posted by GitBox <gi...@apache.org>.
zaunist commented on issue #6250:
URL: https://github.com/apache/apisix/issues/6250#issuecomment-1030984217


   > 
   
   
   
   > > This can lead to a problem where a command in a script that should not use sudo permissions is also run with sudo permissions.
   > 
   > I don't think so, as [.github/workflows/build.yml](https://github.com/apache/apisix/blob/master/.github/workflows/build.yml#L107) already uses `sudo` to launch the script by default.
   
   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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org