Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Mar 2020 15:27:03 +0000 (UTC)
From:      Dan Langille <dvl@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r529195 - in head/net-mgmt/librenms: . files
Message-ID:  <202003261527.02QFR3uL036122@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dvl
Date: Thu Mar 26 15:27:03 2020
New Revision: 529195
URL: https://svnweb.freebsd.org/changeset/ports/529195

Log:
  With recent versions of LibreNMS, the .env file may need to contain secrets.
  
  Install .env.example with chmod o=
  
  Add notice to pkg-message. The file is populated manually.

Modified:
  head/net-mgmt/librenms/Makefile
  head/net-mgmt/librenms/files/pkg-message.in

Modified: head/net-mgmt/librenms/Makefile
==============================================================================
--- head/net-mgmt/librenms/Makefile	Thu Mar 26 14:48:31 2020	(r529194)
+++ head/net-mgmt/librenms/Makefile	Thu Mar 26 15:27:03 2020	(r529195)
@@ -3,6 +3,7 @@
 
 PORTNAME=	librenms
 PORTVERSION=	1.61
+PORTREVISION=	1
 PORTEPOCH=	1
 CATEGORIES=	net-mgmt
 MASTER_SITES=	LOCAL/dvl:vendor
@@ -93,7 +94,7 @@ SHEBANG_FILES=	scripts/auth_test.php scripts/deploy-do
 SUB_FILES+=	pkg-message
 SUB_LIST+=	PHP="${PHPBASE}/bin/php" PYTHON=${PYTHON_CMD}
 
-ROOT_FILES=	.env.example addhost.php adduser.php alerts.php artisan billing-calculate.php \
+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 \
 		delhost.php discovery-wrapper.py discovery.php dist-pollers.php irc.php \
@@ -182,7 +183,13 @@ do-install-EXAMPLES-on:
 post-install:
 	@${FIND} -s ${STAGEDIR}${WWWDIR} -type f '(' -name '*.orig' -or -name '*.bak' -or -name '.gitignore' ')' -delete
 	@${FIND} -s ${STAGEDIR}${WWWDIR} -not -type d | ${SORT} | \
-	${SED} -e 's#^${STAGEDIR}${PREFIX}/##' >> ${TMPPLIST}
+		${SED} -e 's#^${STAGEDIR}${PREFIX}/##' >> ${TMPPLIST}
+
+	# we do this file separately because it needs a different chmod/chown
+	# it will eventually contains secrets
+	${INSTALL_DATA} ${WRKSRC}/.env.example ${STAGEDIR}/${WWWDIR}
+	@${ECHO_CMD} "@(root,www,0750) ${WWWDIR}/.env.example" >> ${TMPPLIST}
+
 	@${ECHO_CMD} "@dir(www,www,0775) ${WWWDIR}/logs" >> ${TMPPLIST}
 	@${ECHO_CMD} "@dir(www,www,0775) ${WWWDIR}/bootstrap/cache" >> ${TMPPLIST}
 #	@${ECHO_CMD} "@(www,www,0775) ${WWWDIR}/daily.sh" >> ${TMPPLIST}

Modified: head/net-mgmt/librenms/files/pkg-message.in
==============================================================================
--- head/net-mgmt/librenms/files/pkg-message.in	Thu Mar 26 14:48:31 2020	(r529194)
+++ head/net-mgmt/librenms/files/pkg-message.in	Thu Mar 26 15:27:03 2020	(r529195)
@@ -26,6 +26,8 @@ For a fresh install, you need to create an APP_KEY:
 cd %%WWWDIR%%
 cp -i .env.example .env
 
+That file will eventually contain secrets.  Make sure it is not world-readable.
+
 It is also a good idea to:
 cd %%WWWDIR%%
 ./validate
@@ -58,6 +60,9 @@ cd %%WWWDIR%%
 ./build-base.php
 
 re: https://docs.librenms.org/#General/Updating/
+
+Make sure your %%WWWDIR%%/.env file is not world-readable.
+
 EOM
 }
 ]



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202003261527.02QFR3uL036122>