From owner-svn-ports-all@freebsd.org Thu Mar 26 15:35:31 2020 Return-Path: Delivered-To: svn-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8FB662A2D32; Thu, 26 Mar 2020 15:35:31 +0000 (UTC) (envelope-from dvl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48p8FZ3hPBz4Pk0; Thu, 26 Mar 2020 15:35:30 +0000 (UTC) (envelope-from dvl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4FBE5840D; Thu, 26 Mar 2020 15:27:04 +0000 (UTC) (envelope-from dvl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 02QFR334036123; Thu, 26 Mar 2020 15:27:03 GMT (envelope-from dvl@FreeBSD.org) Received: (from dvl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 02QFR3uL036122; Thu, 26 Mar 2020 15:27:03 GMT (envelope-from dvl@FreeBSD.org) Message-Id: <202003261527.02QFR3uL036122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dvl set sender to dvl@FreeBSD.org using -f From: Dan Langille Date: Thu, 26 Mar 2020 15:27:03 +0000 (UTC) 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 X-SVN-Group: ports-head X-SVN-Commit-Author: dvl X-SVN-Commit-Paths: in head/net-mgmt/librenms: . files X-SVN-Commit-Revision: 529195 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Mar 2020 15:35:31 -0000 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 } ]