Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ RUN apk --update --no-cache add -t build-dependencies \
&& echo "foreach (glob(\"${LIBRENMS_PATH}/config.d/*.php\") as \$filename) include \$filename;" >> config.php \
&& chown -R librenms:librenms ${LIBRENMS_PATH} \
&& su librenms -s /bin/sh -c "COMPOSER_CACHE_DIR=/tmp composer install --no-dev --no-interaction --no-ansi" \
# vendor and composer files are only written by plugin/composer installs, and the container
# commonly runs under a custom PUID/PGID - the runtime permission fix intentionally skips
# them for that reason (https://github.com/librenms/docker/issues/557), so make them writable here
&& chmod -R a+rwX vendor \
&& chmod a+rw composer.json composer.lock \
&& apk del build-dependencies \
&& rm -rf .git \
html/plugins/Test \
Expand Down
5 changes: 4 additions & 1 deletion rootfs/etc/cont-init.d/03-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,12 @@ for plugin in ${plugins}; do
done

# Fix perms
# the vendor tree and composer files are not chowned below: chowning the ~13k vendor files
# delays every start with custom PUID/PGID (https://github.com/librenms/docker/issues/557) and
# is only needed for plugin/composer installs, for which the image build sets write permissions
echo "Fixing perms..."
chown librenms:librenms /data/config /data/monitoring-plugins /data/plugins /data/rrd /data/weathermap /data/alert-templates
find /data/logs ${LIBRENMS_PATH}/composer* ${LIBRENMS_PATH}/config.d ${LIBRENMS_PATH}/bootstrap ${LIBRENMS_PATH}/logs ${LIBRENMS_PATH}/storage ${LIBRENMS_PATH}/vendor \( ! -user librenms -o ! -group librenms \) -exec chown librenms:librenms {} +
find /data/logs ${LIBRENMS_PATH}/config.d ${LIBRENMS_PATH}/bootstrap ${LIBRENMS_PATH}/logs ${LIBRENMS_PATH}/storage \( ! -user librenms -o ! -group librenms \) -exec chown librenms:librenms {} +
chmod ug+rw /data/logs /data/rrd ${LIBRENMS_PATH}/bootstrap/cache ${LIBRENMS_PATH}/storage ${LIBRENMS_PATH}/storage/framework/*

# Check additional Monitoring plugins
Expand Down