Skip to content

Commit b082d33

Browse files
v1.1.4 (#79)
- GoAccess version: 1.6.2 - GeoLite2-City.mmdb (2022-08-02) - For future use but built into v1.1.4 - Added second GoAccess alternate for use when debugging, builds with debugging on - DEBUG flag will turn on additional GoAccess debugging
1 parent aafa0f2 commit b082d33

File tree

7 files changed

+49
-26
lines changed

7 files changed

+49
-26
lines changed

Dockerfile

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,22 @@ RUN apk add --no-cache \
66
ncurses-dev \
77
musl-libintl
88

9+
# download goaccess
10+
WORKDIR /goaccess-temp
11+
RUN wget https://tar.goaccess.io/goaccess-1.6.2.tar.gz
12+
13+
# set up goacess-debug
14+
WORKDIR /goaccess-debug
15+
RUN cp /goaccess-temp/goaccess-1.6.2.tar.gz .
16+
RUN tar --strip-components=1 -xzvf goaccess-1.6.2.tar.gz
17+
RUN ./configure --enable-utf8 --enable-geoip=mmdb --with-getline --enable-debug
18+
RUN make
19+
RUN make install
20+
921
# set up goacess
1022
WORKDIR /goaccess
11-
RUN wget https://tar.goaccess.io/goaccess-1.6.tar.gz
12-
RUN tar --strip-components=1 -xzvf goaccess-1.6.tar.gz
23+
RUN cp /goaccess-temp/goaccess-1.6.2.tar.gz .
24+
RUN tar --strip-components=1 -xzvf goaccess-1.6.2.tar.gz
1325
RUN ./configure --enable-utf8 --enable-geoip=mmdb --with-getline
1426
RUN make
1527
RUN make install
@@ -28,14 +40,19 @@ RUN apk add --no-cache \
2840
rm -rf /var/lib/apt/lists/* && \
2941
rm /etc/nginx/nginx.conf
3042

43+
COPY --from=builder /goaccess-debug /goaccess-debug
3144
COPY --from=builder /goaccess /goaccess
45+
3246
COPY /resources/goaccess/goaccess.conf /goaccess-config/goaccess.conf.bak
3347
COPY /resources/goaccess/GeoLite2-City.mmdb /goaccess-config/GeoLite2-City.mmdb
3448

3549
# set up nginx
3650
COPY /resources/nginx/nginx.conf /etc/nginx/nginx.conf
3751
ADD /resources/nginx/.htpasswd /opt/auth/.htpasswd
3852

53+
# goaccess logs
54+
WORKDIR /goaccess-logs
55+
3956
WORKDIR /goan
4057
ADD /resources/scripts/funcs funcs
4158
ADD /resources/scripts/logs logs
-1.19 MB
Binary file not shown.

resources/scripts/logs/custom.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,6 @@ function custom_init(){
3939
fi
4040
}
4141

42-
function custom_instance(){
43-
echo -e "\nRUN CUSTOM GOACCESS"
44-
/goaccess/goaccess --no-global-config --config-file=${goan_config} &
45-
}
46-
4742
function custom(){
4843
custom_init
4944

@@ -59,5 +54,11 @@ function custom(){
5954
echo "Custom instance processing: (might take some time depending on the number of files to parse)" >> ${nginx_html}
6055
echo "<br/></p></body></html>" >> ${nginx_html}
6156

62-
custom_instance
57+
echo -e "\nRUN CUSTOM GOACCESS"
58+
if [[ "${DEBUG}" == "True" ]]; then
59+
/goaccess-debug/goaccess --debug-file=${goaccess_debug_file} --invalid-requests=${goaccess_invalid_file} --no-global-config --config-file=${goan_config} &
60+
else
61+
/goaccess/goaccess --no-global-config --config-file=${goan_config} &
62+
fi
63+
6364
}

resources/scripts/logs/npm.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@ function npm_init(){
3333
fi
3434
}
3535

36-
function npm_instance(){
37-
echo -e "\nRUN NPM GOACCESS"
38-
/goaccess/goaccess --no-global-config --config-file=${goan_config} &
39-
}
40-
4136
function npm_goaccess_config(){
4237
echo -e "\n\n\n" >> ${goan_config}
4338
echo "######################################" >> ${goan_config}
@@ -153,5 +148,10 @@ function npm(){
153148
echo "Logs processing: $(($goan_log_count + $goan_archive_log_count)) (might take some time depending on the number of files to parse)" >> ${nginx_html}
154149
echo "<br/></p></body></html>" >> ${nginx_html}
155150

156-
npm_instance
151+
echo -e "\nRUN NPM GOACCESS"
152+
if [[ "${DEBUG}" == "True" ]]; then
153+
/goaccess-debug/goaccess --debug-file=${goaccess_debug_file} --invalid-requests=${goaccess_invalid_file} --no-global-config --config-file=${goan_config} &
154+
else
155+
/goaccess/goaccess --no-global-config --config-file=${goan_config} &
156+
fi
157157
}

resources/scripts/logs/npm_redirection.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ function npm_redirect_init(){
3333
fi
3434
}
3535

36-
function npm_redirect_instance(){
37-
echo -e "\nRUN NPM REDIRECT GOACCESS"
38-
/goaccess/goaccess --no-global-config --config-file=${goan_config} &
39-
}
4036

4137
function npm_redirect_goaccess_config(){
4238
echo -e "\n\n\n" >> ${goan_config}
@@ -153,5 +149,10 @@ function npm_redirect(){
153149
echo "Logs processing: $(($goan_log_count + $goan_archive_log_count)) (might take some time depending on the number of files to parse)" >> ${nginx_html}
154150
echo "<br/></p></body></html>" >> ${nginx_html}
155151

156-
npm_redirect_instance
152+
echo -e "\nRUN NPM REDIRECT GOACCESS"
153+
if [[ "${DEBUG}" == "True" ]]; then
154+
/goaccess-debug/goaccess --debug-file=${goaccess_debug_file} --invalid-requests=${goaccess_invalid_file} --no-global-config --config-file=${goan_config} &
155+
else
156+
/goaccess/goaccess --no-global-config --config-file=${goan_config} &
157+
fi
157158
}

resources/scripts/logs/traefik.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@ function traefik_init(){
3333
fi
3434
}
3535

36-
function traefik_instance(){
37-
echo -e "\nRUN TRAEFIK GOACCESS"
38-
/goaccess/goaccess --no-global-config --config-file=${goan_config} &
39-
}
40-
4136
function traefik_goaccess_config(){
4237
echo -e "\n\n\n" >> ${goan_config}
4338
echo "######################################" >> ${goan_config}
@@ -122,5 +117,10 @@ function traefik(){
122117
echo "Logs processing: $(($goan_log_count)) (might take some time depending on the number of files to parse)" >> ${nginx_html}
123118
echo "<br/></p></body></html>" >> ${nginx_html}
124119

125-
traefik_instance
120+
echo -e "\nRUN TRAEFIK GOACCESS"
121+
if [[ "${DEBUG}" == "True" ]]; then
122+
/goaccess-debug/goaccess --debug-file=${goaccess_debug_file} --invalid-requests=${goaccess_invalid_file} --no-global-config --config-file=${goan_config} &
123+
else
124+
/goaccess/goaccess --no-global-config --config-file=${goan_config} &
125+
fi
126126
}

resources/scripts/start.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@ source $(dirname "$0")/logs/npm_redirection.sh
66
source $(dirname "$0")/logs/traefik.sh
77
source $(dirname "$0")/logs/custom.sh
88

9-
goan_version="GOAN v1.1.3"
9+
goan_version="GOAN v1.1.4"
1010
goan_log_path="/opt/log"
1111

12+
goaccess_ping_interval=15
13+
goaccess_debug_file=/goaccess-logs/goaccess.debug
14+
goaccess_invalid_file=/goaccess-logs/goaccess.invalid
15+
1216
echo -e "\n${goan_version}\n"
1317

1418
### NGINX

0 commit comments

Comments
 (0)