Skip to content

Commit 376e4d7

Browse files
v1.1.14
- updated goaccess from 1.7 to 1.7.1 - updated maxmind dbs to 3/21/2023 - added environment parameter to just include certain proxy hosts - updated loop logic for reading files
1 parent 944f281 commit 376e4d7

File tree

9 files changed

+58
-33
lines changed

9 files changed

+58
-33
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ RUN apk add --no-cache \
99

1010
# download goaccess
1111
WORKDIR /goaccess-temp
12-
COPY /assests/goaccess/goaccess-1.7.tar.gz goaccess.tar.gz
12+
COPY /assests/goaccess/goaccess-1.7.1.tar.gz goaccess.tar.gz
1313

1414
# set up goacess-debug
1515
WORKDIR /goaccess-debug
@@ -23,7 +23,7 @@ RUN make install
2323
WORKDIR /goaccess
2424
RUN cp /goaccess-temp/goaccess.tar.gz .
2525
RUN tar --strip-components=1 -xzvf goaccess.tar.gz
26-
RUN sed -i "s/GWSocket<\/a>/GWSocket<\/a> ( <a href='https:\/\/tiny.one\/xgoan'>GOAN<\/a> <span>v1.1.13<\/span> )/" /goaccess/resources/tpls.html
26+
RUN sed -i "s/GWSocket<\/a>/GWSocket<\/a> ( <a href='https:\/\/tiny.one\/xgoan'>GOAN<\/a> <span>v1.1.14<\/span> )/" /goaccess/resources/tpls.html
2727
RUN sed -i "s/bottom: 190px/bottom: 260px/" /goaccess/resources/css/app.css
2828
RUN ./configure --enable-utf8 --enable-geoip=mmdb --with-getline
2929
RUN make

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ Still in development... You might need to wait a bit if you have a large amount
1414
![Alt text](https://i.ibb.co/fNj9Dcy/goaccess1.jpg "GoAccess Dashboard")
1515

1616
**Dependencies:**
17-
- GoAccess version: 1.7
18-
- GeoLite2-City.mmdb (2023-02-10)
19-
- GeoLite2-Country.mmdb (2023-02-10)
20-
- GeoLite2-ASN.mmdb (2023-02-10)
17+
- GoAccess version: 1.7.1
18+
- GeoLite2-City.mmdb (2023-03-21)
19+
- GeoLite2-Country.mmdb (2023-03-21)
20+
- GeoLite2-ASN.mmdb (2023-03-21)
2121

2222
---
2323

@@ -95,6 +95,7 @@ services:
9595
| `-e BASIC_AUTH_USERNAME=user` | (Optional) Requires BASIC_AUTH to bet set to True. Username for basic authentication. |
9696
| `-e BASIC_AUTH_PASSWORD=pass` | (Optional) Requires BASIC_AUTH to bet set to True. Password for basic authentication. |
9797
| `-e EXCLUDE_IPS=` | (Optional) IP Addresses or range of IPs delimited by comma refer to https://goaccess.io/man. For example: 192.168.0.1-192.168.0.100 or 127.0.0.1,192.168.0.1-192.168.0.100 |
98+
| `-e INCLUDE_PROXY_HOSTS=` | (Optional) Only consume the list of provided proxy hosts. This is a comma separated list containing the proxy host number for example "11,21". This would consume proxy-host-11_access.log* and proxy-host-21_access.log* . The host number can be found right clicking on the 3 dots on the proxy host line in the GUI. |
9899
| `-e LOG_TYPE=` | (Optional) By default the configuration will be set to read NPM logs. Options are: CUSTOM, NPM, NPM+R, TRAEFIK, NCSA_COMBINED. More information below.|
99100
| `-e LOG_TYPE_FILE_PATTERN=` | (Optional) Only to be used with LOG_TYPE=NCSA_COMBINED. This parameter will pass along the file type you are trying match. For example you can pass -e LOG_TYPE_FILE_PATTERN="*.log" or -e LOG_TYPE_FILE_PATTERN="access.log". The default is *.log. Please keep it simple as I have not tested this completely. Use at your own RISK! |
100101
| `-e LANG=zh_CN.UTF-8 -e LANGUAGE=zh_CN.UTF-8` | (Optional) Language localization added. GoAccess only has a few translations available. Please visit https://github.com/allinurl/goaccess/tree/master/po to see the translations available. <br/><br/>**Current Translations**<br/>de - German<br/>es - Spanish<br/>fr - French<br/>it - Italian<br/>ja - Japanese<br/>ko - Korean<br/>pt_BR - Portuguese (Brazil)<br/>ru - Russian<br/>sv - Swedish<br/>uk - English (United Kingdom)<br/>zh_CN - Chinese - Simplified|
662 KB
Binary file not shown.
-663 KB
Binary file not shown.

assests/maxmind/GeoLite2-ASN.mmdb

51.2 KB
Binary file not shown.

assests/maxmind/GeoLite2-City.mmdb

1.64 MB
Binary file not shown.
38.6 KB
Binary file not shown.

resources/scripts/logs/npm.sh

Lines changed: 50 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -62,27 +62,37 @@ function npm(){
6262
IFS=$'\n'
6363
for file in $(find "${goan_log_path}" -name 'proxy*host-*.log' ! -name "*_error.log");
6464
do
65-
if [ -f $file ]
66-
then
67-
if [ -r $file ] && R="Read = yes" || R="Read = No"
68-
then
65+
pressOn=0
66+
67+
if [ -n "${INCLUDE_PROXY_HOSTS}" ]; then
68+
IFS=','
69+
read -ra vHost <<< "$INCLUDE_PROXY_HOSTS"
70+
for hostNum in "${vHost[@]}"; do
71+
if [[ "${goan_log_path}/proxy-host-${hostNum}_access.log" = "${file}" ]]; then
72+
pressOn=1
73+
break
74+
fi
75+
done
76+
unset IFS
77+
else
78+
pressOn=1
79+
fi
80+
81+
if [[ $pressOn == 1 ]]; then
82+
if [ -e "$file" ] && [ -r "$file" ]; then
6983
echo "log-file ${file}" >> ${goan_config}
7084
goan_log_count=$((goan_log_count+1))
71-
echo -ne ' \t '
72-
echo "Filename: $file | $R"
85+
echo -e "\tFile $file exists and is readable"
86+
elif [ -e "$file_path" ]; then
87+
echo -e "\tFile $file exists but is not readable"
7388
else
74-
echo -ne ' \t '
75-
echo "Filename: $file | $R"
89+
echo -e "\tFile $file does not exist"
7690
fi
77-
else
78-
echo -ne ' \t '
79-
echo "Filename: $file | Not a file"
8091
fi
8192
done
8293
unset IFS
8394

8495
echo -e "\tFound (${goan_log_count}) proxy logs..."
85-
8696
echo -e "\n\tSKIP ARCHIVED LOGS"
8797
echo -e "\t-------------------------------"
8898
if [[ "${SKIP_ARCHIVED_LOGS}" == "True" ]]
@@ -91,6 +101,7 @@ function npm(){
91101
else
92102
echo -e "\tFALSE"
93103
goan_archive_log_count=`ls -1 ${goan_log_path}/proxy-host-*_access.log*.gz 2> /dev/null | wc -l`
104+
goan_archive_detail_log_count=0
94105

95106
if [ $goan_archive_log_count != 0 ]
96107
then
@@ -99,27 +110,40 @@ function npm(){
99110
IFS=$'\n'
100111
for file in $(find "${goan_log_path}" -name 'proxy-host-*_access.log*.gz' ! -name "*_error.log");
101112
do
102-
if [ -f $file ]
103-
then
104-
if [ -r $file ] && R="Read = yes" || R="Read = No"
105-
then
106-
echo -ne ' \t '
107-
echo "Filename: $file | $R"
113+
pressOn=0
114+
115+
if [ -n "${INCLUDE_PROXY_HOSTS}" ]; then
116+
IFS=','
117+
read -ra vHost <<< "$INCLUDE_PROXY_HOSTS"
118+
for hostNum in "${vHost[@]}"; do
119+
if echo "$file" | grep -q "proxy-host-${hostNum}_access.log"; then
120+
pressOn=1
121+
break
122+
fi
123+
done
124+
unset IFS
125+
else
126+
pressOn=1
127+
fi
128+
129+
if [[ $pressOn == 1 ]]; then
130+
if [ -e "$file" ] && [ -r "$file" ]; then
131+
echo -e "\tFile $file exists and is readable"
132+
((goan_archive_detail_log_count++))
133+
zcat -f ${file} >> ${archive_log}
134+
elif [ -e "$file_path" ]; then
135+
echo -e "\tFile $file exists but is not readable"
108136
else
109-
echo -ne ' \t '
110-
echo "Filename: $file | $R"
137+
echo -e "\tFile $file does not exist"
111138
fi
112-
else
113-
echo -ne ' \t '
114-
echo "Filename: $file | Not a file"
115139
fi
116140
done
117141
unset IFS
118142

119-
echo -e "\tAdded (${goan_archive_log_count}) proxy archived logs from ${goan_log_path}..."
120-
zcat -f ${goan_log_path}/proxy-host-*_access.log*.gz > ${archive_log}
143+
echo -e "\n\tAdded (${goan_archive_detail_log_count}) proxy archived logs from ${goan_log_path}..."
144+
121145
else
122-
echo -e "\tNo archived logs found at ${goan_log_path}..."
146+
echo -e "\n\tNo archived logs found at ${goan_log_path}..."
123147
fi
124148
fi
125149

resources/scripts/start.sh

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ source $(dirname "$0")/logs/traefik.sh
88
source $(dirname "$0")/logs/custom.sh
99
source $(dirname "$0")/logs/ncsa_combined.sh
1010

11-
goan_version="GOAN v1.1.13"
11+
goan_version="GOAN v1.1.14"
1212
goan_log_path="/opt/log"
1313

1414
goaccess_ping_interval=15

0 commit comments

Comments
 (0)