mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2026-04-25 09:06:02 +03:00
[GH-ISSUE #1247] Question: Is there a way around permission checks? #766
Labels
No labels
expected: maybe someday
expected: next release
expected: release after next
expected: unlikely unless contributed
good first ticket
help wanted
pull-request
scope: all users
scope: windows users
size: easy
size: hard
size: medium
size: medium
status: backlog
status: blocked
status: done
status: idea-phase
status: needs followup
status: wip
status: wontfix
touches: API/CLI/Spec
touches: configuration
touches: data/schema/architecture
touches: dependencies/packaging
touches: docs
touches: js
touches: views/replayers/html/css
why: correctness
why: functionality
why: performance
why: security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ArchiveBox#766
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @zblesk on GitHub (Oct 18, 2023).
Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/1247
Because of space constraints, I had to move my big archive from the server to a NAS. I've then mounted the archive via NFS and pointed Archivebox to it.
I haven't been able to get it running since.
It always only gets to:
The archive is ~300GB big and because of how it's structured, all FS-level operations take a lot of time.
I've tried chowning it myself, which took over 4 hours.
I apparently didn't hit the correct perm combo, because the message just appears again.
I've let the container run for ~17 hours, which should be more than enough, but nothing changed.
(I'm currently running a differenattempt at a maual fix, but I'm not holding out much hope.)
Is there any way around this? Overriding which user is used (UID and GID in Compose don'd seem to do anything), or maybe letting it run as root and skip perm checks, or something?
(I have also temporarily stopped and disabled Sonic, just to be sure.)
Thanks.
@pirate commented on GitHub (Oct 18, 2023):
I am thinking of removing these checks entirely. They were added to help beginner users with common permission issues when mounting via Docker Desktop on macOS/Windows, but they cause problems for advanced users on network filesystems or who want to manage permissions more granularly.
Until I release that change, as a temporary workaround, you can download and mount this script into docker and remove the permissions check lines here: https://github.com/ArchiveBox/ArchiveBox/blob/dev/bin/docker_entrypoint.sh#L16This will override the entrypoint that runs when docker starts and should let you change it without needing to rebuild an entire custom docker image.@pirate commented on GitHub (Oct 19, 2023):
Ok I removed the forced
chownand replaced it with a warning telling the user how to fix it manually:github.com/ArchiveBox/ArchiveBox@4f655fc4a1@zblesk commented on GitHub (Oct 20, 2023):
Great, thanks! Do you plan to push the change to Docker Hub anytime soon? 🙏🏻
@zblesk commented on GitHub (Oct 24, 2023):
@pirate I've tried pulling the :dev image, and I'm seeing some weird behavior.
All files were owned by my default user (1000:1000). But when I start the container, it starts changing the permissions - it sets ArchiveBox.conf to 999:999, then crashes with
PermissionError: [Errno 13] Permission denied: '/data/ArchiveBox.conf'.I've tried chowning it and starting the container again, but it just sets it to 999 again and crashes.
@pirate commented on GitHub (Oct 26, 2023):
Hmm strange ok I'll remove the top-level chown. What OS are you using on the host?
@p0n1 commented on GitHub (Oct 26, 2023):
@pirate
Similar issue here.
I used to use image with
latesttag and it works perfectly. I just switched to the latestdevtag forSINGLEFILE_ARGSfeature today.Got errors bellow:
I just deployed a new instance for test. If I mount a empty folder, the
devversion could start correctly. But it will fail to start if I just restarted the container and get permission errors like above. I'm using a folder mounted by NFS.Update:
If I just mount a local folder, everything works perfectly without any permission issue. This should be related with strange behavior is NFS mounting.
@pirate commented on GitHub (Oct 30, 2023):
@zblesk and @p0n1 both of your issues should be fixed by passing the PUID & PGID environment variables to the container containing the UID & GID you want the files to be owned by. This matches the behavior of all LinuxServer.io docker images, and is a general common standard for many containers. I'm moving away from force-chowning the data dir in favor of this standard as it's a better practice to ask the user what the ownership should be rather than reset it by force. https://docs.linuxserver.io/general/understanding-puid-and-pgid
I also made some changes to the entrypoint script. Can you try setting those variables, pulling/building the latest
:devimage, and running it again?@mAAdhaTTah commented on GitHub (Oct 30, 2023):
@pirate
devimage isn't building, was last published 11 days ago.@p0n1 commented on GitHub (Oct 31, 2023):
Thanks for replying. @pirate I just deployed a new instance for testing again. I set the
PUIDandGUIDas999which is the same as the host. I got the same error I posted before.Just as @mAAdhaTTah raised, maybe I'm not using the latest
devimage you mentioned.@pirate commented on GitHub (Nov 1, 2023):
My apologies, just fixed the build and just pushed
dev, (aka0.7.0, akalatest) foramd64,arm64, andarm/v7(run./bin/build_docker.shto build these yourself).>./2instead of>&2--mount=type=cache...)amd64,arm64,arm/v7and updated Dockerfile and./bin/build_docker.shwith latest config andPDMpackage manager./data, should prevent unecessarychowns and remove the need to passPUID/PGIDexplicitly in many casespython:3.11-bookworm-slimwithbookworm-backports,node v21,yt-dlp 2023.10.13,chrome v119, and all otherapt,pip, andnpmdependency versions upgraded/VERSION.txtfile containing build summary, check it on your platform for lots of juicy details about what version you're runninghttps://hub.docker.com/layers/archivebox/archivebox/dev/images/sha256-afa301d566a01cab8934aa1141b5f6133a4585ee5b449304c659c765e240575d?context=explore
@p0n1 commented on GitHub (Nov 1, 2023):
Thanks for the update @pirate. I just tested the latest
devtag withPUID=1000andPGID=1000. Everything works now.I also figured out why many permission errors for my case and even can't start a new container instance when I mount the NFS folder filled with archivebox archives.
It relates with the following code.
github.com/ArchiveBox/ArchiveBox@c6e5a565c0/bin/docker_entrypoint.sh (L21-L27)This script couldn't write into
/datafolder withrootuser for NFS folders. After I setmapallfield in NFS share to the the original owner user in the host machine, this check will pass.ref:
mapallin https://man.freebsd.org/cgi/man.cgi?exports(5).