Skip to content

fix(macOS): declare NSLocalNetworkUsageDescription for the File Provider extensions - #11116

Open
Raspunt wants to merge 1 commit into
nextcloud:masterfrom
Raspunt:fix/fileprovider-local-network-usage-description
Open

Raspunt wants to merge 1 commit into
nextcloud:masterfrom
Raspunt:fix/fileprovider-local-network-usage-description

Conversation

@Raspunt

@Raspunt Raspunt commented Oct 24, 2026 •

Copy link
Copy Markdown

While I was setting up my home server, I ran into a bug caused by macOS's
networking rules and couldn't properly use my cloud. I went through the code
with Claude Code, and it managed to track down the bug. I built the client
with a temporary dev certificate and everything worked, so I decided to share.

image

Resolves

#10996

Summary

On macOS the File Provider extension can't reach a Nextcloud server on the
local network — the logs show "Local network prohibited" and
NSURLErrorDomain -1009, and Finder shows "Signed out" — even though the main
app connects fine and Local Network access is granted to it.

The extension bundles don't declare NSLocalNetworkUsageDescription, while the
main app bundle (cmake/modules/MacOSXBundleInfo.plist.in) already does. Since
macOS 15 the Local Network privacy permission is attributed per executable, so
the grant given to the main app doesn't cover the extension, and its
connections to a LAN address get blocked.

This PR adds NSLocalNetworkUsageDescription to both extension Info.plist
files (FileProviderExt and FileProviderUIExt).

Testing

  • Built the client with mac-crafter and signed it with a temporary (free)
    Apple Development certificate
  • Installed on macOS 27.0.1, added an account on a LAN server
    (https://nextcloud.home, split DNS)
  • The File Provider now enumerates files in Finder; 0 "Local network
    prohibited" entries in the logs (previously hundreds)

Note: verified on my own setup with the key present; I did not run a controlled
build without the key. (The issue suggested adding this key as "a cheap first
experiment".)

Checklist

  • Sign-off message is added to all commits
  • The commit messages follow the Conventional Commits specification
  • The commit history is clean with no merge commits
  • Uploaded screenshots (Finder screenshot of the working File Provider)
  • Documentation has been updated or is not required

AI (if applicable)

  • The content of this PR was partly or fully generated using AI
    • I have read the guidelines for AI-assisted contributions
    • I have read Nextcloud's AI Contribution Policy

…der extensions

The File Provider extension and its UI extension open connections to the
Nextcloud server themselves, but unlike the main app bundle
(cmake/modules/MacOSXBundleInfo.plist.in) their Info.plist files did not
declare NSLocalNetworkUsageDescription. On macOS 15+ the Local Network
privacy restriction is attributed per executable, so a server on the LAN
is blocked for the extension ("Local network prohibited",
NSURLErrorDomain -1009) even when the main app has already been granted
Local Network access.

Declare the usage-description string in both extension bundles so macOS
can attribute and request Local Network access for the extensions
themselves.

Refs: nextcloud#10996

Assisted-by: Claude Code:claude-opus-4-8
Signed-off-by: Raspunt <67462620+Raspunt@users.noreply.github.com>
@Raspunt
Raspunt force-pushed the fix/fileprovider-local-network-usage-description branch from 060c1c4 to eb62933 Compare October 24, 2026 15:12

@claucambra claucambra left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting... Apple explicitly says to put NSLocalNetworkUsageDescription the containing app’s Info.plist, not the extension’s. Extensions generally share their containing app’s Local Network permission. Apple TN3179

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants