[FEAT] Update user directories properly after an upgrade of base image
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 62/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- bash, docker
- Domain
- devops
Research direction
The change belongs in the s6 init script at root/etc/s6-overlay/s6-rc.d/init-dokuwiki-config/run, where the loop over USER_DIRECTORY currently copies default folders only when /config/dokuwiki/<dir> does not exist. Read that loop first, then decide how to copy on every start without overwriting user-created files, and check the proposed snippet against the two existing comments. Done means the image's default user folders are refreshed on container start while user data is left intact, verified by running the container with an upgraded base image.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- Dockerfile
- Stars
- 125
- Forks
- 24
- PR merge metrics
- No merged PRs in 30d
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from linuxserver/docker-dokuwiki
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
linuxserver/docker-dokuwiki#94 · 2 comments ·
All issues in linuxserver/docker-dokuwiki
Similar issues
-
canary-dead
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
activescott/home-infra-k8s-flux#578 ·
Maintainers usually reply within 1 day
-
repo-harnesses: the entrypoint-guard check greps a message `#13692` reworded, so it fails on mainOpen
Difficulty 1/5 Under an hour Newbie friendliness 88/100
daniel-ospina/tortoise#14947 ·
Maintainers usually reply within 1 day
-
area: infra tier: p3 type: chore
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
flashinfer-ai/flashinfer#10251 ·
Maintainers usually reply within 1 day