[FEAT] Update user directories properly after an upgrade of base image
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 62/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- bash, docker
- Lĩnh vực
- devops
Hướng nghiên cứu
Thay đổi nằm trong script init s6 tại root/etc/s6-overlay/s6-rc.d/init-dokuwiki-config/run, nơi vòng lặp trên USER_DIRECTORY hiện chỉ sao chép các thư mục mặc định khi /config/dokuwiki/<dir> chưa tồn tại. Hãy đọc vòng lặp này trước, sau đó quyết định cách sao chép mỗi lần khởi động mà không ghi đè các tệp do người dùng tạo, và kiểm tra đoạn mã đề xuất so với hai chú thích hiện có. Hoàn thành khi các thư mục người dùng mặc định của image được làm mới khi container khởi động và dữ liệu người dùng được giữ nguyên, được xác minh bằng cách chạy container với image gốc đã nâng cấp.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Dockerfile
- Star
- 125
- Fork
- 24
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
soroswap/token-list#125 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
nekko-labs/nekko-agent#2998 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
francescopace/espectre#222 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
good first issue ops security
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Kyvera-Labs/verixa#565 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày