From 09592ab965dabdbecc030464604fabcd22c182a0 Mon Sep 17 00:00:00 2001 From: Rory& Date: Fri, 30 Jan 2026 19:08:11 +0100 Subject: WIP: old changes --- cgit.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'cgit.c') diff --git a/cgit.c b/cgit.c index 63b3d4a..ee7ebfe 100644 --- a/cgit.c +++ b/cgit.c @@ -316,6 +316,22 @@ static void config_cb(const char *name, const char *value) add_mimetype(arg, value); else if (!strcmp(name, "include")) parse_configfile(expand_macros(value), config_cb); + // cgit-magenta: + else if (skip_prefix(name, "snapshot.", &arg)) { + if (!strcmp(arg, "root-dir")) { + ctx.cfg.snapshot.save_on_disk_root_dir = xstrdup(value); + } else if (!strcmp(arg, "max-compression-threads")) { + ctx.cfg.snapshot.max_compression_threads = atoi(value); + } else if (!strcmp(arg, "compression-level-zstd")) { + ctx.cfg.snapshot.compression_level_zstd = atoi(value); + } else if (!strcmp(arg, "compression-level-xz")) { + ctx.cfg.snapshot.compression_level_xz = atoi(value); + } else if (!strcmp(arg, "save-on-disk")) { + ctx.cfg.snapshot.save_on_disk = atoi(value); + } else if (!strcmp(arg, "save-on-disk-max-idle-age")) { + ctx.cfg.snapshot.save_on_disk_max_idle_age = atoi(value); + } + } } static void querystring_cb(const char *name, const char *value) @@ -371,7 +387,8 @@ static void querystring_cb(const char *name, const char *value) ctx.qry.context = atoi(value); } else if (!strcmp(name, "ignorews")) { ctx.qry.ignorews = atoi(value); - } else if (!strcmp(name, "follow")) { + } + else if (!strcmp(name, "follow")) { ctx.qry.follow = atoi(value); } } @@ -456,6 +473,7 @@ static void prepare_context(void) // cgit-magenta: ctx.cfg.snapshot.save_on_disk_max_idle_age = 1 * 24 * 60 * 60; // 1 day ctx.cfg.snapshot.save_on_disk = 1; + ctx.cfg.snapshot.save_on_disk_root_dir = ""; ctx.cfg.snapshot.max_compression_threads = 0; ctx.cfg.snapshot.compression_level_zstd = 3; ctx.cfg.snapshot.compression_level_xz = 6; -- cgit 1.5.1