aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt/librenms
diff options
context:
space:
mode:
authorDan Langille <dvl@FreeBSD.org>2020-03-26 15:27:03 +0000
committerDan Langille <dvl@FreeBSD.org>2020-03-26 15:27:03 +0000
commit333989a01f1affba568da9ad83836d101d23747f (patch)
treea59c73e20c210528961990f9d56b8e3ffc582243 /net-mgmt/librenms
parent4cca7045e9543d5199496cdf5e846aa4813fd38f (diff)
downloadports-333989a01f1affba568da9ad83836d101d23747f.tar.gz
ports-333989a01f1affba568da9ad83836d101d23747f.zip
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.
Notes
Notes: svn path=/head/; revision=529195
Diffstat (limited to 'net-mgmt/librenms')
-rw-r--r--net-mgmt/librenms/Makefile11
-rw-r--r--net-mgmt/librenms/files/pkg-message.in5
2 files changed, 14 insertions, 2 deletions
diff --git a/net-mgmt/librenms/Makefile b/net-mgmt/librenms/Makefile
index 9c5bd187847d..19be326cfa15 100644
--- a/net-mgmt/librenms/Makefile
+++ b/net-mgmt/librenms/Makefile
@@ -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-docs.sh scripts/github-remov
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}
diff --git a/net-mgmt/librenms/files/pkg-message.in b/net-mgmt/librenms/files/pkg-message.in
index 985ad347a8be..009ed85427a8 100644
--- a/net-mgmt/librenms/files/pkg-message.in
+++ b/net-mgmt/librenms/files/pkg-message.in
@@ -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
}
]