Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

notification center support for tcpblock

NotificationsYou must be signed in to change notification settings

sakoula/tcpblock-notify

Repository files navigation

adds notification center support totcpblock.

Description

tcpblock-notify adds notification center support to tcpblock application firewall.

It has been tested successfully in Mac OS X 10.9 Mavericks.

Requirements

terminal notifier

terminal notifier is required. You can either install it manually or viabrew (brew is the preferred way)

tcpblock configuration

tcpblock should be configured using:

  • Enabled
  • Log blocked connections
  • using "White List"

Check the following screenshot:alt tag

Install

There are two ways

Install with installer

Download from thereleases section.

Make sure that you have installed terminal-notifer and you have located the binary. Based on the method you have used to install terminal-notifier (brew, gem or released) the location of the binary may differ. Examples include:

  • /Applications/terminal-notifier.app/Contents/MacOS/terminal-notifier
  • /usr/local/bin/terminal-notifier

Install it using:

$ unzip tcpblock-notify-0.2.zip$ cd tcpblock-notify-0.2$ ./install-tcpblock-notify.sh "/Applications/terminal-notifier.app/Contents/MacOS/terminal-notifier"copying binary to /home/psebos/.tcpblock-notify ...doneautomating startup ...doneinstallation completed!you can start tcpblock-notify byrebootingorlaunchctl load /home/psebos/Library/LaunchAgents/com.sakoula.tcpblock-notify.plistthxsakoula

Install manually

Download from thereleases section. Install it using:

$ terminalnotifier="LOCATION OF THE TERMINAL NOTIFIER BINARY"$ unzip tcpblock-notify-0.2.zip$ cd tcpblock-notify-0.2# copying binary to ${HOME}/.tcpblock-notify ..$ mkdir -p ${HOME}/.tcpblock-notify$ cat tcpblock-notify.sh | sed "s#/usr/local/bin/terminal-notifier#\"${terminalnotifier}\"#" > ${HOME}/.tcpblock-notify/tcpblock-notify.sh$ cp tcpblock-notify.sh ${HOME}/.tcpblock-notify$ chmod 755 ${HOME}/.tcpblock-notify/tcpblock-notify.sh$# loading tcpblock-notify on startup ..$ mkdir -p $HOME/Library/LaunchAgents/$ cat com.sakoula.tcpblock-notify.plist | sed "s#<string>tcpblock-notify.sh</string>#<string>$HOME/.tcpblock-notify/tcpblock-notify.sh</string>#" > ${HOME}/Library/LaunchAgents/com.sakoula.tcpblock-notify.plist$ chmod 644 ${HOME}/Library/LaunchAgents/com.sakoula.tcpblock-notify.plist$# start the tcpblock-notify with the commandlaunchctl load ${HOME}/Library/LaunchAgents/com.sakoula.tcpblock-notify.plist

Uninstall

Uninstall with uninstaller

If used the installer for installation use the uninstaller which is included inside the installation packagereleases section:

$ unzip tcpblock-notify-0.2.zip$ cd tcpblock-notify-0.2$ ./uninstall-tcpblock-notify.sh

Uninstall manually

$# deleting ${HOME}/.tcpblock-notify ..$ /bin/rm -r ${HOME}/.tcpblock-notify/tcpblock-notify.sh$# stopping ${HOME}/Library/LaunchAgents/com.sakoula.tcpblock-notify.plist$ launchctl unload ${HOME}/Library/LaunchAgents/com.sakoula.tcpblock-notify.plist$# deleting ${HOME}/Library/LaunchAgents/com.sakoula.tcpblock-notify.plist$ /bin/rm -r ${HOME}/Library/LaunchAgents/com.sakoula.tcpblock-notify.plistecho ".done"

Usage

when an application will be block you will presented with a notification message:

alt tag

click on it and you will presented with the local user password in order to add it to the exception list:

alt tag

Behind the scenes

The code is very simple. It continuously monitors the syslog (/var/log/system.log) where tcpblock is logging to. If it finds an entry from tcpblock it parses the entry, figures out the blocked application and it used the following command to add it to the exception list:

$ sudo tcpblock -a application_name

Troubleshooting

Make sure that terminal-notifier works. Locate the binary and run from the command line

$"/Applications/terminal-notifier.app/Contents/MacOS/terminal-notifier" -message "This is a test"or$"/usr/local/bin/terminal-notifier" -message "This is a test"depending on the terminal-notifier binary

License

All the works are available under the MIT license.

Copyright (c) 2013psebos@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS INTHE SOFTWARE.

About

notification center support for tcpblock

Resources

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp