Skip to content

Commit

Permalink
Merge branch 'goaccess' into 'main'
Browse files Browse the repository at this point in the history
feat: add goaccess web log analyser + its configuration

See merge request m-team/ai/mlflow-auth-gui!12
  • Loading branch information
Valentin Kozlov committed Apr 23, 2024
2 parents bb66abf + ce2dce7 commit 3716d07
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,11 @@ TERMS_OF_USE_URL=https://website.with.policy/acceptable-use-policy/
# can be left blank, but prefer putting one
LETSENCRYPT_EMAIL=
CORS_ORIGINS=http://localhost,http://foo.bar

# Monitoring based on goaccess
GOACCESS_ETC_PATH_LOCAL=./goaccess-etc
GOACCESS_OUT_PATH_LOCAL=$MLFLOW_BASE_PATH_LOCAL/goaccess-out
GOACCESS_WEB_ROUTE=goaccess # [!] no "/" leading or trailing [!]
GOACCESS_USER=operator
GOACCESS_PASSWORD=$$bcrypt$$encrypted # bcrypt encrypted password, use "htpasswd -B -n operator" to generate. use $$ instead of $ in GOACCESS_PASSWORD value
GOACCESS_ACCESSLOG_FORMAT=TRAEFIKCLF
17 changes: 17 additions & 0 deletions compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,20 @@ services:
labels:
traefik.http.routers.frontend.tls: true
traefik.http.routers.frontend.tls.certResolver: letsEncrypt

goaccess:
restart: always
image: mteamkit/goaccess-service
volumes:
- ${MLFLOW_BASE_PATH_LOCAL}/traefik/log/:/var/log/srv-access/
- ${GOACCESS_ETC_PATH_LOCAL}:/opt/goaccess-etc/
- ${GOACCESS_OUT_PATH_LOCAL}:/opt/goaccess-out/
env_file: .env
networks:
- backend
labels:
traefik.http.routers.goaccess.rule: Host(`${DOMAIN}`) && PathPrefix(`/${GOACCESS_WEB_ROUTE}`)
traefik.http.routers.goaccess.tls: true
traefik.http.routers.goaccess.tls.certResolver: letsEncrypt
traefik.http.routers.goaccess.middlewares: auth
traefik.http.middlewares.auth.basicauth.users: ${GOACCESS_USER}:${GOACCESS_PASSWORD}
2 changes: 1 addition & 1 deletion compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ services:
expose:
- 5000
labels:
- "traefik.http.routers.backend.rule=Host(`${DOMAIN}`) && !PathPrefix(`/signup`)"
- "traefik.http.routers.backend.rule=Host(`${DOMAIN}`) && !PathPrefix(`/signup`) && !PathPrefix(`/${GOACCESS_WEB_ROUTE}`)"
- "traefik.http.middlewares.limit.buffering.maxRequestBodyBytes=12884901888"
- "traefik.http.middlewares.limit.buffering.memRequestBodyBytes=10485760"
- "traefik.http.middlewares.limit.buffering.maxResponseBodyBytes=12884901888"
Expand Down
7 changes: 7 additions & 0 deletions goaccess-etc/goaccess-skim.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

# Script to skim access log file
# Only one input is expected: one access log file
# Output of the filtering is redirected to file in the goaccess-exec.sh script

cat $1 |grep -e "api/2.0" -e "/signup"

0 comments on commit 3716d07

Please sign in to comment.