Keep setup config parent user-writable

This commit is contained in:
Nick Sweeting 2026-08-01 05:02:19 -07:00
parent cbc25320dd
commit 83ee111dcc
No known key found for this signature in database
2 changed files with 4 additions and 3 deletions

View File

@ -26,8 +26,9 @@ def test_setup_script_never_recursively_chowns_collection_data():
def test_setup_script_gives_archivebox_user_ownership_of_runtime_parent_dirs():
script = SETUP_SCRIPT.read_text()
assert 'for path in "$HOME/.local" "$HOME/.local/share" "$HOME/.cache" "$HOME/.cache/archivebox"; do' in script
assert 'for path in "$HOME/.local" "$HOME/.local/share" "$HOME/.cache" "$HOME/.cache/archivebox" "$HOME/.config"; do' in script
assert 'chown "$ARCHIVEBOX_SYSTEM_UID:$ARCHIVEBOX_SYSTEM_GID" "$path"' in script
assert '"$HOME/.config/uv"' in script
def test_setup_script_bootstraps_locked_abxpkg_version():

View File

@ -103,13 +103,13 @@ fix_root_install_ownership() {
fi
# Keep shared runtime parents writable after ArchiveBox drops privileges.
for path in "$HOME/.local" "$HOME/.local/share" "$HOME/.cache" "$HOME/.cache/archivebox"; do
for path in "$HOME/.local" "$HOME/.local/share" "$HOME/.cache" "$HOME/.cache/archivebox" "$HOME/.config"; do
if [ -e "$path" ]; then
chown "$ARCHIVEBOX_SYSTEM_UID:$ARCHIVEBOX_SYSTEM_GID" "$path"
fi
done
for path in "$HOME/.local/bin" "$HOME/.local/share/uv" "$HOME/.cache/uv" "$ABXPKG_LIB_DIR"; do
for path in "$HOME/.local/bin" "$HOME/.local/share/uv" "$HOME/.cache/uv" "$HOME/.config/uv" "$ABXPKG_LIB_DIR"; do
if [ -e "$path" ]; then
chown -R "$ARCHIVEBOX_SYSTEM_UID:$ARCHIVEBOX_SYSTEM_GID" "$path"
fi