-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
tools: add macosx-firewall script to avoid popups #10114
Changes from 1 commit
7a5201d
c39bf95
d255df9
e546655
4f29ee5
46ad909
cef43de
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
# Script that adds rules to Mac OS X Socket Firewall to avoid | ||
# popups asking to accept incoming network connections when | ||
# running tests. | ||
SFW="/usr/libexec/ApplicationFirewall/socketfilterfw" | ||
TOOLSDIR="`dirname \"$0\"`" | ||
TOOLSDIR="`( cd \"$TOOLSDIR\" && pwd) `" | ||
ROOTDIR="`( cd \"$TOOLSDIR/..\" && pwd) `" | ||
OUTDIR=$TOOLSDIR/../out | ||
OUTDIR="`( cd \"$OUTDIR\" && pwd) `" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the cd + pwd to ensure the directory exists? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is really so that the path added is the full path without the Application at path ( /Users/danielbevenius/work/nodejs/node/tools/../out/Debug/node ) added to firewall But the entry when running There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add a comment explaining the use of pwd (what you wrote in your comment earlier)? |
||
NODE_RELEASE=$OUTDIR/Release/node | ||
NODE_DEBUG=$OUTDIR/Debug/node | ||
NODE_LINK=$ROOTDIR/node | ||
|
||
if [ -f $SFW ]; | ||
then | ||
# Duplicating these commands on purpose as the symbolic link node might be | ||
# linked to either out/Debug/node or out/Release/node depending on the | ||
# BUILDTYPE. | ||
$SFW --remove $NODE_DEBUG | ||
$SFW --remove $NODE_DEBUG | ||
$SFW --remove $NODE_RELEASE | ||
$SFW --remove $NODE_RELEASE | ||
$SFW --remove $NODE_LINK | ||
|
||
$SFW --add $NODE_DEBUG | ||
$SFW --add $NODE_RELEASE | ||
$SFW --add $NODE_LINK | ||
|
||
$SFW --unblock $NODE_DEBUG | ||
$SFW --unblock $NODE_RELEASE | ||
$SFW --unblock $NODE_LINK | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you wrap the env vars in quotes? This won't work if the paths have spaces in them. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will do, thanks |
||
else | ||
echo "SocketFirewall not found in location: $SFW" | ||
fi |
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.
Long line.