Comments (8)
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.
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.
This thread on Stack Overflow looks relevant: https://stackoverflow.com/questions/58481610/proper-entitlements-to-automatically-open-directory-on-macos
from datasette-app.
Also useful: https://developapa.com/security-scoped-bookmark/
from datasette-app.
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.
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.
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.
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)
- Create `brew install --cask datasette-app` for macOS HOT 1
- Publish ("export") to web with authentication and metadata (minimum feature set) HOT 4
- Can't "go back" after choosing view as JSON or CSV and saving/storing queries in underlying SQLite
- Allow for load / open of data from URL where CSV (or JSON?) is compressed
- Allow handling of larger CSV files e.g. CFPB complaints data HOT 1
- Switch to Playwright for automated tests HOT 28
- Failing to render in retina resolution when running on my MacBook Pro (macOS Catalina) HOT 1
- Research faster launch times
- Mechanism for plugins that need a specific DB HOT 3
- "Loading..." hangs on launch after parsing "tag_name" in a plugin HOT 6
- npm test is failing HOT 2
- All sorts of features not working due to bad HTTP requests HOT 9
- London Fire Brigade demo breaks HOT 7
- Import CSV from URL should show errors
- New Playwright tests should exercise key features
- Ability to use templates
- The icon looks blurry in the alt-tab window
- Loading... hangs on launch with packaging.version.InvalidVersion HOT 6
- "About Datasette" button fails to open information window HOT 2
- Unable to load preload script HOT 14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from datasette-app.