From c8235544e83b48c484a93af94c430608641e5223 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Sun, 3 May 2026 17:36:37 +0200 Subject: [PATCH] Added stats recording configuration option. Improved default config file info. --- RNS/Utilities/rngit/server.py | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/RNS/Utilities/rngit/server.py b/RNS/Utilities/rngit/server.py index dace236c..7f782b72 100644 --- a/RNS/Utilities/rngit/server.py +++ b/RNS/Utilities/rngit/server.py @@ -141,8 +141,8 @@ class ReticulumGitNode(): self.stats = {} self.last_announce = 0 self.announce_interval = 0 - self.stats_enabled = True - self.stats_job_interval = 60 # TODO: Increase significantly + self.stats_enabled = False + self.stats_job_interval = 180 self.last_stats_job = time.time() self.link_clean_interval = 5 self.last_link_clean = 0 @@ -260,6 +260,7 @@ class ReticulumGitNode(): section = self.config["rngit"] if "node_name" in section: self.node_name = section["node_name"] if "announce_interval" in section: self.announce_interval = section.as_int("announce_interval")*60 + if "record_stats" in section: self.stats_enabled = section.as_bool("record_stats") if "logging" in self.config: section = self.config["logging"] @@ -945,6 +946,13 @@ announce_interval = 360 # node_name = Anonymous Git Node +# You can enable collecting view, fetch and push statistics +# which can be displayed on the stats pages of repositories. +# Remember to set the "s" (stats) permission appropriately +# for statistics to actually be viewable by anyone. + +# record_stats = no + [repositories] @@ -955,6 +963,11 @@ internal = /path/to/directory/with/git/repositories public = /another/path/to/directory/with/git/repositories showcase = /another/path/to/directory/with/git/repositories +# To add a short description to your repositories, you can +# either place a "repo_name.description" file in the same +# directory as the repository folder, or set it in the bare +# repository with `git config repository.description`. + [access] @@ -990,6 +1003,21 @@ internal = rw:9710b86ba12c42d1d8f30f74fe509286 # You can run a nomadnet-compatible page node to serve # repository information if required. Access permissions # will follow those configured per group and repository. +# +# The page server supports automatic markdown to micron +# conversion for repository readmes and other files. If +# you have the pygments Python module installed, syntax +# highlighting will also be automatically applied. +# +# The page server is highly customizable, and you can +# provide custom templates for each page type by placing +# a corresponding "template_name.mu" file in the +# ~/.rngit/templates directory. The supported template +# names are "base", "front", "group", "repo", "tree", +# "blob", "commits", "commit", "refs" and "stats". You +# should include a {PAGE_CONTENT} variable somewhere in +# your templates, the rendered page content will be +# injected into this variable. # serve_nomadnet = no