You can subscribe to this list here.
2012 |
Jan
|
Feb
|
Mar
|
Apr
(24) |
May
(35) |
Jun
(5) |
Jul
(8) |
Aug
|
Sep
|
Oct
(7) |
Nov
(3) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(4) |
Jun
(7) |
Jul
(4) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
(2) |
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
(1) |
Feb
(3) |
Mar
(7) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
(4) |
Oct
(4) |
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
(2) |
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <dus...@us...> - 2012-05-05 16:26:58
|
Revision: 295 http://responsibility.svn.sourceforge.net/responsibility/?rev=295&view=rev Author: dustsource Date: 2012-05-05 15:03:50 +0000 (Sat, 05 May 2012) Log Message: ----------- Updated "Arch Linux" section of "Install from Packages" guide. (Also testing process for uploading documentation to website.) Modified Paths: -------------- documentation/doc/net-responsibility-3.0.2-doc.zip Modified: documentation/doc/net-responsibility-3.0.2-doc.zip =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dus...@us...> - 2012-05-05 16:26:52
|
Revision: 294 http://responsibility.svn.sourceforge.net/responsibility/?rev=294&view=rev Author: dustsource Date: 2012-05-05 14:51:21 +0000 (Sat, 05 May 2012) Log Message: ----------- Updated "Arch Linux" section of "Install from Packages" guide. Modified Paths: -------------- documentation/pages/0304-InstallFromPackages.page Modified: documentation/pages/0304-InstallFromPackages.page =================================================================== --- documentation/pages/0304-InstallFromPackages.page 2012-05-04 09:33:40 UTC (rev 293) +++ documentation/pages/0304-InstallFromPackages.page 2012-05-05 14:51:21 UTC (rev 294) @@ -45,16 +45,22 @@ Otherwise simply follow these instructions: -1. [[https://aur.archlinux.org/packages/ne/net-responsibility/net-responsibility.tar.gz Download]] the package and extract it. +1. [[https://aur.archlinux.org/packages/ne/net-responsibility/net-responsibility.tar.gz Download the tarball]] (archived file) and extract/unpack it to the folder/directory of your choice. -2. Open a terminal and use <*cd*> to go to the extracted folder. +2. Open a terminal window and use the <*cd*> command to go to the extracted folder. Example: If you put the extracted contents into the folder <*/my/arch/nr*> then you would use the following command: -3. Run <*makepkg -s*> + cd /my/arch/nr -4. Run <*sudo pacman -U ./net-responsibility-<? PocoDoc.version ?>-2-[ i386 or x86_64 ].pkg.tar.xz*> +3. Once you're in the folder, run this command: -(Note that you'll need to edit the portion of the above command that is in [brackets] in order to specify whether your architecture is i386 or x86_64.) + makepkg -s +4. Then run this command: + + sudo pacman -U ./net-responsibility-3.0.1-3-[ i386 or x86_64 ].pkg.tar.xz + +(Note that you'll need to replace the [bracketed] portion of the above command with either i386 or x86_64 in order to specify what your system's architecture is.) + For more information regarding installation of packages in Arch Linux, [[https://wiki.archlinux.org/index.php/AUR#Installing_packages look here]]. !!!Debian-based distributions (distros) other than Ubuntu This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rog...@us...> - 2012-05-04 09:33:47
|
Revision: 293 http://responsibility.svn.sourceforge.net/responsibility/?rev=293&view=rev Author: roggan87 Date: 2012-05-04 09:33:40 +0000 (Fri, 04 May 2012) Log Message: ----------- Now the subscription links for the mailing lists are working properly. Modified Paths: -------------- documentation/pages/0903-ContributeToNR.page Added Paths: ----------- documentation/doc/net-responsibility-3.0.2-doc.zip Added: documentation/doc/net-responsibility-3.0.2-doc.zip =================================================================== (Binary files differ) Property changes on: documentation/doc/net-responsibility-3.0.2-doc.zip ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: documentation/pages/0903-ContributeToNR.page =================================================================== --- documentation/pages/0903-ContributeToNR.page 2012-05-04 08:05:17 UTC (rev 292) +++ documentation/pages/0903-ContributeToNR.page 2012-05-04 09:33:40 UTC (rev 293) @@ -66,24 +66,24 @@ !!Mailing lists -[[https://lists.sourceforge.net/lists/listinfo/responsibility-devel -re...@li...]]. +<*res...@li...*>. This list will be used for all major discussion about Net Responsibility development. Before making definite decisions, we'll post them to the mailing list so everyone can have their word about it. Note that you don't have to be an active contributor to the project to be a subscriber of this mailing list. By subscribing, you will be able to follow the process anyway, and maybe come with other opinions from time to time. +[[https://lists.sourceforge.net/lists/listinfo/responsibility-devel Subscribe here]]. -[[https://lists.sourceforge.net/lists/listinfo/responsibility-commit -re...@li...]]. +<*res...@li...*>. Whenever someone is making a commit to our SVN repository, a "commit mail" will be sent to this list. It'll include the log message and the diff. This is also an excellent way to keep updated and see what changes are made to the code. It's also helping us spot bugs or come with alternative suggestions faster. Even if you don't understand the diffs, you'll be able to follow the log messages, and by doing so understand what changes/bug -fixes are implemented in the code. +fixes are implemented in the code. +[[https://lists.sourceforge.net/lists/listinfo/responsibility-commit Subscribe here]]. !!Running the latest versions This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rog...@us...> - 2012-05-04 08:05:28
|
Revision: 292 http://responsibility.svn.sourceforge.net/responsibility/?rev=292&view=rev Author: roggan87 Date: 2012-05-04 08:05:17 +0000 (Fri, 04 May 2012) Log Message: ----------- Don't ask for the user to press Enter when not in standalone mode. Modified Paths: -------------- utils/check-nr/check-nr.sh utils/check-nr/check-nr.tar.gz Modified: utils/check-nr/check-nr.sh =================================================================== --- utils/check-nr/check-nr.sh 2012-05-04 07:22:11 UTC (rev 291) +++ utils/check-nr/check-nr.sh 2012-05-04 08:05:17 UTC (rev 292) @@ -9,8 +9,7 @@ # Function to quit the script in a nice way function quit { - echo "Please press [Enter] to quit" - [ "$STANDALONE" == "1" ] && read + [ "$STANDALONE" == "1" ] && { echo "Please press [Enter] to quit"; read; } exit $1 } @@ -38,11 +37,13 @@ [ "$?" == "0" ] || not_running # Send a few HTTP requests to make sure NR is not shutting down -wget -O /tmp/nr_ping.txt --timeout=2 http://www.netresponsibility.com/request/ping.php &>/dev/null +URL=http://www.netresponsibility.com/request/ping.php +TMP_FILE=/tmp/nr-ping.txt +wget -O $TMP_FILE --timeout=2 $URL &>/dev/null [ "$?" == "0" ] || echo "HTTP request failed, retrying. (Maybe there's no internet connection?)" -wget -O /tmp/nr_ping.txt --timeout=7 http://www.netresponsibility.com/request/ping.php &>/dev/null +wget -O $TMP_FILE --timeout=7 $URL &>/dev/null [ "$?" == "0" ] || no_internet -rm /tmp/nr_ping.txt +rm $TMP_FILE # Check if the instance is still running kill -n 0 $PID Modified: utils/check-nr/check-nr.tar.gz =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rog...@us...> - 2012-05-04 07:22:22
|
Revision: 291 http://responsibility.svn.sourceforge.net/responsibility/?rev=291&view=rev Author: roggan87 Date: 2012-05-04 07:22:11 +0000 (Fri, 04 May 2012) Log Message: ----------- Added a --standalone option if one is running the script outside a terminal. Modified Paths: -------------- utils/check-nr/check-nr.sh utils/check-nr/check-nr.tar.gz Modified: utils/check-nr/check-nr.sh =================================================================== --- utils/check-nr/check-nr.sh 2012-05-04 06:03:00 UTC (rev 290) +++ utils/check-nr/check-nr.sh 2012-05-04 07:22:11 UTC (rev 291) @@ -4,10 +4,20 @@ # you'll need to specify your custom path in the following line. PIDFILE=/var/run/net-responsibility.pid +# Is the script launched as a standalone program? +[ "$1" == "--standalone" ] && STANDALONE=1 + +# Function to quit the script in a nice way +function quit { + echo "Please press [Enter] to quit" + [ "$STANDALONE" == "1" ] && read + exit $1 +} + # Function if NR is not running function not_running { echo "Net Responsibility is NOT running!" - exit 1 + quit 1 } # Function there's no Internet connection @@ -16,7 +26,7 @@ echo "could not be run because you don't seem to have internet access. Please" echo "run this command again when you have internet access in order to be" echo "sure the program is running properly." - exit 0 + quit 0 } # Check if the pidfile exists @@ -43,3 +53,4 @@ # Passed all test, it's running! echo "Net Responsibility seems to be up and running" +quit 0 Modified: utils/check-nr/check-nr.tar.gz =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rog...@us...> - 2012-05-04 06:03:08
|
Revision: 290 http://responsibility.svn.sourceforge.net/responsibility/?rev=290&view=rev Author: roggan87 Date: 2012-05-04 06:03:00 +0000 (Fri, 04 May 2012) Log Message: ----------- Internet connection is not needed but preferred. Makes sure the process found actually is net-responsibility. Modified Paths: -------------- utils/check-nr/check-nr.sh utils/check-nr/check-nr.tar.gz Modified: utils/check-nr/check-nr.sh =================================================================== --- utils/check-nr/check-nr.sh 2012-05-03 14:02:44 UTC (rev 289) +++ utils/check-nr/check-nr.sh 2012-05-04 06:03:00 UTC (rev 290) @@ -10,6 +10,15 @@ exit 1 } +# Function there's no Internet connection +function no_internet { + echo "Net Responsibility seems to be up and running, but part of the test" + echo "could not be run because you don't seem to have internet access. Please" + echo "run this command again when you have internet access in order to be" + echo "sure the program is running properly." + exit 0 +} + # Check if the pidfile exists [ -f $PIDFILE ] || not_running @@ -20,14 +29,17 @@ # Send a few HTTP requests to make sure NR is not shutting down wget -O /tmp/nr_ping.txt --timeout=2 http://www.netresponsibility.com/request/ping.php &>/dev/null -[ "$?" == "0" ] || echo "HTTP request failed, retying. (Maybe there's no internet connection?)" +[ "$?" == "0" ] || echo "HTTP request failed, retrying. (Maybe there's no internet connection?)" wget -O /tmp/nr_ping.txt --timeout=7 http://www.netresponsibility.com/request/ping.php &>/dev/null -[ "$?" == "0" ] || { echo "Sorry, need internet access to determine if Net Responsibility is running..."; exit 1; } +[ "$?" == "0" ] || no_internet rm /tmp/nr_ping.txt # Check if the instance is still running kill -n 0 $PID [ "$?" == "0" ] || not_running +# Make sure the instance is really net-responsibility +[[ $(ps -p $PID -o args=) == net-responsibility* ]] || not_running + # Passed all test, it's running! echo "Net Responsibility seems to be up and running" Modified: utils/check-nr/check-nr.tar.gz =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rog...@us...> - 2012-05-03 14:02:55
|
Revision: 289 http://responsibility.svn.sourceforge.net/responsibility/?rev=289&view=rev Author: roggan87 Date: 2012-05-03 14:02:44 +0000 (Thu, 03 May 2012) Log Message: ----------- Added some functionality if no Internet connection is found. Modified Paths: -------------- utils/check-nr/check-nr.sh utils/check-nr/check-nr.tar.gz Modified: utils/check-nr/check-nr.sh =================================================================== --- utils/check-nr/check-nr.sh 2012-05-02 17:38:10 UTC (rev 288) +++ utils/check-nr/check-nr.sh 2012-05-03 14:02:44 UTC (rev 289) @@ -4,22 +4,30 @@ # you'll need to specify your custom path in the following line. PIDFILE=/var/run/net-responsibility.pid +# Function if NR is not running function not_running { echo "Net Responsibility is NOT running!" exit 1 } +# Check if the pidfile exists [ -f $PIDFILE ] || not_running +# Check if the PID is running PID=$(cat $PIDFILE) &>/dev/null kill -n 0 $PID [ "$?" == "0" ] || not_running -wget -O /tmp/nr_ping.txt http://www.netresponsibility.com/request/ping.php &>/dev/null -wget -O /tmp/nr_ping.txt http://www.netresponsibility.com/request/ping.php &>/dev/null +# Send a few HTTP requests to make sure NR is not shutting down +wget -O /tmp/nr_ping.txt --timeout=2 http://www.netresponsibility.com/request/ping.php &>/dev/null +[ "$?" == "0" ] || echo "HTTP request failed, retying. (Maybe there's no internet connection?)" +wget -O /tmp/nr_ping.txt --timeout=7 http://www.netresponsibility.com/request/ping.php &>/dev/null +[ "$?" == "0" ] || { echo "Sorry, need internet access to determine if Net Responsibility is running..."; exit 1; } rm /tmp/nr_ping.txt +# Check if the instance is still running kill -n 0 $PID [ "$?" == "0" ] || not_running +# Passed all test, it's running! echo "Net Responsibility seems to be up and running" Modified: utils/check-nr/check-nr.tar.gz =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rog...@us...> - 2012-05-02 17:38:17
|
Revision: 288 http://responsibility.svn.sourceforge.net/responsibility/?rev=288&view=rev Author: roggan87 Date: 2012-05-02 17:38:10 +0000 (Wed, 02 May 2012) Log Message: ----------- Added README with some instructions written by Dustin on how to use the script. Modified Paths: -------------- utils/check-nr/check-nr.tar.gz Added Paths: ----------- utils/check-nr/README Added: utils/check-nr/README =================================================================== --- utils/check-nr/README (rev 0) +++ utils/check-nr/README 2012-05-02 17:38:10 UTC (rev 288) @@ -0,0 +1,23 @@ +HOW TO TEST WHETHER NET RESPONSIBILITY IS RUNNING PROPERLY + +You'll need to use the 'cd' command in a terminal window to +go to the folder where you saved the script file. So, if I saved it in +'/my/big/folder' I would enter the following command: + +cd /my/big/folder + +Once you're in the folder where the script file is, then you want to run +the script by entering the following command: + +sudo ./check-nr.sh + +(Note: 'sudo' is the way Ubuntu gives a command root permission. If you +are using a different system, you just need to know that the command +'./check-nr' needs to be run with root permission, however that is handled.) + +If the above command runs successfully, and NR is running properly, then +you should see this output: +Net Responsibility seems to be up and running + +If NR is not running properly, then you should see this output: +Net Responsibility is NOT running! Modified: utils/check-nr/check-nr.tar.gz =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rog...@us...> - 2012-05-02 16:47:58
|
Revision: 287 http://responsibility.svn.sourceforge.net/responsibility/?rev=287&view=rev Author: roggan87 Date: 2012-05-02 16:47:52 +0000 (Wed, 02 May 2012) Log Message: ----------- Testing if the "executive mode" if the script is restored if compressed to a .tar.gz archive. Added Paths: ----------- utils/check-nr/check-nr.tar.gz Added: utils/check-nr/check-nr.tar.gz =================================================================== (Binary files differ) Property changes on: utils/check-nr/check-nr.tar.gz ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rog...@us...> - 2012-05-02 08:48:40
|
Revision: 286 http://responsibility.svn.sourceforge.net/responsibility/?rev=286&view=rev Author: roggan87 Date: 2012-05-02 08:48:34 +0000 (Wed, 02 May 2012) Log Message: ----------- Added the extension .sh just to make sure it's handled properly and downloaded by web browsers rather than simply showing the content. Added Paths: ----------- utils/check-nr/check-nr.sh Removed Paths: ------------- utils/check-nr/check-nr Deleted: utils/check-nr/check-nr =================================================================== --- utils/check-nr/check-nr 2012-05-01 12:49:21 UTC (rev 285) +++ utils/check-nr/check-nr 2012-05-02 08:48:34 UTC (rev 286) @@ -1,25 +0,0 @@ -#!/bin/bash -# This script checks if Net Responsibility if up and running. -# If you're using another path than default for the Net Responsibility pidfile -# you'll need to specify your custom path in the following line. -PIDFILE=/var/run/net-responsibility.pid - -function not_running { - echo "Net Responsibility is NOT running!" - exit 1 -} - -[ -f $PIDFILE ] || not_running - -PID=$(cat $PIDFILE) &>/dev/null -kill -n 0 $PID -[ "$?" == "0" ] || not_running - -wget -O /tmp/nr_ping.txt http://www.netresponsibility.com/request/ping.php &>/dev/null -wget -O /tmp/nr_ping.txt http://www.netresponsibility.com/request/ping.php &>/dev/null -rm /tmp/nr_ping.txt - -kill -n 0 $PID -[ "$?" == "0" ] || not_running - -echo "Net Responsibility seems to be up and running" Copied: utils/check-nr/check-nr.sh (from rev 285, utils/check-nr/check-nr) =================================================================== --- utils/check-nr/check-nr.sh (rev 0) +++ utils/check-nr/check-nr.sh 2012-05-02 08:48:34 UTC (rev 286) @@ -0,0 +1,25 @@ +#!/bin/bash +# This script checks if Net Responsibility if up and running. +# If you're using another path than default for the Net Responsibility pidfile +# you'll need to specify your custom path in the following line. +PIDFILE=/var/run/net-responsibility.pid + +function not_running { + echo "Net Responsibility is NOT running!" + exit 1 +} + +[ -f $PIDFILE ] || not_running + +PID=$(cat $PIDFILE) &>/dev/null +kill -n 0 $PID +[ "$?" == "0" ] || not_running + +wget -O /tmp/nr_ping.txt http://www.netresponsibility.com/request/ping.php &>/dev/null +wget -O /tmp/nr_ping.txt http://www.netresponsibility.com/request/ping.php &>/dev/null +rm /tmp/nr_ping.txt + +kill -n 0 $PID +[ "$?" == "0" ] || not_running + +echo "Net Responsibility seems to be up and running" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rog...@us...> - 2012-05-01 12:49:27
|
Revision: 285 http://responsibility.svn.sourceforge.net/responsibility/?rev=285&view=rev Author: roggan87 Date: 2012-05-01 12:49:21 +0000 (Tue, 01 May 2012) Log Message: ----------- Created a small script that determines if Net Responsibility is up and running. Run the following command as root in the script folder: [sudo] ./check-nr Added Paths: ----------- utils/ utils/check-nr/ utils/check-nr/check-nr Added: utils/check-nr/check-nr =================================================================== --- utils/check-nr/check-nr (rev 0) +++ utils/check-nr/check-nr 2012-05-01 12:49:21 UTC (rev 285) @@ -0,0 +1,25 @@ +#!/bin/bash +# This script checks if Net Responsibility if up and running. +# If you're using another path than default for the Net Responsibility pidfile +# you'll need to specify your custom path in the following line. +PIDFILE=/var/run/net-responsibility.pid + +function not_running { + echo "Net Responsibility is NOT running!" + exit 1 +} + +[ -f $PIDFILE ] || not_running + +PID=$(cat $PIDFILE) &>/dev/null +kill -n 0 $PID +[ "$?" == "0" ] || not_running + +wget -O /tmp/nr_ping.txt http://www.netresponsibility.com/request/ping.php &>/dev/null +wget -O /tmp/nr_ping.txt http://www.netresponsibility.com/request/ping.php &>/dev/null +rm /tmp/nr_ping.txt + +kill -n 0 $PID +[ "$?" == "0" ] || not_running + +echo "Net Responsibility seems to be up and running" Property changes on: utils/check-nr/check-nr ___________________________________________________________________ Added: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rog...@us...> - 2012-04-30 12:00:32
|
Revision: 284 http://responsibility.svn.sourceforge.net/responsibility/?rev=284&view=rev Author: roggan87 Date: 2012-04-30 12:00:24 +0000 (Mon, 30 Apr 2012) Log Message: ----------- Improved version handling in the documentation. From now on, always run "./generate config version". PocoDoc will use the given version when creating the documentation. Inside the pages, when refering to the latest version, always use <? PocoDoc.version ?>. It is also highly recommended to set NR_BASE to a path that includes the variable $NR_VERSION. That ensures that only the source of the given version is accepted. Here are two examples of how to achieve that: export NR_BASE=/home/roggan/net-responsibility/svn/releases/$NR_VERSION export NR_BASE=/home/roggan/net-responsibility/tarballs/net-responsibility-$NR_VERSION The first example is the best one. Simply checkout the "releases" folder of our SVN repo, and use a path similar to the first example. This way you'll always have all versions available, and PocoDoc will always use the one you specified :) Modified Paths: -------------- documentation/cfg/DevDocs.xml documentation/cfg/DevDocsWithoutPoco.xml documentation/cfg/PagesOnly.xml documentation/generate documentation/pages/0304-InstallFromPackages.page Modified: documentation/cfg/DevDocs.xml =================================================================== --- documentation/cfg/DevDocs.xml 2012-04-29 06:52:56 UTC (rev 283) +++ documentation/cfg/DevDocs.xml 2012-04-30 12:00:24 UTC (rev 284) @@ -2,6 +2,7 @@ <PocoBase>${system.env.POCO_BASE}</PocoBase> <NRBase>${system.env.NR_BASE}</NRBase> <DocBase>${system.env.DOC_BASE}</DocBase> + <NRVersion>${system.env.NR_VERSION}</NRVersion> <PocoDoc> <files> <include> @@ -55,7 +56,7 @@ <language>EN</language> <charset>utf-8</charset> <software>Net Responsibility</software> - <version>3.0.1</version> + <version>${NRVersion}</version> <company>Net Responsibility Team</company> <companyURI>http://www.netresponsibility.com/</companyURI> <licenseURI>http://www.gnu.org/licenses/gpl-2.0.html</licenseURI> Modified: documentation/cfg/DevDocsWithoutPoco.xml =================================================================== --- documentation/cfg/DevDocsWithoutPoco.xml 2012-04-29 06:52:56 UTC (rev 283) +++ documentation/cfg/DevDocsWithoutPoco.xml 2012-04-30 12:00:24 UTC (rev 284) @@ -2,6 +2,7 @@ <PocoBase>${system.env.POCO_BASE}</PocoBase> <NRBase>${system.env.NR_BASE}</NRBase> <DocBase>${system.env.DOC_BASE}</DocBase> + <NRVersion>${system.env.NR_VERSION}</NRVersion> <PocoDoc> <files> <include> @@ -31,7 +32,7 @@ <language>EN</language> <charset>utf-8</charset> <software>Net Responsibility</software> - <version>3.0.1</version> + <version>${NRVersion}</version> <company>Net Responsibility Team</company> <companyURI>http://www.netresponsibility.com/</companyURI> <licenseURI>http://www.gnu.org/licenses/gpl-2.0.html</licenseURI> Modified: documentation/cfg/PagesOnly.xml =================================================================== --- documentation/cfg/PagesOnly.xml 2012-04-29 06:52:56 UTC (rev 283) +++ documentation/cfg/PagesOnly.xml 2012-04-30 12:00:24 UTC (rev 284) @@ -2,6 +2,7 @@ <PocoBase>${system.env.POCO_BASE}</PocoBase> <NRBase>${system.env.NR_BASE}</NRBase> <DocBase>${system.env.DOC_BASE}</DocBase> + <NRVersion>${system.env.NR_VERSION}</NRVersion> <PocoDoc> <files> <include> @@ -34,7 +35,7 @@ <language>EN</language> <charset>utf-8</charset> <software>Net Responsibility</software> - <version>3.0.1</version> + <version>${NRVersion}</version> <company>Net Responsibility Team</company> <companyURI>http://www.netresponsibility.com/</companyURI> <licenseURI>http://www.gnu.org/licenses/gpl-2.0.html</licenseURI> Modified: documentation/generate =================================================================== --- documentation/generate 2012-04-29 06:52:56 UTC (rev 283) +++ documentation/generate 2012-04-30 12:00:24 UTC (rev 284) @@ -4,6 +4,11 @@ # Run the script like this to use the config file cfg/DevDocs.xml: # $ ./generate DevDocs +[ $# -lt 2 ] && { echo "Usage: $0 config version"; exit 1; } + +CFG_FILE=$1 +VERSION=$2 + # Configure environment paths if ! [ -f paths.txt ]; then echo "You need to set up the environment paths before generating." @@ -47,10 +52,10 @@ fi # Include the paths +export NR_VERSION=$VERSION source paths.txt if [ "$1" == "zip" ]; then - VERSION=$2 cd $DOC_BASE/doc cp -r ./$VERSION ./net-responsibility-$VERSION-doc find ./net-responsibility-$VERSION-doc -type d -name .svn -print0 | xargs -0 rm -rf @@ -60,7 +65,6 @@ rm -r ./net-responsibility-$VERSION-doc cd .. else - CFG_FILE=$1 PocoDoc --config=$DOC_BASE/cfg/$CFG_FILE.xml fi Modified: documentation/pages/0304-InstallFromPackages.page =================================================================== --- documentation/pages/0304-InstallFromPackages.page 2012-04-29 06:52:56 UTC (rev 283) +++ documentation/pages/0304-InstallFromPackages.page 2012-04-30 12:00:24 UTC (rev 284) @@ -51,7 +51,7 @@ 3. Run <*makepkg -s*> -4. Run <*sudo pacman -U ./net-responsibility-3.0-2-[ i386 or x86_64 ].pkg.tar.xz*> +4. Run <*sudo pacman -U ./net-responsibility-<? PocoDoc.version ?>-2-[ i386 or x86_64 ].pkg.tar.xz*> (Note that you'll need to edit the portion of the above command that is in [brackets] in order to specify whether your architecture is i386 or x86_64.) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rog...@us...> - 2012-04-29 06:53:01
|
Revision: 283 http://responsibility.svn.sourceforge.net/responsibility/?rev=283&view=rev Author: roggan87 Date: 2012-04-29 06:52:56 +0000 (Sun, 29 Apr 2012) Log Message: ----------- Also changed version number to 3.0.2. Modified Paths: -------------- releases/3.0.2/configure.ac Modified: releases/3.0.2/configure.ac =================================================================== --- releases/3.0.2/configure.ac 2012-04-29 06:51:20 UTC (rev 282) +++ releases/3.0.2/configure.ac 2012-04-29 06:52:56 UTC (rev 283) @@ -3,7 +3,7 @@ AC_PREREQ(2.58) LT_PREREQ([2.2]) -AC_INIT([Net Responsibility],[3.0.1],[co...@ne...]) +AC_INIT([Net Responsibility],[3.0.2],[co...@ne...]) AM_INIT_AUTOMAKE([subdir-objects]) LT_INIT([shared]) AC_SUBST([LIBTOOL_DEPS]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rog...@us...> - 2012-04-29 06:51:26
|
Revision: 282 http://responsibility.svn.sourceforge.net/responsibility/?rev=282&view=rev Author: roggan87 Date: 2012-04-29 06:51:20 +0000 (Sun, 29 Apr 2012) Log Message: ----------- Well, 3.0.2 is pretty much the same as 3.0.1, but I made a terrible mistake with 3.0.1. I released the tarball with a different source code than here. Added Paths: ----------- releases/3.0.2/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rog...@us...> - 2012-04-28 10:12:37
|
Revision: 281 http://responsibility.svn.sourceforge.net/responsibility/?rev=281&view=rev Author: roggan87 Date: 2012-04-28 10:12:31 +0000 (Sat, 28 Apr 2012) Log Message: ----------- The first zip archive with Dev Docs. Added Paths: ----------- documentation/doc/net-responsibility-3.0.1-doc.zip Added: documentation/doc/net-responsibility-3.0.1-doc.zip =================================================================== (Binary files differ) Property changes on: documentation/doc/net-responsibility-3.0.1-doc.zip ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rog...@us...> - 2012-04-28 10:11:15
|
Revision: 280 http://responsibility.svn.sourceforge.net/responsibility/?rev=280&view=rev Author: roggan87 Date: 2012-04-28 10:11:09 +0000 (Sat, 28 Apr 2012) Log Message: ----------- Updated the generate script to create zip archives as well. The paths is now stored externally and setup the first run. This creates better compatibility with the SVN repo. Modified Paths: -------------- documentation/generate Modified: documentation/generate =================================================================== --- documentation/generate 2012-04-23 16:59:50 UTC (rev 279) +++ documentation/generate 2012-04-28 10:11:09 UTC (rev 280) @@ -1,19 +1,66 @@ #!/bin/bash -# Change the following variables so PocoDoc can find all related files. -# POCO_BASE: The base folder of Poco, wherever you've located it. -# DOC_BASE: This folder, the base of the documentation. -# NR_BASE: The base folder of Net Resonsibility, may be either extracted -# from a tarball or checked out from the SVN repository. +# First change the paths in paths.txt. More details are found inside the file. # # Run the script like this to use the config file cfg/DevDocs.xml: # $ ./generate DevDocs -export POCO_BASE=/home/roggan/Programmering/poco-1.4.2p1-all -export DOC_BASE=/home/roggan/Programmering/net-responsibility/svn/documentation -export NR_BASE=/home/roggan/Programmering/net-responsibility/svn/trunk +# Configure environment paths +if ! [ -f paths.txt ]; then + echo "You need to set up the environment paths before generating." + echo "Simply follow the instructions and enter the correct paths." + echo "You'll need to enter the full path, and if it contains " + echo "spaces, please wrap it up in single quotation marks (')." + echo "You may at any time change the paths in paths.txt." + echo "" + echo "The first path is POCO_BASE. This is the base folder of " + echo "the complete POCO library source code. If you haven't " + echo "downloaded it yet, please do so from www.pocoproject.org." + echo "Please enter the full path of POCO_BASE and press [Enter]:" + read POCO_BASE + + echo "" + echo "The next path is NR_BASE. That is the base of the Net " + echo "Responsibility source code. Please note that it must be the" + echo "latest release, and that the config file must be set up to" + echo "find the specific version as well." + echo "Please enter the full path of NR_BASE and press [Enter]:" + read NR_BASE + + echo "" + echo "The last path to specify is the base of this documentation." + echo "If you leave the line empty, it will be:" + echo "$(pwd)" + echo "Please enter the full path of DOC_BASE and press [Enter]:" + read DOC_BASE + if [ "$DOC_BASE" == "" ]; then + DOC_BASE=$(pwd) + fi + + # Save the paths + echo "# This file is generated by ./generate. You may change the paths +# here or delete this file and run ./generate again. + export POCO_BASE=${POCO_BASE} + export NR_BASE=${NR_BASE} + export DOC_BASE=${DOC_BASE} + " > paths.txt +fi +# Include the paths +source paths.txt -CFG_FILE=$1 +if [ "$1" == "zip" ]; then + VERSION=$2 + cd $DOC_BASE/doc + cp -r ./$VERSION ./net-responsibility-$VERSION-doc + find ./net-responsibility-$VERSION-doc -type d -name .svn -print0 | xargs -0 rm -rf + find ./net-responsibility-$VERSION-doc -type f -name .directory -print0 | xargs -0 rm -rf + rm ./net-responsibility-$VERSION-doc.zip + zip -r ./net-responsibility-$VERSION-doc.zip ./net-responsibility-$VERSION-doc + rm -r ./net-responsibility-$VERSION-doc + cd .. +else + CFG_FILE=$1 + PocoDoc --config=$DOC_BASE/cfg/$CFG_FILE.xml +fi -PocoDoc --config=$DOC_BASE/cfg/$CFG_FILE.xml This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dus...@us...> - 2012-04-23 17:00:01
|
Revision: 279 http://responsibility.svn.sourceforge.net/responsibility/?rev=279&view=rev Author: dustsource Date: 2012-04-23 16:59:50 +0000 (Mon, 23 Apr 2012) Log Message: ----------- Clarified 'Need for libpcap library' section in 'Compile from Source' guide (r278) to distinguish between the library and its associated packages, as well as emphasize the need for the libpcap-dev package to be installed if available. Revision Links: -------------- http://responsibility.svn.sourceforge.net/responsibility/?rev=278&view=rev Modified Paths: -------------- documentation/pages/0305-CompileFromSource.page Modified: documentation/pages/0305-CompileFromSource.page =================================================================== --- documentation/pages/0305-CompileFromSource.page 2012-04-23 16:29:56 UTC (rev 278) +++ documentation/pages/0305-CompileFromSource.page 2012-04-23 16:59:50 UTC (rev 279) @@ -22,8 +22,8 @@ ---- <!Note:!> If you are not an Ubuntu/Debian user, for the last command you may need to change <*sudo*> to <*su*>. The main thing to know is that the <*make install*> command needs to be run as 'root', however your particular platform handles that. -!!!Need for libpcap package -You also will need to have <*libpcap*> installed. Many systems either have it installed by default, or provide packages for it that can be installed by the user. +!!!Need for libpcap library +You also will need to have the <*libpcap*> library installed. Many systems either have it installed by default, or provide packages for it that can be installed by the user. You may see that your system already has a <*libpcap*> package installed, but if your system also has a <*libpcap-dev*> package available, you need to make sure that is installed as well. !!!Net Responsiblity Once you have the POCO libraries and libpcap successfully installed, you can move on to compiling and installing NR itself, which can be done in a similar way to the process shown above for the POCO libraries. Download and unpack the [[https://sourceforge.net/projects/responsibility/files/latest/download tarball]] (i.e, archive file). Then open a terminal window to configure, compile and install. For a user who has put the unpacked contents of the tarball into the <*/home/name/netresp*> directory, the procedure should look like this: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dus...@us...> - 2012-04-23 16:30:05
|
Revision: 278 http://responsibility.svn.sourceforge.net/responsibility/?rev=278&view=rev Author: dustsource Date: 2012-04-23 16:29:56 +0000 (Mon, 23 Apr 2012) Log Message: ----------- Created 'Debug end user guide' page in 'Development Introduction' category. This will be useful as an initial resource for developers to provide to end-users who are helping with debugging. Added Paths: ----------- documentation/pages/5040-DebugEndUser.page Added: documentation/pages/5040-DebugEndUser.page =================================================================== --- documentation/pages/5040-DebugEndUser.page (rev 0) +++ documentation/pages/5040-DebugEndUser.page 2012-04-23 16:29:56 UTC (rev 278) @@ -0,0 +1,108 @@ +Debug end-user guide +A50NR_DevIntro + +!!!Intended audience +This guide is aimed towards end-users of NR who have limited knowledge and experience in regards to the 'inner workings' of their computer systems, but more experienced users may also find it helpful. Developers will also find this to be a helpful initial resource to provide end-users when helping them with debugging. + +!!!Helping with debugging Net Responsibility +If you are experiencing problems with Net Responsibility (NR), assisting with debugging (troubleshooting the problem with the program) can help fix your problem, and at the same time improve the software. This process may involve installing NR in a different way and/or doing other things you are not familiar with, but this guide and NR's developers should be able to walk you through it. The end goal of the debugging process is to generate some text output that the developers can use for troubleshooting. Because of different computer systems, software versions, and settings, and because developers do not have access to each user's computer, they are grateful to any user who is willing to help out with the debugging process. + +!!!General elements of debugging NR +Whatever computer system you are using, you will normally need to do most, if not all, of the following things during the debugging process: + - Subscribe to the NR development mailing list. (This is your link to people with the knowledge and expertise to help you successfully complete this process, and then solve your problem.) + - Install any software that is needed to successfully complete the other steps. (Sometimes you may not know exactly what these are until you run into errors in later steps, so you may need to revisit this step one or more times.) + - Perform a special installation of NR. (This may involve downloading one or more files, as well as using a terminal window to run commands for compiling and installing the software.) + - Run a 'debug' command in a terminal window to produce the 'debug' text output. + - Email the debug text output to the NR development mailing list, so the developers can look at it and work on a solution. + - Continued dialogue with the developers during which they may ask you to do some other things to help them with troubleshooting or testing a particular solution. + +!!!Subscribing to the NR development list +Because debugging is a part of the software development process, it is important that you subscribe to the NR development mailing list, which is where you will send whatever debug output you get and also where you will have any necessary follow-up dialogue with the developers. Once your problem is resolved, you may unsubscribe again if you want to. To subscribe, [[https://lists.sourceforge.net/lists/listinfo/responsibility-devel click here]] and follow the instructions found under "Subscribing to Responsibility-devel". Some messages others send to this mailing list may seem quite technical if you are not a software developer yourself, but you can safely ignore any emails or threads that do not apply to the debugging process you are taking part in. The easiest way to focus in on only those emails that are relevant to you is to choose (when you subscribe) NOT to receive mail from the list in a daily digest. + +!!!Using the NR development list +When replying to an email on this list, please observe the following guidelines: + - All your replies should be sent to res...@li.... + - Remove everything from the email you're replying to, except for parts that you're answering or responding to in particular. + - Your response should be placed right after the part you're referring to. + - Don't change the subject. (This helps keep all related messages in the same 'thread' for later reference.) + +If you are reporting a problem or asking a question about something, please observe the following guidelines: + - Take the time to make a reasonable effort to find information on your own before asking for help. If you are new to the computer system you are using, there are often helpful guides and tutorials online that can be accessed by a simple search with Google, Bing, etc. Using part or all of an error message to do an online search can also bring up some potential solutions. + - If you have tried figuring things out yourself and are coming up short, please let us know and we will do our best to help. + - Clearly state what operating system and version you are using (i.e. Ubuntu 10.10). + - Make sure and copy and send any error messages you think may be related to your problem. Even if they don't make sense to you, they will help the developers to figure out the problem. + - When instructions you are given don't work or you don't understand something, be specific when you mention that to us. For instance, let us know where in the process you ran into a problem, what you were trying to do, what happened as a result, and include a copy of any text output or error message you received. Or if something doesn't make sense, mention exactly what it was that you didn't understand and ask any related questions that will help us know how to clarify things for you. + - Be patient and respectful. We know it can be frustrating to have unresolved problems with software you are counting on, but remember that anyone who is helping you is volunteering their time and may not be able to reply as quickly as you would like. We will do our best to help you, and also appreciate any help you can give towards improving NR. + +!!!Debugging NR on Ubuntu +New to Linux/Ubuntu? Read this article for some helpful info: [[http://www.psychocats.net/ubuntu/terminal Where's the Terminal?]]. <!Warning:!> Read [[http://ubuntuforums.org/announcement.php?f=100 this]] (post by jdong, Nov 18, 2007 - Jan 31, 2013) before copying/pasting anything into the terminal. Basic rule: Take time to make sure you have at least a basic idea of what and why you are running a certain command in the terminal. + +!!Install other necessary software +The following packages will need to be installed (if they are not already) before you can successfully complete the next steps: + + - build-essential (Installing this package results in the installation of a group of compiling-related packages that are needed for doing any Debian package building, and it might not be installed by default in your version of Ubuntu.) + - The POCO libraries, version 1.4 or later. (Some systems will have a software package that you can use to install these. If your system does not have this, you will need to compile and install these yourself. See the section "Compiling and installing the POCO libraries on Ubuntu" below for instructions on how to do this.) + - libpcap-dev + +Note: You can use the search function of a package manager like Ubuntu Software Center or Synaptic Package Manager to see if the above packages are already installed. For the POCO libraries, you will want to search for the text <*libpoco*> which should bring up a number of different packages that make up the POCO libraries. You can also use a package manager to install these packages if you wish. Alternatively, you can open a terminal window and use the following command: + + sudo apt-get install package-name + +(Explanation of the above command: 'sudo' gives you root permission, which some programs [like 'apt-get'] require in order to run, and this normally requires you to enter your system username and password. 'apt-get' is the name of the program that you want to run, which in this case is a program that is used to download and install software on your system. 'install' just tells the 'apt-get' program what you want it to do. 'package-name' represents the place in the command where you type the name of whatever package you want to install; so if you want to install the 'build-essential' package, then that's what you type there, so that 'apt-get' knows what program you want it to install.) You may also need to follow some prompts in the terminal window in order to complete the install process. + +!!Compile and install NR +Once you have confirmed that other necessary software is installed, the next thing you will need to do is compile and install NR. Unless you are given different instructions by a developer, here's what you need to do: + - Download the NR tarball (i.e. archived file) [[https://sourceforge.net/projects/responsibility/files/latest/download from here]]. + - Unpack (extract) it (this can often be done by right-clicking on the file and choosing the unpack/extract option from the menu), which will result in the creation of a directory (folder) with the same name as the file you downloaded, and which contains other folders and files. If you want, you can unpack the file to one directory and then copy the extracted contents to another directory where you will work with it. + - Once you have the NR folders and files in the directory you want them, you then need to open a terminal window and use the <*cd*> command to move yourself to that directory. While there you then need to do three things: configure, compile and install. For a user who has chosen to use the <*/home/name/nr*> directory, the procedure should look like this: + + cd /home/name/nr + ./configure + make + sudo make install +---- + +If the above commands ran without giving any errors, there is a good chance that NR has been successfully installed. However, before you move to the next step, you should confirm whether NR is running or not by running the following command in a terminal window: + + ps -ef|grep net-responsibility + +If the only line you see contains <*grep*>, then NR is not running. However, if you see an additional line that contains <*net-responsibility —daemon*> then you know it is running. If you have just started up your system or manually started NR, then you will want to wait a minute or two before running this command, since sometimes NR will run for a bit before it encounters a problem that makes it stop running. + +!!Run NR's debug command +Now you are to the place where you can run the command that will generate the debug text output that you will then send to the developers via the mailing list. + - If NR is currently running, then you will need to manually stop it, which you can do by running the following command in a terminal window: + + sudo killall net-responsibility + +If you want, you can then run the 'grep' command (see above) again to confirm that NR is no longer running. + + - If NR is not running, then you can proceed by running the following command in a terminal window: + + sudo net-responsibility --debug + +This will generate the desired debug output, which you will then want to copy and paste into your reply to the mailing list. What this command does is manually start NR and run it in the terminal window, generating the debug output until it either stops running or finishes the process of starting and successfully running. + + - If running the above command results in NR continuing to successfully run, then it will keep running as long as you have the terminal window open where you ran the command. If you have copied whatever debug data you want, and want to go back to running NR in the background (rather than in the terminal window), then you can use 'Ctrl + C' (on your keyboard) in the terminal window, which should stop NR and give you another blank command line where you can run another command if you wish. To start NR in the background, you will then want to run the following command in the terminal window: + + sudo net-responsibility --daemon + +If you want, you can then run the 'grep' command (see above) again to confirm that it is indeed running as it should. + +!!!Compiling and installing the POCO libraries on Ubuntu +If your system does not have a precompiled package for installing the POCO libraries, then you will need to compile and install them from the source code. Here's what you need to do: + - [[http://sourceforge.net/projects/poco/files/sources/poco-1.4.3/poco-1.4.3p1-all.tar.gz/download Download the 'complete edition']] (i.e. not the 'basic edition') of the POCO libraries. + - Unpack (extract) the file you downloaded (this can often be done by right-clicking on the file and choosing the unpack/extract option from the menu), which will result in the creation of a directory (folder) with the same name as the file you downloaded, and which contains other folders and files. If you want, you can unpack the file to one directory and then copy the extracted contents to another directory where you will work with it. + - Once you have the POCO folders and files in the directory you want them, you then need to open a terminal window and use the <*cd*> command to move yourself to that directory. While there you then need to do three things: configure, compile and install. For a user who has chosen to use the <*/home/name/poco*> directory, the procedure should look like this: + + cd /home/name/poco + ./configure --shared --no-tests --no-samples + make + sudo make install + +If the above commands ran without giving any errors, then you were probably successful in installing the POCO libraries, and can go on with the next steps of the debugging process as detailed above. + +!!!Debugging NR on other systems +Many of the principles of the debugging process will be the same on different systems, although some of the details will be different. If you are having trouble working out how to do it on your system, you can contact the developers via the mailing list and they may be able to help you. Once you have figured it out, please share the process with us via the mailing list, as this will help us improve our documentation and ability to help others with the same system as you. + +!!!Troubleshooting +If you run into any problems with the above process, please let us know via the mailing list. Your feedback in this way will help us know how to improve these instructions to make the debugging process as smooth as possible for everyone involved. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dus...@us...> - 2012-04-21 16:54:12
|
Revision: 277 http://responsibility.svn.sourceforge.net/responsibility/?rev=277&view=rev Author: dustsource Date: 2012-04-21 16:53:53 +0000 (Sat, 21 Apr 2012) Log Message: ----------- Expanded 'Configuration Explained' page, r276. Revision Links: -------------- http://responsibility.svn.sourceforge.net/responsibility/?rev=276&view=rev Modified Paths: -------------- documentation/pages/0301-ConfigurationsExplained.page Modified: documentation/pages/0301-ConfigurationsExplained.page =================================================================== --- documentation/pages/0301-ConfigurationsExplained.page 2012-04-18 22:49:14 UTC (rev 276) +++ documentation/pages/0301-ConfigurationsExplained.page 2012-04-21 16:53:53 UTC (rev 277) @@ -1,2 +1,61 @@ -Configurations explained +Configuration explained A03NR_Install + +!!!Overview +The configuration of Net Responsibility (NR) refers to user-specific settings that enable the program to run on a particular computer system. Before you install NR you need to [[http://netresponsibility.com/register.php register an account]] on the website, if you haven't done so already. The information you enter during registration will be used during the NR install process to do the initial configuration on your computer system in order for it to work properly. + +The configuration information is stored on the website and is periodically downloaded by NR as needed. To manually configure NR by downloading the configuration information you can run the following command in a terminal window: + + sudo net-responsibility -c +---- +<!Note:!> If you are not an Ubuntu/Debian user, you may need to change <*sudo*> to <*su*>. The main thing to know is that the <*net-responsibility*> command needs to be run as 'root', however your particular platform handles that. + +!!!Configuration parts +During and/or after the NR registration process (which is all done online at the NR website), you will have the opportunity to specify certain settings for the following parts of the program's configuration. + +!!Name, password, etc. +Here you will choose a username and password, which you will use to log in on the website (i.e. to change your settings, write forum posts, etc.), and which you may also need to use on your computer (i.e., when you first install NR, or when you manually configure NR). Your password is only saved on the NR website, where it is used to verify your user identity. You will need to enter your password a second time, just to doublecheck that you've created the password you intended. You will also need to enter your name or you can enter an alias, as long as your accountability partners know what it is, since NR uses this name when sending reports. + +!!Email addresses +One of the things you'll enter here is your email address, which will be the email used to activate your NR account. Note that when NR sends reports it sends them from the email address re...@ne... rather than your email address. In this part you will also enter the email addresses of those you wish to receive reports. These will normally be one or more accountability partners, but you may also want to enter your own email address as well, either to make sure everything is working okay or in case you want to get a copy of the reports. It may appear that you can only enter a limited amount of email addresses, but as you fill in the last visible field, an additional blank field will appear. This will continue until you've entered all the email addresses you need. + +!!Tweaks +In this part, the following options can be set: + - <*Logfile*>: The location of the logfile must be specified; otherwise, NR will refuse to start. <!WARNING:!> Don't change this unless you know what you're doing! + - <*Pidfile*>: The location of the pidfile must be specified; otherwise, NR will refuse to start. <!WARNING:!> Don't change this unless you know what you're doing! + - <*Report frequency*>: Here you will enter the number of days you want between the emailed reports. If set to zero, the automatic reports will be disabled and you'll have to send reports manually, or by using the task-scheduling package <*cron*>. + - <*Instant threshold*>: Here you can enable instant reports, which means your accountability partner will get a report instantly when NR thinks you're looking at inappropriate content. You can also set the sensitivity. Entering zero means this feature is disabled. Otherwise, lower numbers mean higher sensitivity. (0 = Disabled; 1-5 = Very sensitive; 6-20 = Medium; 21+ = Low sensitivity) + - <*Report strength threshold*>: Only matches with a strength higher than this number will be included in the reports. That way you're able to set some sort of sensitivity for what to display. + - <*Always perform tokenmatch*>: Using tokenmatch increases the report creation time because it's more complicated, but it results in much more accurate reports. If you're having problems with reports taking too long to create you might want to exclude it. + - <*Provide improvement data*>: Use this option if you'd like to help us with the development of NR. They program will <*anonymously*> send your warnings to our server and store them there. This will help us see how to improve the blacklists. + - <*Send me newsletters*>: Choose this if you want the latest information about new versions, how to help, and other things that might be of interest. These emails are not sent on a regular basis, but rather whenever there's a need to update users with fresh information. + +!!Blacklist categories +In this part, you can choose one or more <*blacklists*> that you want NR to use when creating your reports. Each of these blacklists is full of keywords. If any of the words are found in the websites you've visited, it will show up as a warning in the report. + +!!Report parts +Here you can choose what parts you want included in your NR reports. You can also choose to include a more detailed attached report, which is strongly recommended. Following are the various report parts and related options, along with a brief description of each: + - <*Shutdowns*>: NR records if it's shutdown manually or interrupted. Choose this to list these shutdowns, if any, in the report. This can be chosen for the regular and/or attached reports. + - <*Warnings*>: The <*warnings*> part of the report lists any visited websites that contain one or more words from the blacklists. They could be inappropriate websites, but that is not always the case. Therefore, your accountability partner(s) should always double-check them, either by clicking the link or by reading the match in its context. It is strongly recommended to choose this option! This can be chosen for the regular and/or attached reports. + - <*Whitelist*>: If a website contains a blacklisted word, but <*also*> a whitelisted word, it will be found in this part of the report. This way you will be able to tell NR that some websites are okay. This can be chosen for the regular and/or attached reports. + - <*No history*>: Choose this if you do not want any of your browsing history to be included in the attached report (this option is not available for regular reports). Note that all websites visited will be searched for a blacklist match independent of what you choose here. + - <*Complete history*>: Choose this if you want your complete browsing history (i.e. every webpage accessed) to be included in the attached report (this option is not available for regular reports). + - <*Only hostnames*>: Choose this if you want just the hostnames (i.e. main website names, like www.yahoo.com, but not every page associated with that website) of your browsing history to be included in the attached report (this option is not available for regular reports). + - <*Zipped*>: Depending on your internet activity and how often your reports are sent, the attached reports might become quite large. If you choose this option NR will zip (compress) the file before sending it. This means the receiver will have to unzip (decompress) the report every time, but it also saves space in his/her email account. The file usually decreases to 10-20% of the original size when zipped. If the report is larger than 10MB it will be zipped automatically. + +You may find it helpful for yourself and your accountability partners to have NR send reports using various combinations of the above options. This will give you a chance to see some sample reports and decide together what will work best for you. + +!!Personal blacklist +Here you can enter keywords to make your personal blacklist. If you click on the blank field for this option, some basic instructions with some helpful links will show up on the right-hand side. If you already have a list you want to add, you can copy and paste it in the field. It will be split at every line break. + +!!Personal whitelist +Here you can enter keywords to make your personal whitelist. If you click on the blank field for this option, some basic instructions with some helpful links will show up on the right-hand side. Note that only the hostname will be matched against the whitelist. If you already have a list you want to add, you can copy and paste it in the field. It will be split at every line break. + +!!!Configuration changes +If you want to make any changes to the configuration of NR, here are the steps to follow: + - Go to the NR website, log in with your username and password, and click on the tab that shows your username. This will take you to the page where your current configuration options can be viewed. + - Click on the various sections to open them and make the desired changes. + - Once you are done making changes, click on the 'Log out' section, enter the security code and click on 'Save and log out'. + - Run the NR configuration manually (see instructions in the 'Overview' section above), which will download the new configuration information to your computer. +Once you have completed the above steps successfully, NR should now be running according to the new configuration options you chose. Also note that whoever normally receives your reports (i.e. your accountability partner) will also be notified when you change NR's configuration. + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rog...@us...> - 2012-04-18 22:49:23
|
Revision: 276 http://responsibility.svn.sourceforge.net/responsibility/?rev=276&view=rev Author: roggan87 Date: 2012-04-18 22:49:14 +0000 (Wed, 18 Apr 2012) Log Message: ----------- Added an example on how to make unordered lists in the pages. Modified Paths: -------------- documentation/pages/samplePage.txt Modified: documentation/pages/samplePage.txt =================================================================== --- documentation/pages/samplePage.txt 2012-04-18 22:48:36 UTC (rev 275) +++ documentation/pages/samplePage.txt 2012-04-18 22:49:14 UTC (rev 276) @@ -41,5 +41,13 @@ This is an [[http://www.appinf.com external link]]. +We can also make a list of several items: + - First item + - Second item + - Third + multiline + item (Displayed on one line) + - Forth item + Last we illustrate how to add an image with a description: [[image:path/to/image.gif Image description]] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rog...@us...> - 2012-04-18 22:48:46
|
Revision: 275 http://responsibility.svn.sourceforge.net/responsibility/?rev=275&view=rev Author: roggan87 Date: 2012-04-18 22:48:36 +0000 (Wed, 18 Apr 2012) Log Message: ----------- Added some documentation on how to contribute to NR. Edited Getting started with coding Created a new guide, Creating Packages/Install files. Modified Paths: -------------- documentation/pages/0903-ContributeToNR.page documentation/pages/5001-GettingStarted.page Added Paths: ----------- documentation/pages/5006-CreatingPackages.page Modified: documentation/pages/0903-ContributeToNR.page =================================================================== --- documentation/pages/0903-ContributeToNR.page 2012-04-18 20:26:09 UTC (rev 274) +++ documentation/pages/0903-ContributeToNR.page 2012-04-18 22:48:36 UTC (rev 275) @@ -1,20 +1,119 @@ Contribute to Net Responsibility A09NR_FurtherReading +!!!Initial warning + +Any help in making this software is highly appreciated! You just have to be +aware though, that <*more knowledge means a bigger responsibility*>. When +developing you'll see pitfalls and circumventions that weren't obvious in the +first place. We're constantly working towards reducing those pitfalls, and we +also need help here. It is perfectly possible to be both accountable and +involved in the development at the same time, but it requires a more open +communication with the Accountability Partner, like "I promise I will tell you +whenever I shut down Net Responsibility, or if I fall even though not getting +caught in the reports". + + !!!Feedback -!!Report bugs and request features +We're interested in what you think about Net Responsibility, and would like to +hear your opinion about the software. The more voices we hear, the better +program we're able to make. + +!!Bug reports + +If you encounter a bug in the software, please report it. The best is to add it +to our [[http://sourceforge.net/p/responsibility/bugs/ bug tracker]]. +Please try to be as specific as possible, and include <*the version of your +installation*> and <*what platform you're running*>. If you manage to install +the software, but not to get it running properly, please try to run it with this +command, and paste the output in your bug report (Ubuntu users need to add sudo +before the command) : + + net-responsibility --debug +---- + + +!!Feature requests + +If there's features you're missing in Net Responsibility, please let us know. +We're constantly working toward implementing and stabilizing more features and +your requests are valuable. Some of you might have experience of other +accountability software, or simply have some stunning ideas that we could've +never come up with. Think outside the box. + +Please remember that it may take time for us to implement your feature, and if +you want it quick, you may be interested in looking at it yourself. Even then, +please [[http://sourceforge.net/p/responsibility/feature-requests/ +add it as a feature request]]. Try to be as specific as possible, what do you +want to see implemented, and what's the difference from the result you're +seeing now? Are you able to illustrate the goal? Do you have any proposal of +how to get there? + + !!Forum +Other feedback than bug reports and feature requests are best expressed on +[[http://www.netresponsibility.com/forum/ the forum]]. + + !!!Keep updated -!!Mailing list +Whether you're actively involved in developing Net Responsibility or not, you +would do much by being kept updated. This way you'll more easily be able to +come with relevant suggestions, patches, bug reports etc. +!!Mailing lists + +[[https://lists.sourceforge.net/lists/listinfo/responsibility-devel +re...@li...]]. +This list will be used for all major discussion about Net Responsibility +development. Before making definite decisions, we'll post them to the +mailing list so everyone can have their word about it. Note that you don't +have to be an active contributor to the project to be a subscriber of this +mailing list. By subscribing, you will be able to follow the process anyway, +and maybe come with other opinions from time to time. + +[[https://lists.sourceforge.net/lists/listinfo/responsibility-commit +re...@li...]]. +Whenever someone is making a commit to our SVN repository, a "commit mail" +will be sent to this list. It'll include the log message and the diff. This +is also an excellent way to keep updated and see what changes are made to +the code. It's also helping us spot bugs or come with alternative +suggestions faster. Even if you don't understand the diffs, you'll be able +to follow the log messages, and by doing so understand what changes/bug +fixes are implemented in the code. + + !!Running the latest versions +By using the latest versions of Net Responsibility, you'll be more in sync +with the developers, and therefore have more relevant information to come +with. Also, you'll help us spot bugs that may slip into new versions. Ubuntu +users with the PPA added will automatically run the latest stable release. +Before releasing versions we're trying to test them in a beta stage. +Whenever it's time for beta testing, will announce it on the devel mailing +list. The more people that's willing to bug test the beta releases, the more +stable software we'll be able to produce. + !!!Improve documentation +You can help us a lot by improving the documentation. No coding skills are +needed. More information are to be [[5004-Documentation.html found here]]. + + !!!Code contributions -!!Development documentation +Since Net Responsibility is free and open source, anyone is able to +contribute with their programming skills. Read the +[[5001-GettingStarted.html getting started guide]] to get going with the +coding. + +!!!Create packages + +For many users the existence of precompiled packages are the difference +between staying with or leaving the project. Struggling through compilation +without any knowledge about it may frustrate anyone. Therefore there is a +huge need to have working packages/install files. You may engage in creating +such, please read more details in [[5006-CreatingPackages.html this guide]]. Modified: documentation/pages/5001-GettingStarted.page =================================================================== --- documentation/pages/5001-GettingStarted.page 2012-04-18 20:26:09 UTC (rev 274) +++ documentation/pages/5001-GettingStarted.page 2012-04-18 22:48:36 UTC (rev 275) @@ -1,11 +1,7 @@ -Getting started with development +Getting started with coding A50NR_DevIntro -!!!Initial warning -Any help in making this software is highly appreciated! You just have to be aware though, that <*more knowledge means a bigger responsibility*>. When developing you'll see pitfalls and circumventions that weren't obvious in the first place. We're constantly working towards reducing those pitfalls, and we also need help here. - - !!!Windows note For Windows users it is recommended to compile and install everything inside a MinGW + MSYS environment. Added: documentation/pages/5006-CreatingPackages.page =================================================================== --- documentation/pages/5006-CreatingPackages.page (rev 0) +++ documentation/pages/5006-CreatingPackages.page 2012-04-18 22:48:36 UTC (rev 275) @@ -0,0 +1,187 @@ +Creating Packages/Install files +A50NR_DevIntro + + +!!!Starting point + +This guide is dedicated to packaging Net Responsibility for different platforms. I've only done packaging for Ubuntu, so that's my starting point. Note that I'll only discuss Net Responsibility related things to keep in mind while packaging, rather than the actual packaging steps and how it's done in different environments. + + +!!!Compile from scratch + +First you need to download the source code (the tarball, not the trunk) and make sure Net Responsibility is correctly compiled, installed and running on the platform you're building for. [[0305-CompileFromSource.html Compilation instructions may be found here.]] If you're getting stuck here you may consult the Installation board on our forum. Note that you may specify some installation directories explicitly with arguments such as <*--prefix --pkgdatadir --with-initdir --with-databasedir --with-piddir*> etc. + +!!!About automated package software + +We encourage any packager to make and maintain packages, but please do not use automated packaging software where one can't control everything that happens in the packaging process. It is also never a good idea to convert packages to another format (such as deb to rpm), if you want to publish the packages to a broader target. + +!!!POCO C++ Library + +Net Responsibility heavily relies on the [[http://www.pocoproject.org POCO C++ library]], so first check if it is available as a package for your platform. It has to be version 1.4.0 or later. If it isn't, you'll need to either create a separate package, or include the library in your Net Responsibility package. For most platforms alternative one is preferable, and then make Net Responsibility depend on that package. + +!!!Install scripts + +During the installation step, some essential actions are performed, wrapped up in three scripts. These scripts are called postinst, prerm and postrm. The two first are found in the directory ./scripts. However you may have to tweak them a bit to suit your needs. If there is a template for writing them in your environment, it's recommended to use that as your base, and then insert all the code needed from the scripts shipped with Net Responsibility. Make sure you understand how the script is called (which arguments are specified). This may be more or less unique for every package format. If your package format doesn't use these scripts, you still need to make sure all steps are performed in the right order somehow. + +!!!Postinst script + +The postinst script is run right after all files are in place. It's purpose is to, if not done before, configure Net Responsibility, make the software start on boot and shut down on halt (install the init script), and start an instance of Net Responsibility. + +!!Specific directories + +Open up scripts/postinst in your favorite text editor. The first lines to pay attention to looks like this: + + pkgdatadir=$1 + initdir=$2 +---- + +Pkgdatadir is the folder that contains important data files used by Net Responsibility. In Debian it's found at /usr/share/net-responsibility. Initdir is the folder where your system puts init scripts. I will shortly explain a little more what the init scripts are. This postinst script is called by make with two arguments, the paths to both pkgdatadir and initdir. However, your package manager may call the postinst in a very different way, and then the variables $1 and $2 can't be used for this purpose. In that case you'll have to specify the correct paths using another technique. In most Linux distros you may specify a hardcoded path. Correct me if I'm wrong here. If you know where the data files will be put, and where init scripts are stored, just specify them like this: + + pkgdatadir=/usr/share/net-responsibility + initdir=/etc/init.d +---- + +On some platforms the paths may be specified during the installation process, and then you'll need to determine the correct path. + +Next comes an if-statement. Here we check if Net Responsibility is already configured. That's done with the following command: + + if ! [ -f $pkgdatadir/config.xml ]; then +---- + +If the file $pkgdatadir/config.xml is found, then we can assume Net Responsibility is configured correctly before. It is very important to do this kind if check, or else one will need to reconfigure every time one is upgrading or reinstalling the software. + +!!Configure + +The next thing to do, if Net Responsibility is not configured earlier, is to make the $pkgdatadir/reports dir. That's where the attached reports are temporarily stored. We also want to set up the users account and send an installation mail to the accountability partners. In the regular installation from source this is done with these two lines: + + mkdir $pkgdatadir/reports + net-responsibility --install +---- + +That's fine, since we can assume our users are in a terminal when installing the software. However, the packages are installed differently. We cannot assume direct interaction with the user. Therefore it is always preferred to use the package manager's configuration utility, if there is one. Debian for example, is using debconf. Then the username and password is asked early in the installation process, unless config.xml is found, and stored in a database. Later in the postinst, these values are loaded and explicitly specified to Net Responsibility like so: + + db_get net-responsibility/username || true + username="$RET" + db_get net-responsibility/password || true + password="$RET" + if [ "$username" != "" ] && [ "$password" != "" ]; then + net-responsibility --install --username=$username --password=$password + fi +---- + +You don't need to understand every command, more the concept. Store the values in $username and $password and run: + + net-responsibility --install --username=$username --password=$password +---- + +If the username and password is stored in a database, you need to clear out that information as soon as you're done with the configuration. + +<*Note: If you're package format doesn't provide any configuration utility, you need to tell the user to run "net-responsibility --install" after the package is installed!*> + +!!Init script + +Next we come to the init script. Net Responsibility need to start every time the computer is booted. In many platforms this is done using an init script. The script shipped as default with Net Responsibility (scripts/init.d), is customized for Debian based systems. You may need to write your own for the specific platform you're targeting. The init script needs to get installed. It's good practice not to store the init script directly in the initdir. Instead it's stored as $pkgdatadir/init.d. So first you need to make a symlink to the initdir. Consult with your system's documentation on how to install the init script. In a regular make installation, the postinst script will try different commands and use the first one that seems to work. That procedure looks like this. + + ln -s -f $pkgdatadir/init.d $initdir/net-responsibility + if command -v update-rc.d &>/dev/null # Debian, Ubuntu + then + update-rc.d net-responsibility defaults + elif command -v chkconfig &>/dev/null # Red Hat, Fedora + then + chkconfig --add net-responsibility + elif command -v rc-update &>/dev/null # Gentoo + then + rc-update add net-responsibility default + elif command -v innserv &>/dev/null # OpenSuse + then + innserv $initdir/net-responsibility + fi +---- + +Once you know which command you need, you won't have to run all these tests. Simply make the symlink and use your specific command to install the init script. + +!!Start Net Responsibility + +The last operation in the postinst script is to start an instance of Net Responsibility. Depending on your system it may be done with different commands. In Debian one is supposed to use <*"invoke-rc.d net-responsibility start"*>. One can also use <*"net-responsibility --daemon"*> as done in the regular make installation. + +That's it. You're done with the first script, only two left. + + +!!!Prerm script + +The prerm script is run when one is uninstalling Net Responsibility, before actually deleting the files. It is pretty similar to postinst. The $pkgdatadir and $initdir is handled the same way, so I won't go through them again. + +The following two if-statements looks like follows: + + if [ -f $initdir/net-responsiblity ]; then + $initdir/net-responsibility stop + fi + if [ -f $pkgdatadir/config.xml ]; then + net-responsibility --uninstall + fi +---- + +First, if the symlink is found, we stop the running instance of Net Responsibility. The command to stop a daemon using the init script may look different on your platform. Debian uses <*"invoke-rc.d net-responsibility stop"*>. + +Second, if the config file exists (which means the software is configured), we need to send an uninstallation mail to be sent. That's done using the <*--uninstall*> argument. + +The last operation is to uninstall the init script. That's usually done with the same command as you install it with, except you change some value or argument. In Debian it's done with <*"update-rc.d -f net-responsibility remove"*>. + + +!!!Postrm script + +The last script to look at is postrm. Logically it's run after all files are removed. The only thing done is to remove some more files created either by the install scripts or by Net Responsibility itself. You won't find any postrm script in the scripts folder, instead you need to open Makefile.am. Near the end you'll find these lines: + + postrm: + rm -f $(piddir)/net-responsibility.pid + rm -f $(pkgdatadir)/blacklist.xml + rm -f $(pkgdatadir)/config.xml + rm -rf $(pkgdatadir)/reports + rm -f $(databasedir)/net-responsibility.db + rm -f $(initdir)/net-responsibility +---- + +Copy and paste in your postrm script (except for the first line that specifies a make target - <*"postrm:"*>). Note that postrm may be run even when upgrading to a newer version. Therefore you may have to check if the package is really removed, or only upgraded. The arguments specified may tell you. You're familiar with $pkgdatadir and $initdir by now, but $piddir and $databasedir are new. Well, in Debian the postrm would look something like this: + + rm -f /var/run/net-responsibility.pid + rm -f $pkgdatadir/blacklist.xml + rm -f $pkgdatadir/config.xml + rm -rf $pkgdatadir/reports + rm -f /var/log/net-responsibility.db + rm -f $initdir/net-responsibility +---- + + +!!!Edit Makefile + +When building the package, your environment will probably use the makefile. Therefore you'll have to do some changes. Open up Makefile.am and delete all these lines: + + install: install-am postinst + + uninstall: prerm uninstall-am postrm + + postinst: + $(top_srcdir)/scripts/postinst $(pkgdatadir) $(initdir) + + prerm: + $(top_srcdir)/scripts/prerm $(pkgdatadir) $(initdir) + + postrm: + rm -f $(piddir)/net-responsibility.pid + rm -f $(pkgdatadir)/blacklist.xml + rm -f $(pkgdatadir)/config.xml + rm -rf $(pkgdatadir)/reports + rm -f $(databasedir)/net-responsibility.db + rm -f $(initdir)/net-responsibility + + .PHONY: prerm postinst postrm +---- + +All this information is now found in your own customized scripts, so just make sure they're invoked instead. + + +!!!The next step + +That's about it. Feel free to consult the mailing list res...@li... for help, but keep in mind that you'll get better answers elsewhere for issues that has to do with your specific packaging environment. However we may be able to help each other a bit on the way. When trying to answer questions it is also a huge help to know which OS you're running and what kind of package you're trying to create. + +We are interested in any package that is successfully built, as well as new init scripts. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mpn...@us...> - 2012-04-18 21:53:48
|
Revision: 274 http://responsibility.svn.sourceforge.net/responsibility/?rev=274&view=rev Author: mpnordland Date: 2012-04-18 20:26:09 +0000 (Wed, 18 Apr 2012) Log Message: ----------- The UID class has been integrated into the database, the .h and .cpp files have been moved to the /include and /src directories respectively. Modified Paths: -------------- branches/multiuser/include/Database.h branches/multiuser/include/Sniffer.h branches/multiuser/include/SnifferThread.h branches/multiuser/src/Database.cpp branches/multiuser/src/Sniffer.cpp branches/multiuser/src/SnifferThread.cpp Added Paths: ----------- branches/multiuser/include/UID.h branches/multiuser/src/UID.cpp Modified: branches/multiuser/include/Database.h =================================================================== --- branches/multiuser/include/Database.h 2012-04-18 18:52:48 UTC (rev 273) +++ branches/multiuser/include/Database.h 2012-04-18 20:26:09 UTC (rev 274) @@ -82,7 +82,8 @@ _keyword, _category; Logger *_logger; - BlacklistMatch _blacklistMatch; + BlacklistMatch _blacklistMatch; + int _uid; Statement *_getLastRowId, *_logUrlStatement, *_logWarningStatement, @@ -90,7 +91,7 @@ void setStatements(), logMatch(BlacklistMatch), logUrl(HTTPRequest&), - logWarning(BlacklistMatch), + logWarning(BlacklistMatch, int), getMatches(vector<int>, vector<BlacklistMatch>&) const; }; Modified: branches/multiuser/include/Sniffer.h =================================================================== --- branches/multiuser/include/Sniffer.h 2012-04-18 18:52:48 UTC (rev 273) +++ branches/multiuser/include/Sniffer.h 2012-04-18 20:26:09 UTC (rev 274) @@ -69,6 +69,7 @@ struct sniff_ethernet; struct sniff_ip; struct sniff_tcp; +struct ip_info; class MainApplication; class SnifferThread; @@ -89,7 +90,7 @@ static Filter& getFilter(); static LogStream& getLogStream(); static void logUrl(HTTPRequest&); - static void logWarning(BlacklistMatch); + static void logWarning(BlacklistMatch, ip_info); vector<string> getDevices(); friend class SnifferThread; Modified: branches/multiuser/include/SnifferThread.h =================================================================== --- branches/multiuser/include/SnifferThread.h 2012-04-18 18:52:48 UTC (rev 273) +++ branches/multiuser/include/SnifferThread.h 2012-04-18 20:26:09 UTC (rev 274) @@ -51,7 +51,7 @@ #include "Filter.h" #include "Blacklist.h" #include "Sniffer.h" - +#include "UID.h" #include <pcap.h> #if defined(POCO_OS_FAMILY_WINDOWS) @@ -95,6 +95,7 @@ struct sniff_ethernet; struct sniff_ip; struct sniff_tcp; +struct ip_info; class MainApplication; @@ -112,7 +113,7 @@ Filter *_filter; LogStream *_logStream; - void gotPacket(const struct pcap_pkthdr*, const u_char*, HTTPRequest&); + void gotPacket(const struct pcap_pkthdr*, const u_char*, HTTPRequest&, int&); }; /* Ethernet header */ @@ -161,7 +162,8 @@ u_short th_win; /* window */ u_short th_sum; /* checksum */ u_short th_urp; /* urgent pointer */ -}; +}; + #include "MainApplication.h" #endif // SNIFFERTHREAD_H Added: branches/multiuser/include/UID.h =================================================================== --- branches/multiuser/include/UID.h (rev 0) +++ branches/multiuser/include/UID.h 2012-04-18 20:26:09 UTC (rev 274) @@ -0,0 +1,51 @@ +#include <cstdlib> +#include <iostream> +#include <sys/socket.h> +#include <netinet/in.h> +#include <cstring> +#include <linux/netlink.h> +#include <vector> +#include <linux/inet_diag.h> +#include "Poco/Timestamp.h" +#include <libmnl/libmnl.h> +#include <arpa/inet.h> + +using namespace std; + +enum { + SS_UNKNOWN, + SS_ESTABLISHED, + SS_SYN_SENT, + SS_SYN_RECV, + SS_FIN_WAIT1, + SS_FIN_WAIT2, + SS_TIME_WAIT, + SS_CLOSE, + SS_CLOSE_WAIT, + SS_LAST_ACK, + SS_LISTEN, + SS_CLOSING, + SS_MAX +}; + +#define SS_ALL ((1<<SS_MAX)-1) + +struct TCPConnection { + unsigned int destAddress; + unsigned int srcAddress; + int uid; +}; + +class UID { + public: + UID(unsigned int srcAddress, unsigned int destAddress); + int get_uid_int(); + private: + int uidInt; + int get_uid_from_netlink(unsigned int destAddress, unsigned int srcAddress); + vector<TCPConnection> tcpConnectionList; + int get_tcp_from_netlink(); + static int add_to_connection_cache(const struct nlmsghdr *nlh, void *data); + int really_add(TCPConnection connection); +}; + Modified: branches/multiuser/src/Database.cpp =================================================================== --- branches/multiuser/src/Database.cpp 2012-04-18 18:52:48 UTC (rev 273) +++ branches/multiuser/src/Database.cpp 2012-04-18 20:26:09 UTC (rev 274) @@ -84,8 +84,8 @@ <<"time(:time, 'unixepoch', 'localtime'))", use(_hostname), use(_path), use(_date), use(_time); *_logWarningStatement <<"INSERT INTO warnings VALUES " - <<"(:urlId, :boldUrl, :abbrUrl, :strength, :whitelist)", - use(_lastRowId), use(_blacklistMatch); + <<"(:urlId, :boldUrl, :abbrUrl, :strength, :whitelist, :uid)", + use(_lastRowId), use(_blacklistMatch), use(_uid) ; *_logMatchStatement <<"INSERT INTO matches VALUES " <<"(:urlId, :keyword, :category, :strength)", use(_lastRowId), use(_keyword), use(_category), use(_strength); @@ -121,12 +121,13 @@ -void Database::logWarning(BlacklistMatch match) +void Database::logWarning(BlacklistMatch match, int uid) { const int FINISHED = 10; for (int i = 0; i <= FINISHED; i++) { try { - _blacklistMatch = match; + _blacklistMatch = match; + _uid = uid; _logWarningStatement->execute(); logMatch(match); i = FINISHED; Modified: branches/multiuser/src/Sniffer.cpp =================================================================== --- branches/multiuser/src/Sniffer.cpp 2012-04-18 18:52:48 UTC (rev 273) +++ branches/multiuser/src/Sniffer.cpp 2012-04-18 20:26:09 UTC (rev 274) @@ -68,8 +68,8 @@ -void Sniffer::logWarning(BlacklistMatch match) { - _instance->_db->logWarning(match); +void Sniffer::logWarning(BlacklistMatch match, ip_info addrs) { + _instance->_db->logWarning(match, addrs); } Modified: branches/multiuser/src/SnifferThread.cpp =================================================================== --- branches/multiuser/src/SnifferThread.cpp 2012-04-18 18:52:48 UTC (rev 273) +++ branches/multiuser/src/SnifferThread.cpp 2012-04-18 20:26:09 UTC (rev 274) @@ -77,6 +77,7 @@ const u_char *pkt_data; BlacklistMatch match; HTTPRequest request; + int uid; request.setChunkedTransferEncoding(true); bool isMatch, isDebugging = Application::instance().config().getBool("debug", false); @@ -86,14 +87,14 @@ if (res == 0) continue; - gotPacket(header, pkt_data, request); + gotPacket(header, pkt_data, request, addrs); if (request.empty()) throw Poco::Exception("No message found"); isMatch = _filter->isMatch(request, match); Sniffer::logUrl(request); if (isMatch) - Sniffer::logWarning(match); + Sniffer::logWarning(match, uid); if (isDebugging) *_logStream <<isMatch <<endl; @@ -115,7 +116,7 @@ void SnifferThread::gotPacket(const struct pcap_pkthdr *header, - const u_char *packet, HTTPRequest& request) + const u_char *packet, HTTPRequest& request, int& uid) { request.clear(); /* declare pointers to packet headers */ @@ -123,10 +124,12 @@ const struct sniff_ip *ip; /* The IP header */ const struct sniff_tcp *tcp; /* The TCP header */ const char *payload; /* Packet payload */ - + UID int size_ip, size_tcp, size_payload; + src_addr; + dest_addr; /* define ethernet header */ ethernet = (struct sniff_ethernet*)(packet); @@ -158,6 +161,10 @@ istringstream istr(payload); request.read(istr); + src_addr = ip->ip_src.s_addr; + dest_addr = ip->ip_dest.s_addr; + UID uidGet = UID(src_addr, dest_addr); + uid = uidGet.get_int(); } catch (Poco::Exception &err) { request.clear(); Added: branches/multiuser/src/UID.cpp =================================================================== --- branches/multiuser/src/UID.cpp (rev 0) +++ branches/multiuser/src/UID.cpp 2012-04-18 20:26:09 UTC (rev 274) @@ -0,0 +1,90 @@ +#include "UID.h" + +UID::UID(unsigned int srcAddress, unsigned int destAddress) +{ + uidInt = get_uid_from_netlink(destAddress, srcAddress); +}; + +int UID::get_uid_from_netlink(unsigned int destAddress, unsigned int srcAddress) +{ + vector<TCPConnection>::iterator it; + get_tcp_from_netlink(); + for (it = this->tcpConnectionList.begin(); it < this->tcpConnectionList.end(); it++) + { + //cout << it->uid << endl; + if (it->destAddress == destAddress && it->srcAddress == srcAddress) + { + cout << "match:" << endl; + cout << it->uid << endl; + return it->uid; + } + } + return 0; + +}; + +int UID::really_add(TCPConnection connection) + { + this->tcpConnectionList.push_back(connection); + return 0; + } + +int UID::add_to_connection_cache(const struct nlmsghdr *nlh, void *data) +{ + cout << "adding connection" << endl; + vector<TCPConnection>* connList = (vector<TCPConnection>*)data; + TCPConnection connection; + struct in_addr addr; + addr.s_addr = connection.srcAddress; + inet_diag_msg *r = (struct inet_diag_msg*)mnl_nlmsg_get_payload(nlh); + connection.uid = r->idiag_uid; + inet_diag_sockid id = r->id; + connection.destAddress = *id.idiag_dst; + connection.srcAddress = *id.idiag_src; + cout << inet_ntoa(addr) << endl; + cout << connection.destAddress<< endl; + cout << connection.uid << endl; + connList->push_back(connection); + return MNL_CB_OK; +}; + +int UID::get_tcp_from_netlink() +{ + //Declarations + int ret; + unsigned int portid; + char buf[MNL_SOCKET_BUFFER_SIZE]; + + //open socket + mnl_socket* sock = mnl_socket_open(NETLINK_INET_DIAG); + mnl_socket_bind(sock, 0, MNL_SOCKET_AUTOPID); + portid = mnl_socket_get_portid(sock); + //Create message + struct nlmsghdr *nlh = mnl_nlmsg_put_header(buf); + nlh->nlmsg_type = TCPDIAG_GETSOCK; + nlh->nlmsg_flags = NLM_F_ROOT|NLM_F_MATCH|NLM_F_REQUEST; + //Add inet_diag specific stuff + struct inet_diag_req *req = (inet_diag_req*)mnl_nlmsg_put_extra_header(nlh, sizeof(*req)); + req->idiag_family = AF_INET; + req->idiag_states = SS_ALL; + req->idiag_ext |= (1<<(INET_DIAG_INFO-1)); + + //send message + if (mnl_socket_sendto(sock, nlh, nlh->nlmsg_len) < 0) { + //This needs to be something different + //We can't just exit if sending the message doesn't work + exit(EXIT_FAILURE); + } + //Receive the response from inet_diag + ret = mnl_socket_recvfrom(sock, buf, sizeof(buf)); + ret = mnl_cb_run(buf, ret, 0, portid, add_to_connection_cache, (void*) &this->tcpConnectionList); + //close the socket + mnl_socket_close(sock); + return 0; +}; + + +int UID::get_uid_int() +{ + return this->uidInt; +}; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mpn...@us...> - 2012-04-18 18:52:54
|
Revision: 273 http://responsibility.svn.sourceforge.net/responsibility/?rev=273&view=rev Author: mpnordland Date: 2012-04-18 18:52:48 +0000 (Wed, 18 Apr 2012) Log Message: ----------- Modified Paths: -------------- branches/multiuser/Socket_fun/Socket_fun/Socket_fun.cbp branches/multiuser/Socket_fun/Socket_fun/Socket_fun.depend branches/multiuser/Socket_fun/Socket_fun/Socket_fun.layout branches/multiuser/Socket_fun/Socket_fun/bin/Debug/Socket_fun branches/multiuser/Socket_fun/Socket_fun/include/UID.h branches/multiuser/Socket_fun/Socket_fun/main.cpp branches/multiuser/Socket_fun/Socket_fun/src/UID.cpp Modified: branches/multiuser/Socket_fun/Socket_fun/Socket_fun.cbp =================================================================== (Binary files differ) Modified: branches/multiuser/Socket_fun/Socket_fun/Socket_fun.depend =================================================================== --- branches/multiuser/Socket_fun/Socket_fun/Socket_fun.depend 2012-04-15 00:13:33 UTC (rev 272) +++ branches/multiuser/Socket_fun/Socket_fun/Socket_fun.depend 2012-04-18 18:52:48 UTC (rev 273) @@ -18,22 +18,22 @@ 1329588345 source:/home/micah/Documents/C++/Socket_fun/Socket_fun/src/UID.cpp "UID.h" -1329787952 source:/home/micah/Documents/C++/responsibility/branches/multiuser/Socket_fun/Socket_fun/src/UID.cpp +1334774147 source:/home/micah/Documents/C++/responsibility/branches/multiuser/Socket_fun/Socket_fun/src/UID.cpp "UID.h" -1329787890 /home/micah/Documents/C++/responsibility/branches/multiuser/Socket_fun/Socket_fun/include/UID.h +1334773764 /home/micah/Documents/C++/responsibility/branches/multiuser/Socket_fun/Socket_fun/include/UID.h <cstdlib> <iostream> <sys/socket.h> <netinet/in.h> - <errno.h> <cstring> <linux/netlink.h> <vector> - <netinet/tcp.h> <linux/inet_diag.h> "Poco/Timestamp.h" + <libmnl/libmnl.h> + <arpa/inet.h> -1329787970 source:/home/micah/Documents/C++/responsibility/branches/multiuser/Socket_fun/Socket_fun/main.cpp +1334773501 source:/home/micah/Documents/C++/responsibility/branches/multiuser/Socket_fun/Socket_fun/main.cpp "UID.h" Modified: branches/multiuser/Socket_fun/Socket_fun/Socket_fun.layout =================================================================== (Binary files differ) Modified: branches/multiuser/Socket_fun/Socket_fun/bin/Debug/Socket_fun =================================================================== (Binary files differ) Modified: branches/multiuser/Socket_fun/Socket_fun/include/UID.h =================================================================== --- branches/multiuser/Socket_fun/Socket_fun/include/UID.h 2012-04-15 00:13:33 UTC (rev 272) +++ branches/multiuser/Socket_fun/Socket_fun/include/UID.h 2012-04-18 18:52:48 UTC (rev 273) @@ -2,13 +2,13 @@ #include <iostream> #include <sys/socket.h> #include <netinet/in.h> -#include <errno.h> #include <cstring> #include <linux/netlink.h> #include <vector> -#include <netinet/tcp.h> #include <linux/inet_diag.h> #include "Poco/Timestamp.h" +#include <libmnl/libmnl.h> +#include <arpa/inet.h> using namespace std; @@ -43,8 +43,9 @@ private: int uidInt; int get_uid_from_netlink(unsigned int destAddress, unsigned int srcAddress); - vector<TCPConnection> get_tcp_from_netlink(); - TCPConnection pack_connections(struct inet_diag_msg *r); - + vector<TCPConnection> tcpConnectionList; + int get_tcp_from_netlink(); + static int add_to_connection_cache(const struct nlmsghdr *nlh, void *data); + int really_add(TCPConnection connection); }; Modified: branches/multiuser/Socket_fun/Socket_fun/main.cpp =================================================================== --- branches/multiuser/Socket_fun/Socket_fun/main.cpp 2012-04-15 00:13:33 UTC (rev 272) +++ branches/multiuser/Socket_fun/Socket_fun/main.cpp 2012-04-18 18:52:48 UTC (rev 273) @@ -2,7 +2,7 @@ int main() { - UID user(192168167,7214204100); + UID user(3232235841,1783218861); cout << "The user is:" << user.get_uid_int() << endl; return 0; }; Modified: branches/multiuser/Socket_fun/Socket_fun/src/UID.cpp =================================================================== --- branches/multiuser/Socket_fun/Socket_fun/src/UID.cpp 2012-04-15 00:13:33 UTC (rev 272) +++ branches/multiuser/Socket_fun/Socket_fun/src/UID.cpp 2012-04-18 18:52:48 UTC (rev 273) @@ -7,128 +7,84 @@ int UID::get_uid_from_netlink(unsigned int destAddress, unsigned int srcAddress) { - vector<TCPConnection> tcpConnectionList = get_tcp_from_netlink(); - cout << (tcpConnectionList[0]).destAddress << endl; + vector<TCPConnection>::iterator it; + get_tcp_from_netlink(); + for (it = this->tcpConnectionList.begin(); it < this->tcpConnectionList.end(); it++) + { + //cout << it->uid << endl; + if (it->destAddress == destAddress && it->srcAddress == srcAddress) + { + cout << "match:" << endl; + cout << it->uid << endl; + return it->uid; + } + } return 0; }; -TCPConnection UID::pack_connections(struct inet_diag_msg *r) +int UID::really_add(TCPConnection connection) + { + this->tcpConnectionList.push_back(connection); + return 0; + } + +int UID::add_to_connection_cache(const struct nlmsghdr *nlh, void *data) { - TCPConnection *connection = new TCPConnection; - connection->uid = r->idiag_uid; + cout << "adding connection" << endl; + vector<TCPConnection>* connList = (vector<TCPConnection>*)data; + TCPConnection connection; + struct in_addr addr; + addr.s_addr = connection.srcAddress; + inet_diag_msg *r = (struct inet_diag_msg*)mnl_nlmsg_get_payload(nlh); + connection.uid = r->idiag_uid; inet_diag_sockid id = r->id; - connection->destAddress = htonl(*id.idiag_dst); - connection->srcAddress = htonl(*id.idiag_src); - - return *connection; + connection.destAddress = *id.idiag_dst; + connection.srcAddress = *id.idiag_src; + cout << inet_ntoa(addr) << endl; + cout << connection.destAddress<< endl; + cout << connection.uid << endl; + connList->push_back(connection); + return MNL_CB_OK; }; -vector<TCPConnection> UID::get_tcp_from_netlink() +int UID::get_tcp_from_netlink() { - int fd; - struct sockaddr_nl nladdr; - struct { - struct nlmsghdr nlh; - struct inet_diag_req r; - } req; + //Declarations + int ret; + unsigned int portid; + char buf[MNL_SOCKET_BUFFER_SIZE]; - struct msghdr msg; - char buf[8192]; - iovec iov[2]; - vector<TCPConnection> tcpConnectionList; - TCPConnection* connection; + //open socket + mnl_socket* sock = mnl_socket_open(NETLINK_INET_DIAG); + mnl_socket_bind(sock, 0, MNL_SOCKET_AUTOPID); + portid = mnl_socket_get_portid(sock); + //Create message + struct nlmsghdr *nlh = mnl_nlmsg_put_header(buf); + nlh->nlmsg_type = TCPDIAG_GETSOCK; + nlh->nlmsg_flags = NLM_F_ROOT|NLM_F_MATCH|NLM_F_REQUEST; + //Add inet_diag specific stuff + struct inet_diag_req *req = (inet_diag_req*)mnl_nlmsg_put_extra_header(nlh, sizeof(*req)); + req->idiag_family = AF_INET; + req->idiag_states = SS_ALL; + req->idiag_ext |= (1<<(INET_DIAG_INFO-1)); - fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_INET_DIAG) - //TODO: use exceptions here - cout << "test"<<endl; - - memset(&nladdr, 0, sizeof(nladdr)); - nladdr.nl_family = AF_NETLINK; - - req.nlh.nlmsg_len = sizeof(req); - req.nlh.nlmsg_type = TCPDIAG_GETSOCK; - req.nlh.nlmsg_flags = NLM_F_ROOT|NLM_F_MATCH|NLM_F_REQUEST; - req.nlh.nlmsg_pid = 0; - req.nlh.nlmsg_seq = 123456; - memset(&req.r, 0, sizeof(req.r)); - req.r.idiag_family = AF_INET; - req.r.idiag_states = SS_ALL; - - req.r.idiag_ext |= (1<<(INET_DIAG_INFO-1)); - - iov[0].iov_base = &req; - iov[0].iov_len = sizeof req; - - - msg.msg_name = (void*)&nladdr; - msg.msg_namelen = sizeof(nladdr); - msg.msg_iov = iov; - msg.msg_iovlen = 1; - - - if (sendmsg(fd, &msg, 0) < 0) - //TODO: use exceptions here - cout << "there was a problem with sending a the message FIXME: use exceptions here"<<endl; - iov[0].iov_base = buf; - iov[0].iov_len = sizeof(buf); - - while (1) { - int status; - struct nlmsghdr *h; - - msg.msg_name = (void*)&nladdr; - msg.msg_namelen = sizeof(nladdr); - msg.msg_iov = iov; - msg.msg_iovlen = 1; - msg.msg_control = NULL; - msg.msg_controllen = 0; - msg.msg_flags = 0; - - status = recvmsg(fd, &msg, 0); - - if (status < 0) { - if (errno == EINTR) - continue; - //TODO: use exceptions here, make sure it isn't messing up the loop, or not reporting errors - cout<<"OVERRUN"<<endl; - continue; - } - if (status == 0) { - //TODO: use exceptions here - cout << "EOF on netlink"<< endl; - } - - h = (struct nlmsghdr*)buf; - while (NLMSG_OK(h, status)) { - struct inet_diag_msg *r = (struct inet_diag_msg*) NLMSG_DATA(h); - - if (/*h->nlmsg_pid != rth->local.nl_pid ||*/ - h->nlmsg_seq != 123456) - //TODO: See if there isn't a possible way to remove this. I tried and I ended up with a never ending loop. - goto skip_it; - - if (h->nlmsg_type == NLMSG_DONE) - cout << "NMSG_DONE received"<<endl; - return tcpConnectionList; - - if (h->nlmsg_type == NLMSG_ERROR) - return tcpConnectionList; - - *connection = pack_connections(r); - tcpConnectionList.push_back(*connection); - - - skip_it: - { - h = NLMSG_NEXT(h, status); - } - }; - }; - return tcpConnectionList; + //send message + if (mnl_socket_sendto(sock, nlh, nlh->nlmsg_len) < 0) { + //This needs to be something different + //We can't just exit if sending the message doesn't work + exit(EXIT_FAILURE); + } + //Receive the response from inet_diag + ret = mnl_socket_recvfrom(sock, buf, sizeof(buf)); + ret = mnl_cb_run(buf, ret, 0, portid, add_to_connection_cache, (void*) &this->tcpConnectionList); + //close the socket + mnl_socket_close(sock); + return 0; }; + int UID::get_uid_int() { - return uidInt; + return this->uidInt; }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rog...@us...> - 2012-04-15 00:13:39
|
Revision: 272 http://responsibility.svn.sourceforge.net/responsibility/?rev=272&view=rev Author: roggan87 Date: 2012-04-15 00:13:33 +0000 (Sun, 15 Apr 2012) Log Message: ----------- Added two more CLI options: --force-sniffer (Will override any other instance of NR and keep running as sniffer) --update-files (Updates the config and blacklist files from the server) Modified Paths: -------------- trunk/include/Request.h trunk/include/SnifferSubsystem.h trunk/src/Filter.cpp trunk/src/MainApplication.cpp trunk/src/Options.cpp trunk/src/Request.cpp trunk/src/SnifferSubsystem.cpp Modified: trunk/include/Request.h =================================================================== --- trunk/include/Request.h 2012-04-14 15:16:35 UTC (rev 271) +++ trunk/include/Request.h 2012-04-15 00:13:33 UTC (rev 272) @@ -86,12 +86,27 @@ static string sendImprovementData(Options* options, string impData); /// Send the improvement data to the server. It's given in impData. - static bool modifiedFilesUpdate(Options* options); - /// Update the config file and blacklist if they're modified. + static bool updateConfig(Options* options, bool doForce = false); + /// Updates the config file from the server if it's modifed or doForce + /// is true. Returns true if the file was updated. + static bool updateBlacklist(Options* options, bool doForce = false); + /// Updates the blacklist file from the server if it's modifed or + /// doForce is true. Returns true if the file was updated. + + static int configDownloaded; + /// The last time the config file was downloaded from the server. Used + /// to determine if the file has been modified. + + static int blacklistDownloaded; + /// The last time the blacklists were downloaded from the server. Used + /// to determine if the file has been modified. + private: static string send(Options *options, string uriPath, - string filePath = "", string morePostVars = ""); + string filePath = "", string morePostVars = ""); + + static void setDownloadedTime(Options *options); }; } // namespace NetResponsibility Modified: trunk/include/SnifferSubsystem.h =================================================================== --- trunk/include/SnifferSubsystem.h 2012-04-14 15:16:35 UTC (rev 271) +++ trunk/include/SnifferSubsystem.h 2012-04-15 00:13:33 UTC (rev 272) @@ -40,6 +40,7 @@ #include "Poco/File.h" #include "Poco/Logger.h" #include "Poco/Process.h" +#include "Poco/Thread.h" #include <iostream> namespace NetResponsibility { @@ -48,6 +49,7 @@ using ::Poco::Util::Subsystem; using ::Poco::File; using ::Poco::Logger; +using ::Poco::Thread; using namespace ::std; class SnifferSubsystem: public ::Poco::Util::Subsystem Modified: trunk/src/Filter.cpp =================================================================== --- trunk/src/Filter.cpp 2012-04-14 15:16:35 UTC (rev 271) +++ trunk/src/Filter.cpp 2012-04-15 00:13:33 UTC (rev 272) @@ -57,7 +57,12 @@ void Filter::loadBlacklist(Options *options, Database *db) { for (int moreTries = 3; moreTries > 0; moreTries--) { - try { + try { + // Update the blacklist if it's modified + bool doUpdate = Application::instance().config().getBool("update-files", false); + Request::updateBlacklist(options, doUpdate); + + // Load it AutoPtr<MyXml> xmlBlacklist (new MyXml(options->getBlacklistFile())); _blacklist = xmlBlacklist->getBlacklist(); _extensions = xmlBlacklist->getExtensions(); Modified: trunk/src/MainApplication.cpp =================================================================== --- trunk/src/MainApplication.cpp 2012-04-14 15:16:35 UTC (rev 271) +++ trunk/src/MainApplication.cpp 2012-04-15 00:13:33 UTC (rev 272) @@ -154,8 +154,12 @@ config().setBool("config", true); else if (name == "debug") config().setBool("debug", true); + else if (name == "update-files") + config().setBool("update-files", true); else if (name == "no-sniffer") - config().setBool("sniffer", false); + config().setBool("sniffer", false); + else if (name == "force-sniffer") + config().setBool("force-sniffer", true); else if (name == "no-rotate") config().setBool("rotate", false); else if (name == "install") { @@ -247,6 +251,13 @@ .binding("password")); options.addOption( + Option("update-files", "uf", "Update user specific files from the server") + .required(false) + .repeatable(false) + .callback(OptionCallback<MainApplication> + (this, &MainApplication::setOption))); + + options.addOption( Option("logfile", "l", "Log messages to the specified file") .required(false) .repeatable(false) @@ -261,6 +272,13 @@ (this, &MainApplication::setOption))); options.addOption( + Option("force-sniffer", "fs", "Supersede existing instances of Net Responsibility") + .required(false) + .repeatable(false) + .callback(OptionCallback<MainApplication> + (this, &MainApplication::setOption))); + + options.addOption( Option("no-rotate", "nr", "Do not rotate the log (for debugging)") .required(false) .repeatable(false) Modified: trunk/src/Options.cpp =================================================================== --- trunk/src/Options.cpp 2012-04-14 15:16:35 UTC (rev 271) +++ trunk/src/Options.cpp 2012-04-15 00:13:33 UTC (rev 272) @@ -208,6 +208,7 @@ void Options::loadConfigfile() { + bool doUpdate = Application::instance().config().getBool("update-files", false); for (int moreTries = 3; moreTries > 0; moreTries--) { try { AutoPtr<MyXml> xmlConfig (new MyXml(_configfile)); @@ -228,8 +229,10 @@ _saveHistory = isAttachedReportPart("history_hostnames") || isAttachedReportPart("history_paths"); - if (!Request::modifiedFilesUpdate(this)) - moreTries = 0; + if (!Request::updateConfig(this, doUpdate)) + moreTries = 0; + else + doUpdate = false; } catch (::Poco::FileNotFoundException &err) { Application::instance().config().setBool("config", true); Modified: trunk/src/Request.cpp =================================================================== --- trunk/src/Request.cpp 2012-04-14 15:16:35 UTC (rev 271) +++ trunk/src/Request.cpp 2012-04-15 00:13:33 UTC (rev 272) @@ -20,16 +20,20 @@ #include "Request.h" namespace NetResponsibility { + + +int Request::configDownloaded = -1; +int Request::blacklistDownloaded = -1; - void Request::addMac(Options *options, string password) { Application::instance().logger().information("Downloading configuration file"); if (password == "") send(options, "/request/add_mac.php", options->getConfigfile()); else send(options, "/request/add_mac.php", options->getConfigfile(), - "online_password=" + password); + "online_password=" + password); + setDownloadedTime(options); } @@ -40,14 +44,16 @@ send(options, "/request/config.php", options->getConfigfile()); else send(options, "/request/config.php", options->getConfigfile(), - "online_password=" + password); + "online_password=" + password); + setDownloadedTime(options); } void Request::downloadBlacklist(Options *options) { Application::instance().logger().information("Downloading blacklists"); - send(options, "/request/blacklist.php", options->getBlacklistFile()); + send(options, "/request/blacklist.php", options->getBlacklistFile()); + setDownloadedTime(options); } @@ -56,36 +62,56 @@ impData = "warnings=" + impData; return send(options, "/request/add_improve_data.php", "", impData); } + +bool Request::updateConfig(Options *options, bool doForce) { + try { + if (configDownloaded == -1) + setDownloadedTime(options); + + // Determine what time the config file was edited last + Timestamp ft = File(options->getConfigfile()).getLastModified(); + if (ft.epochTime() > (configDownloaded + 15)) { + downloadConfig(options); + options->getInitBypasses().addRow(BYPASS_MODIFIED_FILE, "Config file"); + return true; + } + else if (doForce) { + downloadConfig(options); + return true; + } + else + return false; + } + catch (Exception& exc) { + Application::instance().logger().debug(exc.displayText()); + return false; + } +} + -bool Request::modifiedFilesUpdate(Options *options) { - try { - bool isModified = false; - string downloaded = send(options, "/request/downloaded.php"); - stringstream ss(downloaded); - AutoPtr<XMLConfiguration> xml(new XMLConfiguration(ss)); - if (downloaded != "") { - //Check configfile - int downloadedInt; - downloadedInt = xml->getInt("config", 0); - Timestamp ft = File(options->getConfigfile()).getLastModified(); - if (ft.epochTime() > (downloadedInt + 15)) { - downloadConfig(options); - options->getInitBypasses().addRow(BYPASS_MODIFIED_FILE, "Config file"); - isModified = true; - } - //Check blacklist - downloadedInt = xml->getInt("blacklist", 0); - Timestamp ft2 = File(options->getBlacklistFile()).getLastModified(); - if (ft2.epochTime() > (downloadedInt + 15)) { - downloadBlacklist(options); - options->getInitBypasses().addRow(BYPASS_MODIFIED_FILE, "Blacklist"); - isModified = true; - } +bool Request::updateBlacklist(Options *options, bool doForce) { + try { + if (blacklistDownloaded == -1) + setDownloadedTime(options); + + // Determine what time the blacklist file was edited last + Timestamp ft = File(options->getBlacklistFile()).getLastModified(); + if (ft.epochTime() > (blacklistDownloaded + 15)) { + downloadBlacklist(options); + // This won't get caught as a bypass, but maybe it doesn't have to + // either, as long as we get the correct blacklist? + options->getInitBypasses().addRow(BYPASS_MODIFIED_FILE, "Blacklist file"); + return true; + } + else if (doForce) { + downloadBlacklist(options); + return true; } - return isModified; + else + return false; } catch (Exception& exc) { Application::instance().logger().debug(exc.displayText()); @@ -141,5 +167,22 @@ } } +void Request::setDownloadedTime(Options *options) { + try { + // Get values from server + string downloaded = send(options, "/request/downloaded.php"); + stringstream ss(downloaded); + // Parse XML file + AutoPtr<XMLConfiguration> xml(new XMLConfiguration(ss)); + if (downloaded != "") { + // Read values and set them accordingly + configDownloaded = xml->getInt("config", 0); + blacklistDownloaded = xml->getInt("blacklist", 0); + } + } + catch (Exception& exc) { + Application::instance().logger().debug(exc.displayText()); + } +} } // namespace NetResponsibility Modified: trunk/src/SnifferSubsystem.cpp =================================================================== --- trunk/src/SnifferSubsystem.cpp 2012-04-14 15:16:35 UTC (rev 271) +++ trunk/src/SnifferSubsystem.cpp 2012-04-15 00:13:33 UTC (rev 272) @@ -62,11 +62,22 @@ } #if defined(POCO_OS_FAMILY_UNIX) if (oldPid != currentPid && kill(oldPid, 0) == 0) { - _logger->warning("Other instance found"); - return false; + if (Application::instance().config().getBool("force-sniffer", false)) { + kill(oldPid, SIGINT); + _logger->warning("NOTE: This instance is the only one running. When " + "you end this, no sniffer will be running."); + // Give time to shut down the old instance. + while (kill(oldPid, 0) == 0) { + ::Poco::Thread::sleep(500); + } + } + else { + _logger->warning("Other instance found"); + return false; + } } +#endif MainApplication::getDatabase().logSessionStart(); -#endif ofstream f(pidfile.c_str(), ios::out); f << currentPid; f.close(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rog...@us...> - 2012-04-14 15:16:41
|
Revision: 271 http://responsibility.svn.sourceforge.net/responsibility/?rev=271&view=rev Author: roggan87 Date: 2012-04-14 15:16:35 +0000 (Sat, 14 Apr 2012) Log Message: ----------- Added two CLI options: --no-rotate (Tells NR to not delete stored data when sending the report) --version (Outputs the current installed version of NR) Modified Paths: -------------- trunk/include/MainApplication.h trunk/src/MainApplication.cpp trunk/src/ReportBase.cpp Modified: trunk/include/MainApplication.h =================================================================== --- trunk/include/MainApplication.h 2012-04-14 15:12:58 UTC (rev 270) +++ trunk/include/MainApplication.h 2012-04-14 15:16:35 UTC (rev 271) @@ -25,11 +25,7 @@ #ifndef MAINAPPLICATION_H #define MAINAPPLICATION_H -/* -namespace Poco { - using namespace NetResponsibility; -} -*/ + #define STRINGIFY(path, file) #path #file #define CONCAT(x, y) STRINGIFY(x, y) @@ -156,6 +152,8 @@ void displayHelp(); + void displayVersion(const string& name, const string& value); + void checkForRoot(); /// Checks if the user who started the program is having enough /// priviligues. In Linux you'll need to be running Net Responsibility Modified: trunk/src/MainApplication.cpp =================================================================== --- trunk/src/MainApplication.cpp 2012-04-14 15:12:58 UTC (rev 270) +++ trunk/src/MainApplication.cpp 2012-04-14 15:16:35 UTC (rev 271) @@ -156,6 +156,8 @@ config().setBool("debug", true); else if (name == "no-sniffer") config().setBool("sniffer", false); + else if (name == "no-rotate") + config().setBool("rotate", false); else if (name == "install") { config().setBool("config", true); config().setInt("report", REPORT_INSTALL); @@ -203,6 +205,13 @@ (this, &MainApplication::handleHelp))); options.addOption( + Option("version", "v", "Display the version of your installation") + .required(false) + .repeatable(false) + .callback(OptionCallback<MainApplication> + (this, &MainApplication::displayVersion))); + + options.addOption( Option("report", "r", "Manually send report") .required(false) .repeatable(false) @@ -249,6 +258,13 @@ .required(false) .repeatable(false) .callback(OptionCallback<MainApplication> + (this, &MainApplication::setOption))); + + options.addOption( + Option("no-rotate", "nr", "Do not rotate the log (for debugging)") + .required(false) + .repeatable(false) + .callback(OptionCallback<MainApplication> (this, &MainApplication::setOption))); } @@ -272,6 +288,13 @@ +void MainApplication::displayVersion(const string& name, const string& value) { + stopOptionsProcessing(); + cout <<"Net Responsibility "<<VERSION <<endl <<endl; + terminate(); +} + + void MainApplication::checkForRoot() { #if defined(POCO_OS_FAMILY_UNIX) if (getuid() != 0) { @@ -353,7 +376,6 @@ } return Application::EXIT_OK; } -//POCO_SERVER_MAIN(MainApplication) } // namespace NetResponsibility Modified: trunk/src/ReportBase.cpp =================================================================== --- trunk/src/ReportBase.cpp 2012-04-14 15:12:58 UTC (rev 270) +++ trunk/src/ReportBase.cpp 2012-04-14 15:16:35 UTC (rev 271) @@ -74,8 +74,9 @@ -void ReportBase::logFinish() { - _db->rotateLog(_reportId); +void ReportBase::logFinish() { + if (Application::instance().config().getBool("rotate", true)) + _db->rotateLog(_reportId); _db->logReportFinish(_reportId); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |