mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2026-04-25 17:16:00 +03:00
[PR #1147] [MERGED] Set /app permissions in the Dockerfile #1326
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#1326
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?
📋 Pull Request Information
Original PR: https://github.com/ArchiveBox/ArchiveBox/pull/1147
Author: @mrled
Created: 5/6/2023
Status: ✅ Merged
Merged: 5/6/2023
Merged by: @pirate
Base:
dev← Head:set-app-permissions-dockerfile📝 Commits (1)
3edb319Set /app permissions in the Dockerfile📊 Changes
2 files changed (+2 additions, -1 deletions)
View changed files
📝
Dockerfile(+1 -1)📝
README.md(+1 -0)📄 Description
Set /app permissions in the Dockerfile, and add a note in readme to be careful of permissions with --reload.
Summary
Under some conditions, building the Docker image will fail trying to run
archivebox versionbecause the user in Docker doesn't have permission to access the archivebox code which has been copied to/appin the container. This can happen if, for instance, you clone the git repo with a umask of 077 -- the user running in the container likely does not match the host user's UID, so the archivebox code is not readable.This results in hard-to-understand errors like
This PR changes ownership and permissions after copying the code to
/app, which mostly solves this issue. I checked thearchivebox/archivebox:devcontainer and found thatrootowned the files under/app, so that's what I did explicitly here. (Maybe CI is doing that automatically for the container pushed to Dockerhub?)One development case where it might still cause problems is if you have a restrictive umask and create a file after the server is started with the
--reloadargument. I add a note to the readme to be careful with permissions in that case.Related issues
Fixes #978
In my testing, the only thing I needed was the permissions fix. (Like the reporter of that issue, my default umask is 077 and I ran into this myself.) I didn't need their change to
$PATH.Questions before merging
rootthe proper owner, and022the proper umask, for all files under/app?$PATHfrom #978 ?Changes these areas
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.