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

feat: add docker permission related settings #380

Merged
merged 5 commits into from
Mar 25, 2024
Merged

feat: add docker permission related settings #380

merged 5 commits into from
Mar 25, 2024

Conversation

1lkei
Copy link
Contributor

@1lkei 1lkei commented Feb 16, 2024

给docker镜像添加了设置用户用户组umask功能

@monkeyWie
Copy link
Member

感谢感谢,我还堵在高速上呢,明天看看

@1lkei
Copy link
Contributor Author

1lkei commented Feb 17, 2024

感谢感谢,我还堵在高速上呢,明天看看

没事,我也是第一次提交pr,明天你看看有没有问题

apk upgrade --no-cache && \
apk add --no-cache bash su-exec; \
chmod +x ./entrypoint.sh && \
rm -rf /var/cache/apk/*
VOLUME ["/app/storage"]
EXPOSE 9999
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我对比了下alist的dockerfile,这里少了一行ENV PUID=0 PGID=0 UMASK=022

entrypoint.sh Outdated
Comment on lines 3 to 5
mkdir /Downloads

chown -R ${PUID}:${PGID} /app /Downloads
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

下载目录是/root/Downloads,可以不用创建了,直接改成:

chown -R ${PUID}:${PGID} /root/Downloads

entrypoint.sh Outdated
Comment on lines 9 to 13
if [ "$#" -gt 0 ]; then
exec su-exec ${PUID}:${PGID} ./gopeed "$@"
else
exec su-exec ${PUID}:${PGID} ./gopeed
fi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的判断可以不要了,直接换成:

exec su-exec ${PUID}:${PGID} ./gopeed "$@"

Copy link
Member

@monkeyWie monkeyWie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我参考了下alist的dockerfile给了点修改建议,你看看

@1lkei
Copy link
Contributor Author

1lkei commented Feb 18, 2024

我试了有问题,给gopeed设置普通用户权限后他会自己在根目录创建Downloads目录并设置为下载目录,手动改回/root/Downloads也没权限,即使我设置/root/Downloads所有者跟程序一样也不行,其他应该没问题了

@monkeyWie
Copy link
Member

我考虑了下,为了不同用户统一安装目录,下个版本把docker里的默认下载目录改成/opt/gopeed/download,然后这个pr再改一改就可以了

@michaelauto
Copy link

根目录/Downloads作为默认下载目录可行吗?反正都要映射出来

@1lkei
Copy link
Contributor Author

1lkei commented Feb 19, 2024

根目录/Downloads作为默认下载目录可行吗?反正都要映射出来

这不是根本解决办法,等新版修改默认下载地址后再说吧

@monkeyWie
Copy link
Member

抱歉久等了,Docker构建默认下载目录改成/app/Download了,麻烦再更新下 pr 哦

@1lkei
Copy link
Contributor Author

1lkei commented Mar 24, 2024

抱歉久等了,Docker构建默认下载目录改成/app/Download了,麻烦再更新下 pr 哦

等我一下,时间有点久我有点忘了,先研究研究

@1lkei
Copy link
Contributor Author

1lkei commented Mar 24, 2024

抱歉久等了,Docker构建默认下载目录改成/app/Download了,麻烦再更新下 pr 哦

看看这样应该ok了

@monkeyWie
Copy link
Member

LGTM

@monkeyWie monkeyWie changed the title feat: add permission related settings feat: add docker permission related settings Mar 25, 2024
@monkeyWie monkeyWie merged commit c696b59 into GopeedLab:main Mar 25, 2024
@monkeyWie monkeyWie added the enhancement New feature or request label Mar 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants