Handle macOS root setup paths

This commit is contained in:
Nick Sweeting 2026-08-01 04:03:14 -07:00
parent 5fc318de38
commit de75fc83d8
No known key found for this signature in database
2 changed files with 4 additions and 1 deletions

View File

@ -12,6 +12,8 @@ def test_setup_script_creates_archivebox_user_instead_of_rejecting_root():
assert "You cannot run this script as root" not in script
assert "useradd --system --create-home" in script
assert 'ARCHIVEBOX_SYSTEM_USER="archivebox"' in script
assert "${BOOTSTRAP_UV_BINARY#/var/root/}" in script
assert "mkdir -p /usr/local/bin" in script
def test_setup_script_never_recursively_chowns_collection_data():

View File

@ -211,7 +211,7 @@ ensure_uv() {
if command -v uv > /dev/null 2>&1; then
BOOTSTRAP_UV_BINARY="$(command -v uv)"
if [ "$RUNNING_AS_ROOT" = "true" ] && [ "${BOOTSTRAP_UV_BINARY#/root/}" != "$BOOTSTRAP_UV_BINARY" ]; then
if [ "$RUNNING_AS_ROOT" = "true" ] && { [ "${BOOTSTRAP_UV_BINARY#/root/}" != "$BOOTSTRAP_UV_BINARY" ] || [ "${BOOTSTRAP_UV_BINARY#/var/root/}" != "$BOOTSTRAP_UV_BINARY" ]; }; then
mkdir -p "$HOME/.local/bin"
install -m 0755 "$BOOTSTRAP_UV_BINARY" "$HOME/.local/bin/uv"
if command -v uvx >/dev/null 2>&1; then
@ -305,6 +305,7 @@ install_archivebox_with_uv() {
fi
fix_root_install_ownership
if [ "$RUNNING_AS_ROOT" = "true" ]; then
mkdir -p /usr/local/bin
ln -sf "$ARCHIVEBOX_BINARY" /usr/local/bin/archivebox
ARCHIVEBOX_BINARY="/usr/local/bin/archivebox"
fi