diff --git a/regina/default.cfg b/regina/default.cfg deleted file mode 100644 index 738a095..0000000 --- a/regina/default.cfg +++ /dev/null @@ -1,155 +0,0 @@ -# ************************************* REGINA CONFIGURATION ************************************** -# .__ -# _______ ____ ____ |__| ____ _____ -# \_ __ \_/ __ \ / ___\| |/ \\__ \ -# | | \/\ ___// /_/ > | | \/ __ \_ -# |__| \___ >___ /|__|___| (____ / -# \/_____/ \/ \/ -# ************************************************************************************************* -[ regina ] -# name of the server or website -# will be available as variable for the the generated website as %server_name -# string -server_name = - -# database path. if not specified, use xdg-data-home/regina/ -# eg: /home/my_user/regina/my_website.db -# -# path or empty -database = - -[ data-collection ] -# path to the nginx access log to parse -# eg: /var/log/nginx/access.log -# path (read permissions) -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 -# PATHS -[ data-visualization ] -# template html input -# eg: /home/my_visitor/.regina/template.html -# path (read permissions) -template_html = -# output for the generated html -# eg: /www/analytics/statistics.html -# path (write permissions) -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 -# path (directory with write permissions) -img_out_dir = - -# nginx location for the generated images, its root must be img_out_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 -[ route_groups ] -images = - *.gif - *.jpeg - *.jpg - *.png - *.svg - -# 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 ] -# 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 location needs to be resolved at city level, not country level -# for EU, use: 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 -get_cities_for_countries = - -# hash_ip_address = False - - -# ***************************************** VISUALIZATION ***************************************** -# these changes can be changed at any point in time as they only affect the visualization of the data -# ************************************************************************************************* -[ visualization ] - -# separate visitors into all and humans -# True/False -get_human_percentage = True - -# GEOIP -# generate a country and city ranking -# True/False -do_geoip_rankings = False - -# only use humans for geoip rankings -# True/False -geoip_only_humans = True - -# eg exclude unknown cities: City in .* -# regex -city_ranking_regex_blacklist = City in .* - -# True/False -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 file ranking -# eg .*\.((txt)|(html)|(css)|(php)|(png)|(jpeg)|(jpg)|(svg)|(gif)) to only show these files -# regex -route_ranking_regex_whitelist = - -# maximum number of route (group)s on the file ranking -# int -route_ranking_plot_max_routes = 20 - -# wether to ignore non existing files in the ranking -# True/False -route_ranking_ignore_error_files = True - -# int -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 - - -# ******************************************** REGINA ********************************************* -# these settings affect the behavior of regina -# ************************************************************************************************* -# print lots! of debug messages to help you find problems -debug = False diff --git a/regina/test.db b/regina/test.db deleted file mode 100644 index a8a5796..0000000 Binary files a/regina/test.db and /dev/null differ diff --git a/regina/todo.py b/regina/todo.py deleted file mode 100644 index 1a0768d..0000000 --- a/regina/todo.py +++ /dev/null @@ -1,34 +0,0 @@ - - -def get_files_from_dir_rec(p: str, files: list[str]): - """recursivly append all files to files""" - pdebug("get_files_from_dir_rec:",p) - if path.isfile(p): - files.append(p) - elif path.isdir(p): - for p_ in listdir(p): - get_files_from_dir_rec(p + "/" + p_, files) - - -def create_filegroups(cursor: sql.Cursor, filegroup_str: str): - """ - TODO: make re-usable (alter groups when config changes) - """ - # filegroup_str: 'name1: file1, file2, file3; name2: file33' - groups = filegroup_str.strip(";").split(";") - pdebug("create_filegroups:", groups) - for group in groups: - name, vals = group.split(":") - # create/get group - if sql_exists(cursor, "", [("groupname", name)]): - group_id = sql_select(cursor, "", [("groupname", name)])[0][0] - else: - group_id = sql_max(cursor, "", "group_id") + 1 - sql_insert(cursor, "", [(group_id, name)]) - # pdebug("create_filegroups: group_id", group_id) - # create/edit file - for filename in vals.split(","): - if sql_exists(cursor, "", [("filename", filename)]): # if exist, update - cursor.execute(f"UPDATE file SET group_id = {group_id} WHERE filename = 'fil'") - else: - sql_insert(cursor, "", [[filename, group_id]]) diff --git a/test/test.db b/test/test.db deleted file mode 100644 index 6b46b46..0000000 Binary files a/test/test.db and /dev/null differ