Skip to content

Commit a82f9ea

Browse files
Merge pull request #169 from xavier-hernandez/develop
v1.1.23
2 parents bd70f29 + 202c671 commit a82f9ea

File tree

16 files changed

+55
-199
lines changed

16 files changed

+55
-199
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.2.tar.gz goaccess.tar.gz
12+
COPY /assests/goaccess/goaccess-1.8.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.22<\/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.23<\/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: 10 additions & 5 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.2
18-
- GeoLite2-City.mmdb (2023-10-08)
19-
- GeoLite2-Country.mmdb (2023-10-08)
20-
- GeoLite2-ASN.mmdb (2023-10-08)
17+
- GoAccess version: 1.8.1
18+
- GeoLite2-City.mmdb (2023-11-12)
19+
- GeoLite2-Country.mmdb (2023-11-12)
20+
- GeoLite2-ASN.mmdb (2023-11-12)
2121

2222
---
2323

@@ -59,6 +59,8 @@ services:
5959
- LOG_TYPE=NPM #optional - more information below
6060
- ENABLE_BROWSERS_LIST=True #optional - more information below
6161
- CUSTOM_BROWSERS=Kuma:Uptime,TestBrowser:Crawler #optional - comma delimited, more information below
62+
- HTML_REFRESH=5 #optional - Refresh the HTML report every X seconds. https://goaccess.io/man
63+
- KEEP_LAST=30 #optional - Keep the last specified number of days in storage. https://goaccess.io/man
6264
volumes:
6365
- /path/to/host/nginx/logs:/opt/log
6466
- /path/to/host/custom:/opt/custom #optional, required if using log_type = CUSTOM
@@ -86,6 +88,8 @@ services:
8688
- LOG_TYPE=NPM #optional - more information below
8789
- ENABLE_BROWSERS_LIST=True #optional - more information below
8890
- CUSTOM_BROWSERS=Kuma:Uptime,TestBrowser:Crawler #optional - comma delimited, more information below
91+
- HTML_REFRESH=5 #optional - Refresh the HTML report every X seconds. https://goaccess.io/man
92+
- KEEP_LAST=30 #optional - Keep the last specified number of days in storage. https://goaccess.io/man
8993
volumes:
9094
- /path/to/host/nginx/logs:/opt/log
9195
- /path/to/host/custom:/opt/custom #optional, required if using log_type = CUSTOM
@@ -105,7 +109,8 @@ services:
105109
| `-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|
106110
| `-e ENABLE_BROWSERS_LIST=True/False` | (Optional) Defaults to False. Set to true if you would like to enable the [goaccess browsers.list](https://github.com/allinurl/goaccess/blob/master/config/browsers.list) file. |
107111
| `-e CUSTOM_BROWSERS=` | - (Optional) Consumes the list of provided custom browsers. This is a comma separated list containing the custom browser(s) in the format `Browser:Browser_category`.<br/>- If your custom browser is already defined in the default `browsers.list` file, it will not be added. However, the `Browser_category` can be reused.<br/><br/> CUSTOM_BROWSERS list example: `Kuma:Crawlers,TestBrowser:Crawlers,Kuma:Uptime,Discordbot:Crawlers`<br/><br/>For the example above, only `Kuma:Crawlers` and `TestBrowser:Crawlers` will be appended to the `browsers.list` file. <br/><br/>`Kuma:Uptime` is ignored as the browser `Kuma` has already been defined in `Kuma:Crawlers`. `Discordbot:Crawlers` is ignored as the browser `Discordbot` is already defined in the [default browsers.list file](https://github.com/allinurl/goaccess/blob/master/config/browsers.list)<br/><br/>Note for users using CUSTOM LOG_TYPE:<br/><br/>If your `goaccess.conf` file references a browsers.list file other than the one located in the `/goaccess-config/ directory`, the CUSTOM_BROWSERS variable will be ignored. |
108-
112+
| `-e HTML_REFRESH=` | (Optional) Refresh the HTML report every X seconds. https://goaccess.io/man |
113+
| `-e KEEP_LAST=` | (Optional) Keep the last specified number of days in storage. https://goaccess.io/man|
109114

110115
# **Additional environment information**
111116
` -e LOG_TYPE=`
-663 KB
Binary file not shown.
723 KB
Binary file not shown.

assests/maxmind/GeoLite2-ASN.mmdb

-5.23 KB
Binary file not shown.

assests/maxmind/GeoLite2-City.mmdb

-3.92 MB
Binary file not shown.
394 KB
Binary file not shown.

resources/scripts/funcs/environment.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,30 @@ function set_geoip_database() {
7474
echo "geoip-database /goaccess-config/GeoLite2-City.mmdb" >> ${1}
7575
echo "geoip-database /goaccess-config/GeoLite2-ASN.mmdb" >> ${1}
7676
echo "geoip-database /goaccess-config/GeoLite2-Country.mmdb" >> ${1}
77+
}
78+
79+
function runGoAccess(){
80+
goacess_options="--num-tests=0 --no-global-config"
81+
82+
if [ -n "$HTML_REFRESH" ]; then
83+
if is_integer "$HTML_REFRESH"; then
84+
goacess_options="$goacess_options --html-refresh=${HTML_REFRESH}"
85+
else
86+
echo "Error: HTML_REFRESH does not contain an integer, ignoring".
87+
fi
88+
fi
89+
90+
if [ -n "$KEEP_LAST" ]; then
91+
if is_integer "$KEEP_LAST"; then
92+
goacess_options="$goacess_options --keep-last=${KEEP_LAST}"
93+
else
94+
echo "Error: KEEP_LAST does not contain an integer, ignoring".
95+
fi
96+
fi
97+
98+
if [[ "${DEBUG}" == "True" ]]; then
99+
/goaccess-debug/goaccess --debug-file=${goaccess_debug_file} --invalid-requests=${goaccess_invalid_file} --no-global-config --config-file=${goan_config} &
100+
else
101+
/goaccess/goaccess ${goacess_options} --config-file=${goan_config} &
102+
fi
77103
}

resources/scripts/funcs/internal.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,12 @@ function checkFile(){
1212
return 1
1313
fi
1414
fi
15+
}
16+
17+
function is_integer() {
18+
if [[ $1 =~ ^[0-9]+$ ]]; then
19+
return 0 # It's an integer
20+
else
21+
return 1 # It's not an integer
22+
fi
1523
}

resources/scripts/logs/custom.sh

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,5 @@ function custom(){
6464
echo "<br/></p></body></html>" >> ${nginx_html}
6565

6666
echo -e "\nRUN CUSTOM GOACCESS"
67-
if [[ "${DEBUG}" == "True" ]]; then
68-
/goaccess-debug/goaccess --debug-file=${goaccess_debug_file} --invalid-requests=${goaccess_invalid_file} --no-global-config --config-file=${goan_config} &
69-
else
70-
/goaccess/goaccess --no-global-config --config-file=${goan_config} &
71-
fi
72-
67+
runGoAccess
7368
}

0 commit comments

Comments
 (0)