Index: net-mgmt/librenms/Makefile =================================================================== --- net-mgmt/librenms/Makefile +++ net-mgmt/librenms/Makefile @@ -2,20 +2,23 @@ # $FreeBSD$ PORTNAME= librenms -PORTVERSION= 1.35 -PORTREVISION= 0 +PORTVERSION= 1.42.01 +PORTREVISION= 4 PORTEPOCH= 1 CATEGORIES= net-mgmt +MASTER_SITES+= LOCAL/dvl +DISTFILES+= librenms-vendor-1.42.01.tar.gz MAINTAINER= bofh@FreeBSD.org COMMENT= Autodiscovering PHP/MySQL/SNMP based network monitoring LICENSE= GPLv3 +USES= python${PY_MYSQL} shebangfix + USE_GITHUB= yes GH_ACCOUNT= librenms -USES= python${PY_MYSQL} shebangfix SHEBANG_FILES= scripts/auth_test.php scripts/deploy-docs.sh scripts/github-remove \ scripts/Migration/Standard_Conversion/convert_no_xml.sh \ scripts/Migration/Standard_Conversion/destwork_no_xml.sh \ @@ -25,25 +28,28 @@ scripts/Migration/XML_Conversion/mkdir.sh \ scripts/removespikes.php scripts/agent-local/nfs-stats.sh \ scripts/removespikes.pl scripts/watchmaillog/watchmaillog.pl \ - vendor/ezyang/htmlpurifier/maintenance/add-vimline.php \ - vendor/ezyang/htmlpurifier/maintenance/config-scanner.php \ - vendor/ezyang/htmlpurifier/maintenance/flush-definition-cache.php \ - vendor/ezyang/htmlpurifier/maintenance/flush.php \ - vendor/ezyang/htmlpurifier/maintenance/generate-entity-file.php \ - vendor/ezyang/htmlpurifier/maintenance/generate-includes.php \ - vendor/ezyang/htmlpurifier/maintenance/generate-schema-cache.php \ - vendor/ezyang/htmlpurifier/maintenance/generate-standalone.php \ - vendor/ezyang/htmlpurifier/maintenance/merge-library.php \ - vendor/ezyang/htmlpurifier/maintenance/old-extract-schema.php \ - vendor/ezyang/htmlpurifier/maintenance/old-remove-require-once.php \ - vendor/ezyang/htmlpurifier/maintenance/old-remove-schema-def.php \ - vendor/ezyang/htmlpurifier/maintenance/rename-config.php \ - vendor/ezyang/htmlpurifier/maintenance/remove-trailing-whitespace.php \ - vendor/ezyang/htmlpurifier/maintenance/update-config.php \ - vendor/tecnickcom/tcpdf/tools/tcpdf_addfont.php \ - poller.php poller-wrapper.py + poller.php poller-wrapper.py \ + ../${PORTNAME}-vendor-${PORTVERSION}/ezyang/htmlpurifier/maintenance/generate-includes.php \ + ../${PORTNAME}-vendor-${PORTVERSION}/ezyang/htmlpurifier/maintenance/flush-definition-cache.php \ + ../${PORTNAME}-vendor-${PORTVERSION}/ezyang/htmlpurifier/maintenance/old-remove-require-once.php \ + ../${PORTNAME}-vendor-${PORTVERSION}/ezyang/htmlpurifier/maintenance/config-scanner.php \ + ../${PORTNAME}-vendor-${PORTVERSION}/ezyang/htmlpurifier/maintenance/flush.php \ + ../${PORTNAME}-vendor-${PORTVERSION}/ezyang/htmlpurifier/maintenance/add-vimline.php \ + ../${PORTNAME}-vendor-${PORTVERSION}/ezyang/htmlpurifier/maintenance/remove-trailing-whitespace.php \ + ../${PORTNAME}-vendor-${PORTVERSION}/ezyang/htmlpurifier/maintenance/merge-library.php \ + ../${PORTNAME}-vendor-${PORTVERSION}/ezyang/htmlpurifier/maintenance/old-extract-schema.php \ + ../${PORTNAME}-vendor-${PORTVERSION}/ezyang/htmlpurifier/maintenance/rename-config.php \ + ../${PORTNAME}-vendor-${PORTVERSION}/ezyang/htmlpurifier/maintenance/generate-standalone.php \ + ../${PORTNAME}-vendor-${PORTVERSION}/ezyang/htmlpurifier/maintenance/generate-schema-cache.php \ + ../${PORTNAME}-vendor-${PORTVERSION}/ezyang/htmlpurifier/maintenance/old-remove-schema-def.php \ + ../${PORTNAME}-vendor-${PORTVERSION}/ezyang/htmlpurifier/maintenance/generate-entity-file.php \ + ../${PORTNAME}-vendor-${PORTVERSION}/ezyang/htmlpurifier/maintenance/update-config.php \ + ../${PORTNAME}-vendor-${PORTVERSION}/swiftmailer/swiftmailer/lib/swiftmailer_generate_mimes_config.php \ + ../${PORTNAME}-vendor-${PORTVERSION}/tecnickcom/tcpdf/tools/tcpdf_addfont.php + +USE_PHP= ctype curl filter gd hash json ldap mbstring mcrypt mysqli openssl pdo posix session simplexml snmp tokenizer xml zip -USE_PHP= ctype curl filter gd hash json ldap mcrypt mysqli openssl posix session simplexml snmp tokenizer xml +# perhaps we also need python-memcache python-mysqldb NO_BUILD= yes @@ -83,24 +89,24 @@ SUB_FILES+= pkg-message SUB_LIST+= PHP="${PHPBASE}/bin/php" PYTHON=${PYTHON_CMD} -ROOT_FILES= addhost.php adduser.php alerts.php build-base.php build.sql \ - billing-calculate.php check-services.php composer.json \ - config.php.default config_to_json.php cronic daily.php daily.sh \ +ROOT_FILES= addhost.php adduser.php alerts.php artisan billing-calculate.php \ + build-base.php build.sql check-services.php composer.json \ + composer.lock config.php.default config_to_json.php cronic daily.php daily.sh \ delhost.php discovery-wrapper.py discovery.php dist-pollers.php irc.php \ - mkdocs.yml pbin.sh phpunit.xml poll-billing.php poller.php poller-service.py \ - poller-wrapper.py readmegen.yml renamehost.php services-wrapper.py \ + librenms-service.py mkdocs.yml pbin.sh phpunit.xml ping.php poll-billing.php poller.php poller-service.py \ + poller-wrapper.py readmegen.yml renamehost.php services-wrapper.py snmp-scan.py \ snmptrap.php syslog.php validate.php -ROOT_DIRS= LibreNMS contrib doc html includes lib logs mibs misc rrd scripts sql-schema tests vendor +ROOT_DIRS= LibreNMS app bootstrap config contrib database doc html includes lib licenses logs mibs misc resources routes rrd scripts sql-schema storage tests -DOCS= AUTHORS.md CHANGELOG CONTRIBUTING.md LICENSE.txt README.md +DOCS= AUTHORS.md CHANGELOG.md CONTRIBUTING.md LICENSE.txt README.md PORTDOCS= * PORTEXAMPLES= snmp.conf.example snmpd.conf.example NO_ARCH= yes APACHEMOD_USES= php:mod APACHEMOD_USES_OFF= php:web -APACHEMOD_USE= APACHE_RUN=22+ +APACHEMOD_USE= USES=apache:run,22+ post-patch: ${REINPLACE_CMD} 's|%%LOCALBASE%%|${LOCALBASE}|g' \ @@ -120,6 +126,8 @@ .for f in ${ROOT_FILES} ${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}/${WWWDIR} .endfor + ${MKDIR} ${STAGEDIR}/${WWWDIR}/vendor + (cd ${WRKDIR}/${PORTNAME}-vendor-${PORTVERSION} && ${COPYTREE_SHARE} . ${STAGEDIR}/${WWWDIR}/vendor) # Make daily.sh executable ${CHMOD} 0755 ${STAGEDIR}/${WWWDIR}/daily.sh # Files in scripts dir should be executable @@ -147,5 +155,10 @@ ${SED} -e 's#^${STAGEDIR}${PREFIX}/##' >> ${TMPPLIST} @${ECHO_CMD} "@dir(www,www,0775) ${WWWDIR}/logs" >> ${TMPPLIST} @${ECHO_CMD} "@dir(www,www,0775) ${WWWDIR}/rrd" >> ${TMPPLIST} + @${ECHO_CMD} "@dir(www,www,0775) ${WWWDIR}/bootstrap/cache" >> ${TMPPLIST} + @${ECHO_CMD} "@dir(www,www,0775) ${WWWDIR}/storage" >> ${TMPPLIST} + @${ECHO_CMD} "@dir(www,www,0775) ${WWWDIR}/storage/framework/cache" >> ${TMPPLIST} + @${ECHO_CMD} "@dir(www,www,0775) ${WWWDIR}/storage/framework/sessions" >> ${TMPPLIST} + @${ECHO_CMD} "@dir(www,www,0775) ${WWWDIR}/storage/framework/views" >> ${TMPPLIST} .include Index: net-mgmt/librenms/distinfo =================================================================== --- net-mgmt/librenms/distinfo +++ net-mgmt/librenms/distinfo @@ -1,3 +1,5 @@ -TIMESTAMP = 1516371936 -SHA256 (librenms-librenms-1.35_GH0.tar.gz) = 6e685c0c34283fd69e51f437ca8ac392c8ab8430bfb883ea4b63bb7b1cae8cbd -SIZE (librenms-librenms-1.35_GH0.tar.gz) = 62667335 +TIMESTAMP = 1535543828 +SHA256 (librenms-vendor-1.42.01.tar.gz) = a3695b56715c79f367d324b161b7f8130f93f2d034c20d7bab22cc53e352f504 +SIZE (librenms-vendor-1.42.01.tar.gz) = 31809735 +SHA256 (librenms-librenms-1.42.01_GH0.tar.gz) = 91748b468e569826e27797f3b88db764a468dc82dddc507a1c7994dff1309c23 +SIZE (librenms-librenms-1.42.01_GH0.tar.gz) = 31794610 Index: net-mgmt/librenms/files/patch-LibreNMS_Validations_User.php =================================================================== --- net-mgmt/librenms/files/patch-LibreNMS_Validations_User.php +++ /dev/null @@ -1,33 +0,0 @@ ---- LibreNMS/Validations/User.php.orig 2017-12-31 20:48:36 UTC -+++ LibreNMS/Validations/User.php -@@ -62,29 +62,7 @@ class User implements ValidationGroup - - - // Let's test the user configured if we have it -- if (Config::has('user')) { -- $dir = Config::get('install_dir'); -- -- $find_result = rtrim(`find $dir \! -user $lnms_username -o \! -group $lnms_groupname &> /dev/null`); -- if (!empty($find_result)) { -- // Ignore the two logs that may be created by the -- $files = array_diff(explode(PHP_EOL, $find_result), array( -- "$dir/logs/error_log", -- "$dir/logs/access_log", -- )); -- -- if (!empty($files)) { -- $result = ValidationResult::fail( -- "We have found some files that are owned by a different user than $lnms_username, this " . -- 'will stop you updating automatically and / or rrd files being updated causing graphs to fail.' -- ) -- ->setFix("chown -R $lnms_username:$lnms_groupname $dir") -- ->setList('Files', $files); -- -- $validator->result($result); -- } -- } -- } else { -+ if (!Config::has('user')) { - $validator->warn("You don't have \$config['user'] set, this most likely needs to be set to librenms"); - } - Index: net-mgmt/librenms/files/patch-html_install.php =================================================================== --- net-mgmt/librenms/files/patch-html_install.php +++ net-mgmt/librenms/files/patch-html_install.php @@ -1,20 +1,22 @@ ---- html/install.php.orig 2017-12-31 20:48:36 UTC +--- html/install.php.orig 2018-08-04 20:07:12 UTC +++ html/install.php -@@ -364,7 +364,7 @@ $config_file = <<<"EOD" +@@ -357,7 +357,7 @@ $config_file = <<<"EOD" // This is the user LibreNMS will run as //Please ensure this user is created and has the correct permissions to your install -\$config['user'] = 'librenms'; +\$config['user'] = 'www'; - ### Memcached config - We use this to store realtime usage - \$config\['memcached'\]\['enable'\] = FALSE; -@@ -395,7 +395,7 @@ $config_file = <<<"EOD" + ### Locations - it is recommended to keep the default + #\$config\['install_dir'\] = "$install_dir"; +@@ -383,8 +383,8 @@ $config_file = <<<"EOD" #\$config\['nets'\]\[\] = "192.168.0.0/16"; - # Uncomment the next line to disable daily updates --#\$config\['update'\] = 0; -+\$config\['update'\] = 0; + # Update configuration +-#\$config\['update_channel'\] = 'release'; # uncomment to follow the monthly release channel +-#\$config\['update'\] = 0; # uncomment to completely disable updates ++\$config\['update_channel'\] = 'release'; # uncomment to follow the monthly release channel ++\$config\['update'\] = 0; # uncomment to completely disable updates EOD; if (!file_exists("../config.php")) { Index: net-mgmt/librenms/files/patch-includes_defaults.inc.php =================================================================== --- net-mgmt/librenms/files/patch-includes_defaults.inc.php +++ net-mgmt/librenms/files/patch-includes_defaults.inc.php @@ -1,32 +1,32 @@ ---- includes/defaults.inc.php.orig 2017-12-31 20:48:36 UTC +--- includes/defaults.inc.php.orig 2018-08-04 20:07:12 UTC +++ includes/defaults.inc.php -@@ -48,19 +48,21 @@ $config['fping_options']['retries'] = 3; +@@ -47,19 +47,19 @@ $config['own_hostname'] = 'localhost'; $config['fping_options']['timeout'] = 500; $config['fping_options']['count'] = 3; - $config['fping_options']['millisec'] = 200; + $config['fping_options']['interval'] = 500; -$config['snmpwalk'] = '/usr/bin/snmpwalk'; -$config['snmpget'] = '/usr/bin/snmpget'; -$config['snmpbulkwalk'] = '/usr/bin/snmpbulkwalk'; +-$config['snmptranslate'] = '/usr/bin/snmptranslate'; +$config['snmpwalk'] = '/usr/local/bin/snmpwalk'; +$config['snmpget'] = '/usr/local/bin/snmpget'; +$config['snmpbulkwalk'] = '/usr/local/bin/snmpbulkwalk'; - $config['snmptranslate'] = '/usr/bin/snmptranslate'; ++$config['snmptranslate'] = '/usr/local/bin/snmptranslate'; $config['whois'] = '/usr/bin/whois'; -$config['ping'] = '/bin/ping'; -$config['mtr'] = '/usr/bin/mtr'; -$config['nmap'] = '/usr/bin/nmap'; -+$config['ping'] = '/sbin/ping'; -+$config['mtr'] = '/usr/local/bin/mtr'; -+$config['nmap'] = '/usr/local/bin/nmap'; - $config['nagios_plugins'] = '/usr/lib/nagios/plugins'; +-$config['nagios_plugins'] = '/usr/lib/nagios/plugins'; -$config['ipmitool'] = '/usr/bin/ipmitool'; -$config['virsh'] = '/usr/bin/virsh'; -$config['dot'] = '/usr/bin/dot'; -$config['sfdp'] = '/usr/bin/sfdp'; -+$config['rrdtool'] = '/usr/local/bin/rrdtool'; -+$config['rrdtool_version'] = 1.7; ++$config['ping'] = '/sbin/ping'; ++$config['mtr'] = '/usr/local/bin/mtr'; ++$config['nmap'] = '/usr/localbin/nmap'; ++$config['nagios_plugins'] = '/usr/local/libexec/nagios'; +$config['ipmitool'] = '/usr/local/bin/ipmitool'; -+$config['virsh'] = '/usr/lacal/bin/virsh'; ++$config['virsh'] = '/usr/local/bin/virsh'; +$config['dot'] = '/usr/local/bin/dot'; +$config['sfdp'] = '/usr/local/bin/sfdp'; Index: net-mgmt/librenms/files/patch-poller-wrapper.py =================================================================== --- net-mgmt/librenms/files/patch-poller-wrapper.py +++ net-mgmt/librenms/files/patch-poller-wrapper.py @@ -1,6 +1,6 @@ ---- poller-wrapper.py.orig 2018-01-14 15:32:19 UTC +--- poller-wrapper.py.orig 2018-08-29 12:32:49 UTC +++ poller-wrapper.py -@@ -36,6 +36,8 @@ except: +@@ -37,6 +37,8 @@ except: print "threading, Queue, sys, subprocess, time, os, json" sys.exit(2) Index: net-mgmt/librenms/files/pkg-message.in =================================================================== --- net-mgmt/librenms/files/pkg-message.in +++ net-mgmt/librenms/files/pkg-message.in @@ -26,3 +26,20 @@ 01 * * * * www %%PHP%% %%WWWDIR%%/billing-calculate.php >> /dev/null 2>&1 */5 * * * * www %%PHP%% %%WWWDIR%%/check-services.php >> /dev/null 2>&1 +For a fresh install, you need to create an APP_KEY: + +cd %%WWWDIR%% +cp -i .env.example .env +php artisan key:generate + +The output should look something like this: + +************************************** +* Application In Production! * +************************************** + + Do you really wish to run this command? (yes/no) [no]: + > y + +Application key [base64:P62La9V........qw=] set successfully. +