huan / docker-wechat

DoChat is a Dockerized WeChat (盒装微信) PC Windows Client for Linux
https://hub.docker.com/r/zixia/wechat
Apache License 2.0
2.24k stars 203 forks source link

Disallow root script run #209

Closed DE0CH closed 11 months ago

DE0CH commented 11 months ago

I added a check to stop the script if the user is root. Also, I hid an environment variable ALLOWROOT which if set to 1 will allow the script to run if the user wants to run it as root for whatever reason.

This would avoid numerous issues with ~/DoChat becoming owned by root causing permission denided issues (such as in https://github.com/huan/docker-wechat/issues/165 and https://github.com/huan/docker-wechat/issues/178).

Also, I got rid of the warning message of lshw -C display which, if not run with sudo, confusingly prints out WARNING: you should run this program as super-user., which can mislead people (including me) to run the script with sudo

CLAassistant commented 11 months ago

CLA assistant check
All committers have signed the CLA.

DE0CH commented 11 months ago

Thanks. I just made the changes requested.

huan commented 11 months ago

It seems that there's a problem when publishing the image to the docker hub: https://github.com/huan/docker-wechat/actions/runs/6606361107/job/17942485588#step:5:294

@DE0CH Could you please take a look at it?

Thank you very much!

DE0CH commented 11 months ago

Yep. https://github.com/huan/docker-wechat/pull/210.

I actually ran into this problem when debugging, but seeing that the docker image somehow was built and published to the docker hub I thought it didn't need fixing.