Skip to content

Commit 5b07873

Browse files
authored
v2.4.2 release add grepcidr
1 parent 42e8a36 commit 5b07873

File tree

7 files changed

+42
-6
lines changed

7 files changed

+42
-6
lines changed

Dockerfile

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,26 @@ LABEL maintainer="[email protected]"
55
## setup home folder
66
RUN mkdir -p /root/.config/NPMGRAF
77

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

13+
# Clone the grepcidr repository
14+
RUN git clone https://github.com/ryantig/grepcidr.git /opt/grepcidr
15+
16+
# Build and install grepcidr
17+
RUN cd /opt/grepcidr && \
18+
make && \
19+
make install
20+
21+
# Clean up by removing the source code if not needed
22+
RUN rm -rf /opt/grepcidr
23+
24+
RUN apt-get remove git build-essential -y\
25+
&& rm -rf /var/cache/apk/* \
26+
&& apt-get autoremove -y && apt-get clean
27+
1328
COPY requirements.txt /root/.config/NPMGRAF/requirements.txt
1429
RUN pip install -r /root/.config/NPMGRAF/requirements.txt
1530

Dockerfile-arm

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,21 @@ LABEL maintainer="[email protected]"
55
## setup home folder
66
RUN mkdir -p /root/.config/NPMGRAF
77

8+
# Clone the grepcidr repository
9+
RUN git clone https://github.com/ryantig/grepcidr.git /opt/grepcidr
10+
11+
# Build and install grepcidr
12+
RUN cd /opt/grepcidr && \
13+
make && \
14+
make install
15+
16+
# Clean up by removing the source code if not needed
17+
RUN rm -rf /opt/grepcidr
18+
19+
RUN apt-get remove git build-essential -y\
20+
&& rm -rf /var/cache/apk/* \
21+
&& apt-get autoremove -y && apt-get clean
22+
823
COPY requirements.txt /root/.config/NPMGRAF/requirements.txt
924
RUN pip install -r /root/.config/NPMGRAF/requirements.txt
1025

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ A view of the Grafana Dashboard only within a few hours of running:
1919
![npmGrafStats](https://user-images.githubusercontent.com/60941345/203383131-50b7197e-2e58-4bb1-a7e6-d92e15d3430a.png)
2020

2121
## Newest features
22-
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!).
22+
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).
2323

2424
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.
2525

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

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

39+
## Star History
40+
41+
[![Star History Chart](https://api.star-history.com/svg?repos=smilebasti/npmgrafstats&type=Date)](https://star-history.com/#smilebasti/npmgrafstats&Date)

changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
- maybe analys fallback/default/error logs
99
- grafan 10.1 missle map (route feature only one and not multiple possible)
1010

11+
## v2.4.2
12+
- add cidr notation in monitoringips.txt file (see #45 thanks @pitbull)
13+
1114
## v2.4.1
1215
- add AbuseIPDB check to container (not included in Grafana Dashboard, add manually) Thanks to @maxdd in #38 and #39
1316

sendips.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ do
5555
then
5656
python /root/.config/NPMGRAF/Internalipinfo.py "$outsideip" "$targetdomain" "$length" "$targetip" "InternalRProxyIPs" "$measurementtime"
5757
fi
58-
elif $monitorfile && grep --line-buffered -qFx $outsideip /monitoringips.txt
58+
elif $monitorfile && grepcidr -D $outsideip /monitoringips.txt >> /dev/nul
5959
then
6060
echo "An excluded monitoring service checked: $targetdomain"
6161
if [ "$MONITORING_LOGS" = "TRUE" ]

sendredirectionips.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ do
4848
then
4949
python /root/.config/NPMGRAF/Internalipinfo.py "$outsideip" "$targetdomain" "$length" "$targetip" "InternalRProxyIPs" "$measurementtime"
5050
fi
51-
elif $monitorfile && grep --line-buffered -qFx $outsideip /monitoringips.txt
51+
elif $monitorfile && grepcidr -D $outsideip /monitoringips.txt >> /dev/null
5252
then
5353
echo "An excluded monitoring service checked: $targetdomain"
5454
if [ "$MONITORING_LOGS" = "TRUE" ]

start.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
echo "npmGrafStats: v2.4.1"
2+
echo "npmGrafStats: v2.4.2-pre"
33
echo "Startup: lets get the logs send them to influx"
44

55

0 commit comments

Comments
 (0)