From 9d81f0fb48fe9e31cffd6310425ac35de156dec6 Mon Sep 17 00:00:00 2001 From: "matthias@arch" Date: Mon, 15 May 2023 21:59:38 +0200 Subject: [PATCH] Changed config file format --- default.cfg | 233 +++++++++++++++++++++++++++++++++++++++++++++++++++ default.conf | 132 ----------------------------- 2 files changed, 233 insertions(+), 132 deletions(-) create mode 100644 default.cfg delete mode 100644 default.conf diff --git a/default.cfg b/default.cfg new file mode 100644 index 0000000..f59828a --- /dev/null +++ b/default.cfg @@ -0,0 +1,233 @@ +# ************************************* REGINA CONFIGURATION ************************************** +# .__ +# _______ ____ ____ |__| ____ _____ +# \_ __ \_/ __ \ / ___\| |/ \\__ \ +# | | \/\ ___// /_/ > | | \/ __ \_ +# |__| \___ >___ /|__|___| (____ / +# \/_____/ \/ \/ +# ************************************************************************************************* +# data_dir: ~/.local/share/regina < $XDG_DATA_HOME/regina < $REGINA_DATA_DIR +# config_dir: ~/.config/regina < $XDG_CONFIG_HOME/regina < $REGINA_CONFIG_DIR +# ************************************************************************************************* + +[regina] +# name of the server or website +# will be avaiable as variable for the generated html as %server_name +# type: string +# server_name = my_website +server_name = + +# database path. if None, 'data_dir/server_name.db' is used +# type: file (read, write permissions) or None +# database = /home/my_user/.local/share/regina/my_website.db +database = + +# path to the nginx access log to parse +# type: file (read permissions) +# access_log = /var/log/nginx/access.log +access_log = + + +# These settings affect the data collection. If changed, they will affect how the database is being filled in the future. +[data-collection] +# whether a unique visitor is only identified by IP address. if False, browser and platform are also taken into account +# type: True/False +unique_visitor_is_ip_address = False + +# whether a visitor needs at least one successful request to be a human +# type: True/False +human_needs_successful_request = True + +# whether a request with 30x HTTP status counts as successful request +# type: True/False +status_300_is_success = True + +# ignore requests from the same visitor to the same route if one was made within the last x seconds +# type: int +ignore_duplicate_requests_within_x_seconds = 0 + +# delete all ip addresses after the collection is done (not implemented yet!) +# type: True/False +delete_ip_addresses = True + +# don't collect requests to locations that match this regex +# type: regexp or None +# request_route_blacklist = /analytics.* +request_route_blacklist = + +# only collect requests to locations that match this regex +# type: regexp or None +request_route_whitelist = + +# whether to get visitor location information (requires GeoIP database) +# type: True/False +get_visitor_location = False + +# countries for which the GeoIP needs to be resolved at city level (example is EU, China, US) +# type: list of capitalized ISO 3166-1 alpha-2 country codes: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements +# get_cities_for_countries = AT, BE, BG, HR, CY, CZ, DK, EE, FI, FR, DE, GZ, HU, IE, IT, LV, LT, LU, MT, NL, PL, PT, RO, SK, SI, ES, SE, CN, US +get_cities_for_countries = + + +# These settings affect the data visualization, they can be changed at any time since they do not affect the database itself. +[data-visualization] +# generate all statistics for the whole database +# type: True/False +total = True + +# generate all statistics for the last x days. Will be skipped if 0 +# type: int +last_x_days = 30 + +# generate extra entries in visitor-request history for visitors/requests that come from human visitor +# type: True/False +history_track_human_visitors = True + +# generate extra entry in visitor-request history for new visitors +# type: True/False +history_track_new_visitors = True + + +# The template and generated file do actually have to be htmls, you can change it to whatever you want +[html-generation] +# template html input. If None, no html will be generated +# type: file (read permissions) or None +# template_html = /home/my_user/.config/regina/template.html +template_html = + +# output for the generated html. If None, no html will be generated +# type: file (write permissions) or None +# html_out_path = /www/analytics/statistics.html +html_out_path = + +# nginx location for the generated images (this has to map to img_out_dir) +# type: string +# img_location = /images +img_location = + + +# Settings that affect the generated plots and images +[plot-generation] +# output directory for the generated plots. If None, no plots will be generated +# type: directory (write permissions) or None +# img_out_dir = /www/analytics/images +img_out_dir = + +# file extension for the generated plots +# type: string +filetype = svg + +# DPI for plots +# type: int +dpi = 300 + +# plot size for broad plots: width, height +# type: int, int +size_broad = 14, 5 + +# plot size for narrow plots: width, height +# type: int, int +size_narrow = 7, 5 + +# add the height of the bar as label in bar plots +# type: True/False +add_count_label = True + + +[data-export] +# output directory for the generated data files. If None, no data will be exported +# type: directory (write permissions) or None +# data_out_dir = /www/analytics/images +data_out_dir = + +# file extension for the exported data +# type: 'csv' or 'pkl' +filetype = csv + + +# These options only apply if img_out_dir is not None +[rankings] +# Explanation for blacklists and whitelists: +# If a blacklist is given: values that fully match the blacklist are excluded +# If a whitelist is given: values that do not fully match the whitelist are excluded +# Both are optional: you can provide, none or both + +# whether to use only humans for city and country rankings +# type: True/False +geoip_only_humans = True + +# type: regexp or None +city_blacklist = City in .* + +# type: regexp or None +city_whitelist = + +# whether to add the 2 letter country code to the name of the city +# type: True/False +city_add_country_code = True + +# type: regexp or None +country_blacklist = + +# type: regexp or None +country_whitelist = + +# type: regexp or None +# route_blacklist = .*\.((css)|(txt)) +route_blacklist = + +# type: regexp or None +# route_whitelist = .*\.((php)|(html)|(php)|(png)|(jpeg)|(jpg)|(svg)|(gif)) +route_whitelist = + +# maximum number of entries in route ranking plot +# type: int +route_plot_max_routes = 20 + +# whether to ignore non-existing routes in ranking +# type: True/False +route_ignore_404 = True + +# type: regexp or None +# referer_blacklist = Example: exclude '-' (nginx sets this when there is no referer) +referer_blacklist = - + +# type: regexp or None +referer_whitelist = + +# whether to ignore protocol in the referer ranking (if True: https://domain.com == http://domain.com -> domain.com) +# type: True/False +referer_ignore_protocol = True + +# whether to ignore subdomains in the referer ranking (if True: sub.domain.com == another.sub2.domain.com -> domain.com) +# type: True/False +referer_ignore_subdomain = False + +# whether to ignore the top level domain in the referer ranking (if True: domain.com == domain.net -> domain) +# type: True/False +referer_ignore_tld = False + +# whether to ignore the port in the referer ranking (if True: domain.com:80 == domain.com:8080 -> domain.com) +# type: True/False +referer_ignore_port = True + +# whether to ignore route in the referer ranking (if True: domain.com/route1 == domain.com/route2 -> domain.com) +# type: True/False +referer_ignore_route = False + + +# Group certain routes together using by matching them with a regular expression. +# The route's request count will be added to all matching groups and the route will be removed from the ranking. +[route-groups] +# Home = /|(/home.html)|(/index.html) +# Images = .*\.((png)|(jpg)|(jpeg)|(gif)|(webp)|(svg)) +# Resources = /resources/.* + +[debug] +# Debug level: 0-4 +# type: int +debug_level = 0 + +# ************************************************************************************************* +# https://git.quintern.xyz/MatthiasQuintern/regina +# ************************************************************************************************* \ No newline at end of file diff --git a/default.conf b/default.conf deleted file mode 100644 index 4eed783..0000000 --- a/default.conf +++ /dev/null @@ -1,132 +0,0 @@ -# ************************************* REGINA CONFIGURATION ************************************** -# .__ -# _______ ____ ____ |__| ____ _____ -# \_ __ \_/ __ \ / ___\| |/ \\__ \ -# | | \/\ ___// /_/ > | | \/ __ \_ -# |__| \___ >___ /|__|___| (____ / -# \/_____/ \/ \/ -# ************************************************************************************************* -# File format: -# Assign value -# key = value -# Lists -# key = el1, el2, el3 -# Dictionaries: -# key1: val1, key2: val2 -# key1: el1-1,el1-2; key2: el2-1, el2-2 -# - do not use quotation marks (unless your literally want one) -# - leading and trailing whitespaces will be ignored -# ******************************************* GENERAL ********************************************* -# path to the database -# eg: /home/my_visitor/analytics/my_website.db -db = - -# **************************************** DATA COLLECTION **************************************** -# these changes will only apply to newly collected data/creation of new database -# ************************************************************************************************* -# path to the nginx access log to parse. Make sure you have write permissions! -# eg: /var/log/nginx/access.log -access_log = - -# FILE GROUPING -# nginx locations and their root directory: location:directory,location:directory,... -# eg: /:/www/my_website,/error:/www/error -locs_and_dirs = -# filetypes that should be grouped (comma separated) -# eg: png,jpg,jpeg,gif,svg,css,ico,pdf,txt -auto_group_filetypes = -# group certain files -# eg: home:index.html,home.html;images:image1.png,image2.png -filegroups = - -# HUMAN DETECTION -# wether a request with 30x http status counts as success -status_300_is_success = False -# if False, unique visitor is (ip-address - visitor agent) pair, if True only ip addess -unique_visitor_is_ip_address = False -# wether a visitor needs to make at least 1 successful request to be a human -human_needs_success = True - -# dont collect requests to locations fully match this -# eg: /analytics.* -request_location_regex_blacklist = - -# GEOIP -get_visitor_location = False -# this option is relevant used when --update-geoip is used -# list if capitalized ISO 3166-1 alpha-2 country codes for which the ip address ranges need to be collected at city level, not country level -# eg for EU: AT, BE, BG, HR, CY, CZ, DK, EE, FI, FR, DE, GZ, HU, IE, IT, LV, LT, LU, MT, NL, PL, PT, RO, SK, SI, ES, SE -get_cities_for_countries = - -hash_ip_address = True - - -# ***************************************** VISUALIZATION ***************************************** -# these changes can be changed at any point in time as they only affect the visualization of the data -# ************************************************************************************************* -# will be available as variable for the the generated website as %server_name -server_name = - -# separate visitors into all and humans -get_human_percentage = True - -# GEOIP -# generate a country and city ranking -do_geoip_rankings = False -# only use humans for geoip rankings -geoip_only_humans = True -# eg exclude unknown cities: City in .* -city_ranking_regex_blacklist = City in .* -country_ranking_regex_blacklist = - -# ignore the protocol in referers, so https://url.com = http://url.com -> url.com -referer_ranking_ignore_protocol = True -# ignore the subdomains in referers, so foo.url.com = bar.url.com -> url.com -referer_ranking_ignore_subdomain = False -# ignore the location in referers, so url.com/foo = url.com/bar -> url.com -referer_ranking_ignore_location = True -# regex expression as whitelist for referer ranking, minus means empty -# eg exclude empty referers: ^[^\-].* -referer_ranking_regex_whitelist = ^[^\-].* - -# regex expression as whitelist for visitor agent ranking -visitor_agent_ranking_regex_whitelist = - -# regex expression as whitelist for file ranking -# eg .*\.((txt)|(html)|(css)|(php)|(png)|(jpeg)|(jpg)|(svg)|(gif)) to only show these files -file_ranking_regex_whitelist = -# maximum number of file(group)s on the file ranking -file_ranking_plot_max_files = 20 -# wether to ignore non existing files in the ranking -file_ranking_ignore_error_files = True - -plot_dpi = 300 -# affects visitor/request count plot, geoip rankings, file ranking and referer ranking -plot_size_broad = 14, 5 -# affects platform and browser ranking -plot_size_narrow = 7, 5 - -# PATHS -# template html input -# eg: /home/my_visitor/.regina/template.html -template_html = -# output for the generated html -# eg: /www/analytics/statistics.html -html_out_path = - -# output directory for the generated plots -# WARNING: you have to create the directory yourself, regina will not create it -# eg: /www/analytics/images -img_dir = -# nginx location for the generated images, its root must be img_dir -# eg: images -img_location = -# -# if the root for your server is /www/analytics and html_out_path is /www/analytics/analytics.html, -# use img_dir = /www/analytics/images and img_location = /images - -# ******************************************** REGINA ********************************************* -# these settings affect the behavior of regina -# ************************************************************************************************* -# print lots! of debug messages to help you find problems -debug = False