Just wondering if you'd be open to allowing users to enable the goaccess browsers list via an optional env variable. In addition, an extra env variable can be used to add user-defined browsers to the list.
For example, at the moment, my Uptime Kuma instance returns as an Unknown browser in goaccess (I added a custom user-agent of "Kuma (X11; Linux x86_64)"). In order to get around this, after the image has been updated, I have to edit the start.sh script by adding the following lines:
Perhaps, with an env variable such as ENABLE_BROWSERS_LIST, if a user sets it to True, then the browsers-file option is added to the goan_config. For the custom browsers, an env variable such as CUSTOM_BROWSERS can be used where, if ENABLE_BROWSERS_LIST is set to True, the custom browsers are added to goaccess' browser list file (done in the start.sh script). The custom browsers defined in the CUSTOM_BROWSERS env variable should be comma delimited so we can add a tab between the Browser and the category of the browser (since the browser list expects a tab between the browser and browser category). In my example, Kuma is the browser and Uptime is the category.
Doing this would allow users to have a more robust understanding of their logs when they have services hitting their servers that have custom user-agents instead of them resulting in Unknown browser logs.
Since I use NPM logs, my example above only deals with the npm.sh script. Enabling the browser-list option would also need to be added to the other log scripts. In addition, since the start.sh script runs whenever the container is restarted, a check of the browser list would need to be done to ensure a user provided browser is only added if it isn't already in the list - not doing so would result in duplicate entries whenever the container is restarted.
Great work on this project!
Just wondering if you'd be open to allowing users to enable the goaccess
browsers list
via an optional env variable. In addition, an extra env variable can be used to add user-defined browsers to the list.For example, at the moment, my Uptime Kuma instance returns as an
Unknown
browser in goaccess (I added a custom user-agent of"Kuma (X11; Linux x86_64)"
). In order to get around this, after the image has been updated, I have to edit thestart.sh
script by adding the following lines:In addition, I have to manually edit the
npm.sh
file to enable the browsers list for goaccess:Within the
npm_init() function
the following is added:And within the
npm_goaccess_config() function
the following is added:Perhaps, with an env variable such as
ENABLE_BROWSERS_LIST
, if a user sets it toTrue
, then thebrowsers-file
option is added to thegoan_config
. For the custom browsers, an env variable such asCUSTOM_BROWSERS
can be used where, ifENABLE_BROWSERS_LIST
is set toTrue
, the custom browsers are added to goaccess' browser list file (done in thestart.sh
script). The custom browsers defined in theCUSTOM_BROWSERS
env variable should be comma delimited so we can add a tab between the Browser and the category of the browser (since the browser list expects a tab between the browser and browser category). In my example, Kuma is the browser and Uptime is the category.Doing this would allow users to have a more robust understanding of their logs when they have services hitting their servers that have custom user-agents instead of them resulting in Unknown browser logs.
Since I use NPM logs, my example above only deals with the npm.sh script. Enabling the browser-list option would also need to be added to the other log scripts. In addition, since the
start.sh
script runs whenever the container is restarted, a check of the browser list would need to be done to ensure a user provided browser is only added if it isn't already in the list - not doing so would result in duplicate entries whenever the container is restarted.Example when using custom browser: