[FEAT] Update user directories properly after an upgrade of base image
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 62/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- bash, docker
- 领域
- devops
调研方向
该修改应放在 s6 初始化脚本 root/etc/s6-overlay/s6-rc.d/init-dokuwiki-config/run 中,其中对 USER_DIRECTORY 的循环目前仅在 /config/dokuwiki/<dir> 不存在时才复制默认文件夹。请先阅读该循环,然后决定如何在每次启动时复制,同时不覆盖用户创建的文件,并对照现有的两条注释检查建议的代码片段。完成标准是:容器启动时刷新镜像中的默认用户文件夹,同时保持用户数据完好,并通过使用已升级的基础镜像运行容器来验证。
由索引模型根据 Issue 内容生成。
描述
Is this a new feature request?
- I have searched the existing issues
Wanted change
As mentioned by @splitbrain in #90, newer files from the base image are not updated in the user folders:
... it does not update DokuWiki's default files when updating the image and people will run into this problem again in the future.
As background... Although the image moves the user folders from inside the container (/app/www/public) to outside (/config/dokuwiki): https://github.com/linuxserver/docker-dokuwiki/blob/b9a777eafc944052bab4d87c3abeb6a640811b9c/root/etc/s6-overlay/s6-rc.d/init-dokuwiki-config/run#L33-L38
This is however only done when the folder not already exists (! -d /config/dokuwiki/"${i}"). That makes sense: after a user starts using the wiki the user folder will probably contain user files and we do not want to overwrite those. The problem however: when the container is updated the newer version will never reach the user folder.
To fix this we should ALWAYS copy files from the container to the user folders (where applicable). This should be safe because a DokuWiki upgrade is (https://www.dokuwiki.org/install:upgrade) "...Step 4: Unpack the distribution tarball and upload/copy the files over your previous installation...". In other words: the container should not contain files that are modified by the user.
Reason for change
Updates to the image are not properly propagated leading to (potential) errors after a newer version of DokuWiki is released. See #90 for an example of such a case.
Proposed code change
With:
## Sync user folders to persistent storage
for i in "${USER_DIRECTORY[@]}"; do
if [[ -d /app/www/public/"${i}" ]]; then
mkdir -p /config/dokuwiki/"${i}"
cp -a /app/www/public/"${i}" /config/dokuwiki/
fi
done
- 主要语言
- Dockerfile
- 星标
- 125
- 派生
- 24
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
相似的 Issue
-
area: doc-engine area: infrastructure bug community-request
难度 2/5 1-3 小时 新手友好度 75/100
snapotter-hq/SnapOtter#4834 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 73/100
soroswap/token-list#125 ·
维护者通常 1 天内回复
-
enhancement roadmap: next
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 68/100
nekko-labs/nekko-agent#2998 ·
维护者通常 1 天内回复