diff --git a/scripts/system/libreportal-ownership b/scripts/system/libreportal-ownership index 6fcce7a..90534f9 100644 --- a/scripts/system/libreportal-ownership +++ b/scripts/system/libreportal-ownership @@ -136,7 +136,16 @@ _webui_bind_access() { secret_dir() { local mode cowner; mode="$(_mode)"; cowner="$(_container_owner "$mode")" local parent="$WEBUI_DIR/frontend/data" - [[ -d "$parent" ]] || { echo "libreportal-ownership: no WebUI data dir at $parent" >&2; return 1; } + # Create the parent rather than requiring it. The install reconciles WebUI + # ownership before the container has made frontend/data, so demanding it + # already exist meant this returned 1 there and the drop was simply absent + # on a fresh install — silently, since the caller has no reason to check. + # Ownership is only set when we are the ones creating it; an existing + # directory belongs to the container and is left exactly as it is. + if [[ ! -d "$parent" ]]; then + mkdir -p -- "$parent" || return 1 + chown "$cowner:$cowner" -- "$parent" || return 1 + fi local d="$parent/.secrets" mkdir -p -- "$d" || return 1 chown "$cowner:$MANAGER" -- "$d" || return 1