View | Details | Raw Unified | Return to bug 218351 | Differences between
and this patch

Collapse All | Expand All

(-)Makefile (-9 / +16 lines)
Lines 2-8 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	librenms
4
PORTNAME=	librenms
5
PORTVERSION=	1.25
5
PORTVERSION=	1.26
6
PORTEPOCH=	1
6
PORTEPOCH=	1
7
CATEGORIES=	net-mgmt
7
CATEGORIES=	net-mgmt
8
8
Lines 15-30 Link Here
15
GH_ACCOUNT=	librenms
15
GH_ACCOUNT=	librenms
16
16
17
USES=		php:cli python shebangfix
17
USES=		php:cli python shebangfix
18
SHEBANG_FILES=	mibs/process.pl scripts/deploy-docs.sh scripts/ifAlias \
18
SHEBANG_FILES=	mibs/process.pl scripts/deploy-docs.sh \
19
		scripts/Migration/Standard_Conversion/convert_no_xml.sh \
19
		scripts/Migration/Standard_Conversion/convert_no_xml.sh \
20
		scripts/Migration/Standard_Conversion/destwork_no_xml.sh \
20
		scripts/Migration/Standard_Conversion/destwork_no_xml.sh \
21
		scripts/Migration/Standard_Conversion/mkdir.sh \
21
		scripts/Migration/Standard_Conversion/mkdir.sh \
22
		scripts/Migration/XML_Conversion/convert.sh \
22
		scripts/Migration/XML_Conversion/convert.sh \
23
		scripts/Migration/XML_Conversion/destwork.sh \
23
		scripts/Migration/XML_Conversion/destwork.sh \
24
		scripts/Migration/XML_Conversion/mkdir.sh validate.php \
24
		scripts/Migration/XML_Conversion/mkdir.sh \
25
		scripts/removespikes.php scripts/agent-local/nfs-stats.sh \
25
		scripts/removespikes.php scripts/agent-local/nfs-stats.sh \
26
		scripts/removespikes.pl scripts/watchmaillog/watchmaillog.pl
26
		scripts/removespikes.pl scripts/watchmaillog/watchmaillog.pl
27
USE_PHP=	ctype filter gd json mcrypt mysqli session snmp tokenizer xml
27
USE_PHP=	ctype curl filter gd hash json mcrypt mysqli openssl session simplexml snmp tokenizer xml
28
28
29
NO_BUILD=	yes
29
NO_BUILD=	yes
30
30
Lines 33-39 Link Here
33
		${LOCALBASE}/share/pear/Net/IPv4.php:net/pear-Net_IPv4 \
33
		${LOCALBASE}/share/pear/Net/IPv4.php:net/pear-Net_IPv4 \
34
		${LOCALBASE}/share/pear/Net/IPv6.php:net/pear-Net_IPv6 \
34
		${LOCALBASE}/share/pear/Net/IPv6.php:net/pear-Net_IPv6 \
35
		snmpget:net-mgmt/net-snmp \
35
		snmpget:net-mgmt/net-snmp \
36
		bash:shells/bash
36
		bash:shells/bash \
37
		sudo:security/sudo
37
38
38
OPTIONS_DEFINE=	APACHEMOD FPING IPMITOOL LIBVIRT MYSQLD NAGPLUGINS NMAP PYPOLLER WMIC DOCS EXAMPLES X11
39
OPTIONS_DEFINE=	APACHEMOD FPING IPMITOOL LIBVIRT MYSQLD NAGPLUGINS NMAP PYPOLLER WMIC DOCS EXAMPLES X11
39
OPTIONS_DEFAULT=	APACHEMOD FPING IPMITOOL LIBVIRT NAGPLUGINS NMAP PYPOLLER WMIC
40
OPTIONS_DEFAULT=	APACHEMOD FPING IPMITOOL LIBVIRT NAGPLUGINS NMAP PYPOLLER WMIC
Lines 64-75 Link Here
64
65
65
ROOT_FILES=	addhost.php adduser.php	alerts.php build-base.php build.sql \
66
ROOT_FILES=	addhost.php adduser.php	alerts.php build-base.php build.sql \
66
		billing-calculate.php \
67
		billing-calculate.php \
67
		check-services.php config_to_json.php daily.php daily.sh \
68
		check-services.php composer.json config_to_json.php cronic daily.php daily.sh \
68
		delhost.php discovery.php dist-pollers.php irc.php \
69
		delhost.php discovery-wrapper.py discovery.php dist-pollers.php irc.php \
69
		poll-billing.php poller.php poller-service.py poller-wrapper.py renamehost.php \
70
		mkdocs.yml pbin.sh phpunit.xml poll-billing.php poller.php poller-service.py \
71
		poller-wrapper.py readmegen.yml renamehost.php services-wrapper.py \
70
		snmp-scan.php snmptrap.php syslog.php validate.php
72
		snmp-scan.php snmptrap.php syslog.php validate.php
71
73
72
ROOT_DIRS=	LibreNMS contrib html includes lib mibs scripts sql-schema
74
ROOT_DIRS=	LibreNMS contrib doc html includes lib mibs misc scripts sql-schema tests vendor
73
75
74
DOCS=		AUTHORS.md CHANGELOG CONTRIBUTING.md LICENSE.txt README.md
76
DOCS=		AUTHORS.md CHANGELOG CONTRIBUTING.md LICENSE.txt README.md
75
PORTDOCS=	*
77
PORTDOCS=	*
Lines 102-107 Link Here
102
# Create empty rrd dir writable by www
104
# Create empty rrd dir writable by www
103
	@${MKDIR} ${STAGEDIR}/${WWWDIR}/rrd
105
	@${MKDIR} ${STAGEDIR}/${WWWDIR}/rrd
104
	@${CHMOD} 0775 ${STAGEDIR}/${WWWDIR}/rrd
106
	@${CHMOD} 0775 ${STAGEDIR}/${WWWDIR}/rrd
107
# Create empty logs dir
108
	@${MKDIR} ${STAGEDIR}/${WWWDIR}/logs
109
# Make daily.sh executable
110
	@${CHMOD} 0755 ${STAGEDIR}/${WWWDIR}/daily.sh
105
# Files in scripts dir should be executable
111
# Files in scripts dir should be executable
106
	@${FIND} ${STAGEDIR}/${WWWDIR}/scripts -type f -exec ${CHMOD} +x {} \;
112
	@${FIND} ${STAGEDIR}/${WWWDIR}/scripts -type f -exec ${CHMOD} +x {} \;
107
# Ensure PHP and Python scripts are executable
113
# Ensure PHP and Python scripts are executable
Lines 130-135 Link Here
130
	       ${STAGEDIR}/${WWWDIR}/config.php.sample
136
	       ${STAGEDIR}/${WWWDIR}/config.php.sample
131
	@${ECHO} @sample ${WWWDIR}/config.php.sample >> ${TMPPLIST}
137
	@${ECHO} @sample ${WWWDIR}/config.php.sample >> ${TMPPLIST}
132
	@${ECHO} @dir ${WWWDIR}/rrd >> ${TMPPLIST}
138
	@${ECHO} @dir ${WWWDIR}/rrd >> ${TMPPLIST}
139
	@${ECHO} @dir ${WWWDIR}/logs >> ${TMPPLIST}
133
	@${ECHO} @dir ${WWWDIR}/lib/influxdb-php/vendor/guzzlehttp/guzzle/build >> ${TMPPLIST}
140
	@${ECHO} @dir ${WWWDIR}/lib/influxdb-php/vendor/guzzlehttp/guzzle/build >> ${TMPPLIST}
134
	@${ECHO} @dir ${WWWDIR}/lib/influxdb-php/vendor/guzzlehttp/guzzle/docs >> ${TMPPLIST}
141
	@${ECHO} @dir ${WWWDIR}/lib/influxdb-php/vendor/guzzlehttp/guzzle/docs >> ${TMPPLIST}
135
	@${ECHO} @dir ${WWWDIR}/lib/influxdb-php/vendor/guzzlehttp/guzzle/tests >> ${TMPPLIST}
142
	@${ECHO} @dir ${WWWDIR}/lib/influxdb-php/vendor/guzzlehttp/guzzle/tests >> ${TMPPLIST}
(-)distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1489149658
1
TIMESTAMP = 1491554959
2
SHA256 (librenms-librenms-1.25_GH0.tar.gz) = 7b966c668dd215dd35add4d96f5cb04b63e83956e9db32a962dfd9da2717827d
2
SHA256 (librenms-librenms-1.26_GH0.tar.gz) = cc76a343296c48a6a2423efc9138e2a52d2827178ba733c0714dc6ef38d264e8
3
SIZE (librenms-librenms-1.25_GH0.tar.gz) = 55302189
3
SIZE (librenms-librenms-1.26_GH0.tar.gz) = 57165188
(-)files/patch-config.php.default (+11 lines)
Line 0 Link Here
1
--- config.php.default.orig	2017-03-26 12:06:00 UTC
2
+++ config.php.default
3
@@ -10,7 +10,7 @@ $config['db_name'] = 'librenms';
4
 
5
 // This is the user LibreNMS will run as
6
 //Please ensure this user is created and has the correct permissions to your install
7
-$config['user'] = 'librenms';
8
+$config['user'] = 'www';
9
 
10
 ### This should *only* be set if you want to *force* a particular hostname/port
11
 ### It will prevent the web interface being usable form any other hostname
(-)files/patch-daily.sh (+47 lines)
Line 0 Link Here
1
--- daily.sh.orig	2017-03-26 12:06:00 UTC
2
+++ daily.sh
3
@@ -113,7 +113,7 @@ main () {
4
         # only try to su if we are root (or sudo)
5
         if [[ "$EUID" -eq 0 ]]; then
6
             echo "Re-running ${DAILY_SCRIPT} as ${LIBRENMS_USER} user"
7
-            su -l "$LIBRENMS_USER" -c "$DAILY_SCRIPT $@"
8
+            sudo -u "$LIBRENMS_USER" "$DAILY_SCRIPT"
9
             exit;
10
         fi
11
 
12
@@ -123,27 +123,6 @@ main () {
13
     fi
14
 
15
     if [[ -z "$arg" ]]; then
16
-        up=$(php daily.php -f update >&2; echo $?)
17
-        if [[ "$up" == "0" ]]; then
18
-            $DAILY_SCRIPT no-code-update
19
-            exit
20
-        elif [[ "$up" == "1" ]]; then
21
-            # Update to Master-Branch
22
-            old_ver=$(git show --pretty="%H" -s HEAD)
23
-            status_run 'Updating to latest codebase' 'git pull --quiet' 'update'
24
-            new_ver=$(git show --pretty="%H" -s HEAD)
25
-            if [ "$old_ver" != "$new_ver" ]; then
26
-                status_run "Updated from $old_ver to $new_ver" ''
27
-            fi
28
-        elif [[ "$up" == "3" ]]; then
29
-            # Update to last Tag
30
-            old_ver=$(git describe --exact-match --tags $(git log -n1 --pretty='%h'))
31
-            status_run 'Updating to latest release' 'git fetch --tags && git checkout $(git describe --tags $(git rev-list --tags --max-count=1))' 'update'
32
-            new_ver=$(git describe --exact-match --tags $(git log -n1 --pretty='%h'))
33
-            if [[ "$old_ver" != "$new_ver" ]]; then
34
-                status_run "Updated from $old_ver to $new_ver" ''
35
-            fi
36
-        fi
37
 
38
         cnf=$(echo $(grep '\[.distributed_poller.\]' config.php | egrep -v -e '^//' -e '^#' | cut -d = -f 2 | sed 's/;//g'))
39
         if ((${BASH_VERSINFO[0]} < 4)); then
40
@@ -167,7 +146,6 @@ main () {
41
             post-pull)
42
                 # List all tasks to do after pull in the order of execution
43
                 status_run 'Updating SQL-Schema' 'php includes/sql-schema/update.php'
44
-                status_run 'Updating submodules' "$DAILY_SCRIPT submodules"
45
                 status_run 'Cleaning up DB' "$DAILY_SCRIPT cleanup"
46
                 status_run 'Fetching notifications' "$DAILY_SCRIPT notifications"
47
                 status_run 'Caching PeeringDB data' "$DAILY_SCRIPT peeringdb"
(-)files/patch-validate.php (+39 lines)
Line 0 Link Here
1
--- validate.php.orig	2017-04-11 18:45:34 UTC
2
+++ validate.php
3
@@ -108,13 +108,6 @@ if (!($username === 'root' || (isset($co
4
     print_fail('You need to run this script as root' . (isset($config['user']) ? ' or '.$config['user'] : ''));
5
 }
6
 
7
-if ($git_found === true) {
8
-    if ($config['update_channel'] == 'master' && $cur_sha != $versions['github']['sha']) {
9
-        $commit_date = new DateTime('@'.$versions['local_date'], new DateTimeZone(date_default_timezone_get()));
10
-        print_warn("Your install is out of date, last update: " . $commit_date->format('r'));
11
-    }
12
-}
13
-
14
 // Check php modules we use to make sure they are loaded
15
 $extensions = array('pcre','curl','session','snmp','mcrypt');
16
 foreach ($extensions as $extension) {
17
@@ -302,22 +295,6 @@ if (dbFetchCell('SELECT COUNT(*) FROM `d
18
 }
19
 
20
 
21
-if ($git_found === true) {
22
-    if ($versions['local_branch'] != 'master') {
23
-        print_warn("Your local git branch is not master, this will prevent automatic updates.");
24
-    }
25
-
26
-    // check for modified files
27
-    $modifiedcmd = 'git diff --name-only --exit-code';
28
-    if ($username === 'root') {
29
-        $modifiedcmd = 'su '.$config['user'].' -c "'.$modifiedcmd.'"';
30
-    }
31
-    exec($modifiedcmd, $cmdoutput, $code);
32
-    if ($code !== 0 && !empty($cmdoutput)) {
33
-        print_warn("Your local git contains modified files, this could prevent automatic updates.\nModified files:");
34
-        print_list($cmdoutput, "\t %s\n");
35
-    }
36
-}
37
 // Modules test
38
 $modules = explode(',', $options['m']);
39
 foreach ($modules as $module) {
(-)files/pkg-message.in (-1 / +5 lines)
Lines 19-23 Link Here
19
33	*/6	*	*	*	www	cd %%WWWDIR%% && %%PHP%% discovery.php -h all >> /dev/null 2>&1
19
33	*/6	*	*	*	www	cd %%WWWDIR%% && %%PHP%% discovery.php -h all >> /dev/null 2>&1
20
*/5	*	*	*	*	www	cd %%WWWDIR%% && %%PHP%% discovery.php -h new >> /dev/null 2>&1
20
*/5	*	*	*	*	www	cd %%WWWDIR%% && %%PHP%% discovery.php -h new >> /dev/null 2>&1
21
*/5	*	*	*	*	www	cd %%WWWDIR%% && %%PYTHON%% poller-wrapper.py 16 >> /dev/null 2>&1
21
*/5	*	*	*	*	www	cd %%WWWDIR%% && %%PYTHON%% poller-wrapper.py 16 >> /dev/null 2>&1
22
15	0	*	*	*	www	sh %%WWWDIR%%/daily.sh >> /dev/null 2>&1
22
15	0	*	*	*	www	%%LOCALBASE%%/bin/bash %%WWWDIR%%/daily.sh >> /dev/null 2>&1
23
*	*	*	*	*	www	%%PHP%% %%WWWDIR%%/alerts.php >> /dev/null 2>&1
23
*	*	*	*	*	www	%%PHP%% %%WWWDIR%%/alerts.php >> /dev/null 2>&1
24
*/5 	*	*	*	*	www	%%PHP%% %%WWWDIR%%/poll-billing.php >> /dev/null 2>&1
25
01	*	*	*	*	www	%%PHP%% %%WWWDIR%%/billing-calculate.php >> /dev/null 2>&1
26
*/5	*	*	*	*	www	%%PHP%% %%WWWDIR%%/check-services.php >> /dev/null 2>&1
27

Return to bug 218351