Add ENABLE_BROWSERS_LIST & CUSTOM_BROWSERS env variables #163
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
ENABLE_BROWSERS_LIST
andCUSTOM_BROWSERS
variables.start.sh
script changesbrowsers.list
(located in/goaccess/config/
) is copied to the/goaccess-config
directory. If the user defined theCUSTOM_BROWSERS
variable with a comma delimited list consisting ofBrowser:Browser_category
items, these are appended to the/goaccess-config/browsers.list
file.browsers.list
is already present in the/goaccess-config
directory at container runtime and subsequently removing it prior to copying over a fresh copy from the/goaccess/config
directory, we can ensure that thebrowsers.list
always aligns with the user'sCUSTOM_BROWSERS
variable. Since the/goaccess/config/browsers.list
file is persistent, appending to it would result in custom browsers being left behind within the file when a user removes browser(s) from theCUSTOM_BROWSERS
variable during a container restart - copying over a fresh file prior to appending custom browsers gets around this potential issue.CUSTOM_BROWSERS
, if a Browser has already been defined inbrowsers.list
, it will be ignored and not appended to the list. Only the browser category (e.g., Crawlers) can be the same for multiple custom browser definitions.custom.sh
,ncsa_combined.sh
,npm.sh
,npm_error.sh
,npm_redirection.sh
,traefik.sh
script changesENABLE_BROWSERS_LIST
variable is set to True, for each log type the correspondinggoaccess.conf
file has the linebrowsers-file /goaccess-config/browsers.list
appended to it enabling the use of thebrowsers.list
file.CUSTOM_BROWSERS
variable, this will still allow them to use the default goaccess browsers list.Note regarding Custom Log Types
: Since a user may already have abrowser.list
file defined in theirgoaccess.conf
file, if that is the case, their choice is respected instead of forcing them to use the file located at/goaccess-config/browsers.list
. However, if they don't, but did enable the browsers list via the variable, then/goaccess-config/browsers.list
is used and their custom browsers (if any defined) are appended to said file.Documentation