-
-
Notifications
You must be signed in to change notification settings - Fork 37
Add additional environment variables #97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Seems like a reasonable idea. My only suggestion is to be more consistent with the Python standard library by using the name |
|
I have renamed I also asked myself whether it makes sense to transfer the main module via |
There is - and it's related to what I've been saying on the Briefcase If the BRIEFCASE_MAIN_MODULE is exposed as an environment variable, then the behavior is controllable by the end user (or, controllable by the end-user's environment). That means an end user can set that environment and get the behavior - or, an attacker can exploit that behavior as a vector for an attack. In this case, an attacker would gain the ability to execute code that would run with the privileges of the main app. By using a configuration file that has to be shipped (and signed) with the app bundle, that attack vector is reduced (if not eliminated). I recognise that this is an inconsistency between the Linux, macOS and Windows stub apps, as they currently use environment variables. However, if we're making changes in this area, my inclination would be to move those platforms away from using environment variables. This would be trivial for the macOS case (we can use the same info.plist trick as iOS); Windows and Linux might be a little more difficult as there's no obvious file metadata that can be attached. |
|
Okay, I understand the security concerns for the But nevertheless this is a useful feature to support the remote debugger. So I will remove the draft status. Are there tests for this required in the |
Ideally, yes - there would be a test (for both environment and argv handling) - but no, there isn't one at present (for either argv or environment handling). Such a test is going to be a bit unstable, as it will require the environment invoking the test to use specific environment markers and command line arguments. If you're able to make something work, it would be great to add a test for that behavior; but if a test doesn't fall out reasonably easily, I'd be happy to open a ticket on the testbed repo and leave it at that. |
…at it is available at python startup while processing the .pth files
50d7508 to
271212d
Compare
|
I have not found an easy solution for testing, probably because I'm not that deep into the testbed yet. So I created a ticket. |
mhsmith
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a pain to test because of multiple layers of shells and quoting, but it looks like it works fine.
This PR allows briefcase to pass environment variables to the app via
org.beeware.ENV, which are added insys.environ.The feature can be used, for example, to configure a remote debugger (see beeware/briefcase#2173). The use of
org.beeware.ARGVfor this purpose is not optimal, as ARGV should pass arguments from the user and briefcase parameters should not influence them.It is not yet clear whether the environment variables should really be used for the remote debugger. This only makes sense if it is possible on all platforms. The tests on iOS are still pending, so this PR is marked as a draft for now.
PR Checklist: