Coder Social home page Coder Social logo

Comments (8)

simonw avatar simonw commented on May 29, 2024

Got some tips from https://twitter.com/Matsubue/status/1432881158237212672:

I would have thought, on a mac, you would use the sandbox dir for its venv instead of sticking it in ~/ (using the sandbox dir for the app should also require fewer privilege requests)

Yeah, such a generic term. You can probably google search it better than me but the key phrase has to do with “entitlements.” Looks like there are some guidelines for how to do it with electron apps.

from datasette-app.

simonw avatar simonw commented on May 29, 2024

This bit of the Electron documentation talks about the kind of sandbox I am interested in here: https://www.electronjs.org/docs/tutorial/mac-app-store-submission-guide#enable-apples-app-sandbox

It says "Apps submitted to the Mac App Store must run under Apple's App Sandbox" - but presumably I can use the sandbox even for apps that I'm not distributing through the app store?

from datasette-app.

simonw avatar simonw commented on May 29, 2024

This thread on Stack Overflow looks relevant: https://stackoverflow.com/questions/58481610/proper-entitlements-to-automatically-open-directory-on-macos

from datasette-app.

simonw avatar simonw commented on May 29, 2024

Also useful: https://developapa.com/security-scoped-bookmark/

from datasette-app.

simonw avatar simonw commented on May 29, 2024

Apple documentation: https://developer.apple.com/library/archive/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html

These three concepts look particularly relevant:

  • Entitlements. Communicate to macOS the specific system resources your app needs to get its job done, and no more.
  • Containers. Access only the files and directories considered safe for your app.
  • Persistent Resource Access. Retain security-scoped bookmarks across launches of your app to any additional files to which the user has specifically granted your app access.

from datasette-app.

simonw avatar simonw commented on May 29, 2024

Trying to figure out where the sandbox folder for my app is. https://stackoverflow.com/a/26237331/6083 suggests:

The sandbox path is mapped to:

~/Library/Containers/app-bundle-id/Data/

and is accessed from the sandboxed app using the NSSearchPathForDirectoriesInDomains() Foundation function

from datasette-app.

simonw avatar simonw commented on May 29, 2024

These docs are particularly useful: https://developer.apple.com/library/archive/documentation/Miscellaneous/Reference/EntitlementKeyReference/Chapters/EnablingAppSandbox.html

com.apple.security.inherit - "Child process inheritance of the parent’s sandbox"

from datasette-app.

simonw avatar simonw commented on May 29, 2024

I did some experiments and it looks like the packaged app can currently read any file that the user has access to... with the exception of files in the Desktop and Documents folders (and a few other similar ones).

The first time my test plugin attempted to access a file in Documents I got a system prompt asking if the Datasette app should be allowed to access files in that folder.

from datasette-app.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.