Index: head/net-mgmt/guifi-snpservices/Makefile =================================================================== --- head/net-mgmt/guifi-snpservices/Makefile (revision 411511) +++ head/net-mgmt/guifi-snpservices/Makefile (revision 411512) @@ -1,33 +1,36 @@ # Created by: Tassilo Philipp # $FreeBSD$ PORTNAME= snpservices -DISTVERSION= 0.2.2-5 +DISTVERSION= 0.2.2-8 CATEGORIES= net-mgmt www MASTER_SITES= http://serveis.guifi.net/debian/guifi/ \ http://www.potion-studios.com/ PKGNAMEPREFIX= guifi- DISTNAME= ${PORTNAME}_${DISTVERSION} MAINTAINER= tphilipp@potion-studios.com COMMENT= Graphics server for the guifi.net meshnet RUN_DEPENDS= mrtg:${PORTSDIR}/net-mgmt/mrtg \ rrdtool:${PORTSDIR}/databases/rrdtool USE_PHP= gd simplexml dom SNPSERVICES_TMPDIR?= /var/tmp/${PORTNAME} SUB_FILES= pkg-install pkg-deinstall pkg-message SUB_LIST= SNPSERVICES_TMPDIR=${SNPSERVICES_TMPDIR} WRKSRC= ${WRKDIR}/${PORTNAME}-0.2.2 NO_BUILD= yes + +post-patch: + @${FIND} ${WRKSRC} -name \*.orig -delete; do-install: ${MKDIR} ${STAGEDIR}${WWWDIR} (cd ${WRKSRC} \ && ${COPYTREE_SHARE} \* ${STAGEDIR}${WWWDIR}) ${FIND} ${STAGEDIR}${WWWDIR} -type f -exec ${CHMOD} 644 '{}' + .include Index: head/net-mgmt/guifi-snpservices/distinfo =================================================================== --- head/net-mgmt/guifi-snpservices/distinfo (revision 411511) +++ head/net-mgmt/guifi-snpservices/distinfo (revision 411512) @@ -1,2 +1,2 @@ -SHA256 (snpservices_0.2.2-5.tar.gz) = b08d003221d9d5ad688602a973838a0f83b1c99022a11c1ed08a520de8debb51 -SIZE (snpservices_0.2.2-5.tar.gz) = 185825 +SHA256 (snpservices_0.2.2-8.tar.gz) = a3d574d8bf080e03e201ecc23cb00dc79dafd57011f5f81a5ffa821ac3c8e5b5 +SIZE (snpservices_0.2.2-8.tar.gz) = 243830 Index: head/net-mgmt/guifi-snpservices/files/patch-common-refresh_mrtg.php =================================================================== --- head/net-mgmt/guifi-snpservices/files/patch-common-refresh_mrtg.php (revision 411511) +++ head/net-mgmt/guifi-snpservices/files/patch-common-refresh_mrtg.php (nonexistent) @@ -1,11 +0,0 @@ ---- common/refresh_mrtg.php.orig 2014-04-10 12:44:08.000000000 +0000 -+++ common/refresh_mrtg.php 2014-04-10 12:44:27.000000000 +0000 -@@ -29,7 +29,7 @@ - - echo "Getting MRTG CSV file\n"; - $hcnml = @fopen($MRTGConfigSource, "r"); -- $wcnml = @fopen("../data/guifi_mrtg.csv", "w"); -+ $wcnml = @fopen("/var/tmp/snpservices/data/guifi_mrtg.csv", "w"); - while (!feof($hcnml)) { - $buffer = fgets($hcnml, 4096); - fwrite($wcnml,$buffer); Property changes on: head/net-mgmt/guifi-snpservices/files/patch-common-refresh_mrtg.php ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/net-mgmt/guifi-snpservices/files/patch-common-ping.sh =================================================================== --- head/net-mgmt/guifi-snpservices/files/patch-common-ping.sh (revision 411511) +++ head/net-mgmt/guifi-snpservices/files/patch-common-ping.sh (revision 411512) @@ -1,22 +1,22 @@ ---- ./common/ping.sh.orig 2014-02-21 15:53:13.000000000 +0000 -+++ ./common/ping.sh 2014-04-10 14:19:56.000000000 +0000 +--- ./common/ping.sh.orig 2015-05-22 23:50:50.000000000 +0100 ++++ ./common/ping.sh 2016-01-31 18:07:24.559136016 +0000 @@ -1,15 +1,15 @@ #!/bin/sh - PING="/bin/ping" + PING="/sbin/ping" ADDR=$1 - DATA=`$PING -c5 -i 0.2 $ADDR -q -W 4` + DATA=`$PING -c 5 -i 0.2 -q -W 4 $ADDR` LOSS=`echo $DATA | awk '{print $18 }' | tr -d %` ERRORS=`echo $DATA | awk '{print $19 }' | tr -d %` - if [ $ERRORS = "errors," ] + if [ "$ERRORS" = "errors," ] then LOSS=`echo $DATA | awk '{print $20 }' | tr -d %` fi echo $LOSS - if [ $LOSS = 100 ]; + if [ "$LOSS" = 100 ]; then - echo 0 - else + echo 0 + echo ",$ADDR," >> /tmp/blacklist.snmp Index: head/net-mgmt/guifi-snpservices/files/patch-graphs-mrtgcsv2mrtgcfg.php =================================================================== --- head/net-mgmt/guifi-snpservices/files/patch-graphs-mrtgcsv2mrtgcfg.php (revision 411511) +++ head/net-mgmt/guifi-snpservices/files/patch-graphs-mrtgcsv2mrtgcfg.php (revision 411512) @@ -1,24 +1,40 @@ ---- graphs/mrtgcsv2mrtgcfg.php.orig 2014-02-21 15:53:13.000000000 +0000 -+++ graphs/mrtgcsv2mrtgcfg.php 2014-04-10 12:35:33.000000000 +0000 -@@ -1,9 +1,9 @@ +--- ./graphs/mrtgcsv2mrtgcfg.php.orig 2015-06-16 21:14:01.000000000 +0100 ++++ ./graphs/mrtgcsv2mrtgcfg.php 2016-01-31 18:18:04.779135280 +0000 +@@ -1,20 +1,20 @@ /tmp/mrtg.blacklisted.csv'); ++ system('/usr/bin/grep -vf /tmp/blacklist.ips /tmp/mrtg.csv > /tmp/mrtg.blacklisted.csv'); + + $hf = @fopen('/tmp/mrtg.blacklisted.csv','r'); -$cf = @fopen('../data/mrtg.cfg','w+'); +$cf = @fopen('/var/tmp/snpservices/data/mrtg.cfg','w+'); fputs($cf,sprintf($rrdtool_header,$rrdimg_path,$rrdimg_path,$rrddb_path,$rrddb_path)); +@@ -96,8 +96,8 @@ + if ($argv[1]=="CACHE") { + if (file_exists('/tmp/blacklist.ips')) { + $blacklist_time = filemtime('/tmp/blacklist.ips'); +- if (file_exists('../data/mrtg.cfg')) { +- $mrtg_time = filemtime('../data/mrtg.cfg'); ++ if (file_exists('/var/tmp/snpservices/data/mrtg.cfg')) { ++ $mrtg_time = filemtime('/var/tmp/snpservices/data/mrtg.cfg'); + } else { + $mrtg_time = 0; + echo "No mrtg.cfg file present, refreshing...\n"; Index: head/net-mgmt/guifi-snpservices/files/pkg-message.in =================================================================== --- head/net-mgmt/guifi-snpservices/files/pkg-message.in (revision 411511) +++ head/net-mgmt/guifi-snpservices/files/pkg-message.in (revision 411512) @@ -1,31 +1,32 @@ POST-INSTALL CONFIGURATION FOR GUIFI SNPSERVICES ------------------------------------------------ 1) Install and/or configure a webserver of your choice to serve php files from %%WWWDIR%%/ (you also might have to increase your webserver's upstream timeout for certain requests 2) Edit %%WWWDIR%%/common/config.php.template and set $SNPGraphServerId to your service's ID (note, it's the *service*, NOT the "server" ID) 3) setup a cronjob to keep your graphs and stats up to date; for example: */30 * * * * root if [ -x %%WWWDIR%%/graphs ]; then cd %%WWWDIR%%/graphs; fi; if [ -x %%PREFIX%%/bin/php ] && [ -r %%WWWDIR%%/graphs/mrtgcsv2mrtgcfg.php ]; then env LANG=C %%PREFIX%%/bin/php mrtgcsv2mrtgcfg.php >> /var/log/snpservices_mrtgcfg.log 2>&1; fi */5 * * * * root if [ -x %%PREFIX%%/bin/mrtg ] && [ -r /var/tmp/snpservices/data/mrtg.cfg ]; then env LANG=C %%PREFIX%%/bin/mrtg /var/tmp/snpservices/data/mrtg.cfg --lock-file /var/tmp/mrtg/lockfile_guifi >> /var/log/snpservices_mrtg.log 2>&1; fi 4) consider logrotating /var/log/snpservices_*.log For more information, see various guifi.net doc pages, and related: + https://guifi.net/en/node/72593 http://es.wiki.guifi.net/wiki/Servidor_de_gr%C3%A1ficas http://es.wiki.guifi.net/wiki/Servidor_de_gr%C3%A1ficas_1 http://es.wiki.guifi.net/wiki/Servidor_de_gr%C3%A1ficas_2 http://www3.uji.es/~vrubert/guifi_linux/graph.html#slide1 http://es.wiki.guifi.net/wiki/Monitor http://guifi.net/ca/node/9071 ------------------------------------------------ Index: head/net-mgmt/guifi-snpservices/pkg-plist =================================================================== --- head/net-mgmt/guifi-snpservices/pkg-plist (revision 411511) +++ head/net-mgmt/guifi-snpservices/pkg-plist (revision 411512) @@ -1,55 +1,45 @@ %%WWWDIR%%/README -%%WWWDIR%%/common/cnml2ov2.php +%%WWWDIR%%/common/check_blacklist.php +%%WWWDIR%%/common/check_blacklist.sh %%WWWDIR%%/common/config.php.template -%%WWWDIR%%/common/config.php.template.orig +%%WWWDIR%%/common/get_snmpifaces.php %%WWWDIR%%/common/misc.php -%%WWWDIR%%/common/misc.php.orig -%%WWWDIR%%/common/mrtg.sh %%WWWDIR%%/common/ping.sh -%%WWWDIR%%/common/ping.sh.orig +%%WWWDIR%%/common/pping.sh %%WWWDIR%%/common/qnodes.php -%%WWWDIR%%/common/qnodes.php.orig %%WWWDIR%%/common/refresh.sh %%WWWDIR%%/common/refresh_cnml.php -%%WWWDIR%%/common/refresh_cnml.php.orig -%%WWWDIR%%/common/refresh_mrtg.php -%%WWWDIR%%/common/refresh_mrtg.php.orig %%WWWDIR%%/common/rrdtool.php +%%WWWDIR%%/common/snpservices.conf %%WWWDIR%%/debian/README.Debian %%WWWDIR%%/debian/changelog %%WWWDIR%%/debian/compat %%WWWDIR%%/debian/control %%WWWDIR%%/debian/copyright %%WWWDIR%%/debian/cron.d %%WWWDIR%%/debian/dirs %%WWWDIR%%/debian/docs %%WWWDIR%%/debian/rules %%WWWDIR%%/debian/snpservices.1 %%WWWDIR%%/debian/snpservices.config %%WWWDIR%%/debian/snpservices.install %%WWWDIR%%/debian/snpservices.logrotate %%WWWDIR%%/debian/snpservices.manpages %%WWWDIR%%/debian/snpservices.postinst %%WWWDIR%%/debian/snpservices.postrm %%WWWDIR%%/debian/snpservices.templates %%WWWDIR%%/debian/watch.ex %%WWWDIR%%/graphs/LICENSE.txt %%WWWDIR%%/graphs/cnml2mrtgcsv.php -%%WWWDIR%%/graphs/cnml2mrtgcsv.php.orig +%%WWWDIR%%/graphs/cnml2mrtgcsv_v2.php %%WWWDIR%%/graphs/config.php %%WWWDIR%%/graphs/graphs.php %%WWWDIR%%/graphs/mrtgcsv2mrtgcfg.php -%%WWWDIR%%/graphs/mrtgcsv2mrtgcfg.php.orig %%WWWDIR%%/graphs/refresh.php %%WWWDIR%%/index.php -%%WWWDIR%%/index.php.orig -%%WWWDIR%%/misc/xml2ov2.php %%WWWDIR%%/services/availability.php %%WWWDIR%%/services/example.php %%WWWDIR%%/services/graph.php %%WWWDIR%%/services/liveping.php %%WWWDIR%%/services/livetraceroute.php %%WWWDIR%%/services/stats.php -%%WWWDIR%%/tools/guinux/config.php.guinux -%%WWWDIR%%/tools/guinux/snpconfig.pl -%%WWWDIR%%/tools/guinux/snpservices.conf