Skip to content

Commit

Permalink
v2.4.2 release add grepcidr
Browse files Browse the repository at this point in the history
  • Loading branch information
smilebasti authored Sep 5, 2024
1 parent 42e8a36 commit 5b07873
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 6 deletions.
19 changes: 17 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,26 @@ LABEL maintainer="npmgrafstats@smilebasti.myhome-server.de"
## setup home folder
RUN mkdir -p /root/.config/NPMGRAF

## install curl for slim image
## install curl gcc for slim image
RUN apt-get update && apt-get install -y \
curl gcc \
curl gcc git build-essential\
&& rm -rf /var/lib/apt/lists/*

# Clone the grepcidr repository
RUN git clone https://github.com/ryantig/grepcidr.git /opt/grepcidr

# Build and install grepcidr
RUN cd /opt/grepcidr && \
make && \
make install

# Clean up by removing the source code if not needed
RUN rm -rf /opt/grepcidr

RUN apt-get remove git build-essential -y\
&& rm -rf /var/cache/apk/* \
&& apt-get autoremove -y && apt-get clean

COPY requirements.txt /root/.config/NPMGRAF/requirements.txt
RUN pip install -r /root/.config/NPMGRAF/requirements.txt

Expand Down
15 changes: 15 additions & 0 deletions Dockerfile-arm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@ LABEL maintainer="npmgrafstats@smilebasti.myhome-server.de"
## setup home folder
RUN mkdir -p /root/.config/NPMGRAF

# Clone the grepcidr repository
RUN git clone https://github.com/ryantig/grepcidr.git /opt/grepcidr

# Build and install grepcidr
RUN cd /opt/grepcidr && \
make && \
make install

# Clean up by removing the source code if not needed
RUN rm -rf /opt/grepcidr

RUN apt-get remove git build-essential -y\
&& rm -rf /var/cache/apk/* \
&& apt-get autoremove -y && apt-get clean

COPY requirements.txt /root/.config/NPMGRAF/requirements.txt
RUN pip install -r /root/.config/NPMGRAF/requirements.txt

Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ A view of the Grafana Dashboard only within a few hours of running:
![npmGrafStats](https://user-images.githubusercontent.com/60941345/203383131-50b7197e-2e58-4bb1-a7e6-d92e15d3430a.png)

## Newest features
v2.3.2 added in the Grafana dashboard a filter option to select only a few specific domains. Also the latest image is now running python:3-slim as base image (***80% smaller*** than before!).
v2.4.2 added cidr notation to the monitoringips.txt (CIDR format a.b.c.d/xx or aa:bb::cc::dd/xx IP range a.b.c.d-e.f.g.h Single IP a.b.c.d or aa:bb:cc::dd).

This project is a modified clone of https://github.com/Festeazy/nginxproxymanagerGraf and independent of https://github.com/jc21/nginx-proxy-manager. Changes to the original project can be found in the [changelog.md](https://github.com/smilebasti/npmGrafStats/blob/main/changelog.md) file.

Expand All @@ -36,3 +36,6 @@ Github Registry is now additionally available to Docker Registry by adding `ghcr

A full installation example is available with the [docker-compose.yml](https://github.com/smilebasti/npmGrafStats/blob/main/docker-compose.yml)

## Star History

[![Star History Chart](https://api.star-history.com/svg?repos=smilebasti/npmgrafstats&type=Date)](https://star-history.com/#smilebasti/npmgrafstats&Date)
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
- maybe analys fallback/default/error logs
- grafan 10.1 missle map (route feature only one and not multiple possible)

## v2.4.2
- add cidr notation in monitoringips.txt file (see #45 thanks @pitbull)

## v2.4.1
- add AbuseIPDB check to container (not included in Grafana Dashboard, add manually) Thanks to @maxdd in #38 and #39

Expand Down
2 changes: 1 addition & 1 deletion sendips.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ do
then
python /root/.config/NPMGRAF/Internalipinfo.py "$outsideip" "$targetdomain" "$length" "$targetip" "InternalRProxyIPs" "$measurementtime"
fi
elif $monitorfile && grep --line-buffered -qFx $outsideip /monitoringips.txt
elif $monitorfile && grepcidr -D $outsideip /monitoringips.txt >> /dev/nul
then
echo "An excluded monitoring service checked: $targetdomain"
if [ "$MONITORING_LOGS" = "TRUE" ]
Expand Down
2 changes: 1 addition & 1 deletion sendredirectionips.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ do
then
python /root/.config/NPMGRAF/Internalipinfo.py "$outsideip" "$targetdomain" "$length" "$targetip" "InternalRProxyIPs" "$measurementtime"
fi
elif $monitorfile && grep --line-buffered -qFx $outsideip /monitoringips.txt
elif $monitorfile && grepcidr -D $outsideip /monitoringips.txt >> /dev/null
then
echo "An excluded monitoring service checked: $targetdomain"
if [ "$MONITORING_LOGS" = "TRUE" ]
Expand Down
2 changes: 1 addition & 1 deletion start.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
echo "npmGrafStats: v2.4.1"
echo "npmGrafStats: v2.4.2-pre"
echo "Startup: lets get the logs send them to influx"


Expand Down

0 comments on commit 5b07873

Please sign in to comment.