Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

为什么aria2下载的文件都是root权限 #44

Closed
channelsray opened this issue Aug 18, 2018 · 12 comments
Closed

为什么aria2下载的文件都是root权限 #44

channelsray opened this issue Aug 18, 2018 · 12 comments

Comments

@channelsray
Copy link

default

@wahyd4
Copy link
Owner

wahyd4 commented Aug 18, 2018 via email

@channelsray
Copy link
Author

这样我aria2下载的文件只有可读的权限了,没法删除

@wahyd4
Copy link
Owner

wahyd4 commented Aug 18, 2018 via email

@channelsray
Copy link
Author

确实是使用root用户登录的,只不过是aria2下载的文件是root才有写的权限,但是nextcloud只有991的权限,使得aria2下载的文件只有读没有写的权限

@wahyd4
Copy link
Owner

wahyd4 commented Aug 18, 2018

不太理解你说的991的问题,本程序中的 nextcloud 也是使用 root 用户的。而且经过之前的修复 #38

使用 root 用户不能删除文件的权限的问题应该已经解决了。

@channelsray
Copy link
Author

我这里nextcloud 运行和文件夹权限就变成991了。。
default

@wahyd4
Copy link
Owner

wahyd4 commented Aug 18, 2018

你这个 nextcloud 是什么目录? 991 是用户 ID 和用户组 ID 吧,不是权限。 是你宿主机自己设置的,还是被容器创建的?

@channelsray
Copy link
Author

我查看了以下#38用的是官方的nextCloud,#39又切换回去了

@wahyd4
Copy link
Owner

wahyd4 commented Aug 18, 2018 via email

@channelsray
Copy link
Author

nextcloud 是被容器创建的目录,创建开始是root权限,进入网页之后更新为991权限,

@wahyd4
Copy link
Owner

wahyd4 commented Aug 18, 2018

刚查了 Nextcloud 镜像的文档, 991是他们默认设置的用户ID 和用户组 ID, 是可以通过环境变量覆盖的。修改 docker-compose.yml 中,nextcloud 镜像里面的参数即可
https://github.com/Wonderfall/docker-nextcloud#environment-variables

environment:
   - UID=
   - GID=

就可以手动绑定,让容器和宿主机运行于同样的用户了。
我后期也会更新代码让 Aria2 镜像也能支持绑定 UID 和 GID

@wahyd4 wahyd4 closed this as completed Aug 18, 2018
@channelsray
Copy link
Author

对,我也查了,但是nextClout还需要修改三个地方,他默认禁止root
第一个:修改/php/etc/php-fpm.comf
image
添加user和group为root的选项
第二个: 修改/etc/s6.d/php/run
image
加上 -R 允许root 启动
第三个: 修改/nginx/conf/nginx.conf
image
添加 user root root;修改为root启动

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants