]> gitweb.ps.run Git - ps-cgit/blobdiff - cgit.c
Add support for 'noheader' option
[ps-cgit] / cgit.c
diff --git a/cgit.c b/cgit.c
index f35f6059e1531ad6408b3ec3d638be81643bed58..38f0fdda6c3d76bca1fe7dd0734253b1f9ac4529 100644 (file)
--- a/cgit.c
+++ b/cgit.c
@@ -12,6 +12,7 @@
 #include "configfile.h"
 #include "html.h"
 #include "ui-shared.h"
+#include "ui-stats.h"
 #include "scan-tree.h"
 
 const char *cgit_version = CGIT_VERSION;
@@ -30,6 +31,8 @@ void config_cb(const char *name, const char *value)
                ctx.cfg.favicon = xstrdup(value);
        else if (!strcmp(name, "footer"))
                ctx.cfg.footer = xstrdup(value);
+       else if (!strcmp(name, "header"))
+               ctx.cfg.header = xstrdup(value);
        else if (!strcmp(name, "logo"))
                ctx.cfg.logo = xstrdup(value);
        else if (!strcmp(name, "index-header"))
@@ -46,6 +49,8 @@ void config_cb(const char *name, const char *value)
                        ctx.cfg.virtual_root = "";
        } else if (!strcmp(name, "nocache"))
                ctx.cfg.nocache = atoi(value);
+       else if (!strcmp(name, "noheader"))
+               ctx.cfg.noheader = atoi(value);
        else if (!strcmp(name, "snapshots"))
                ctx.cfg.snapshots = cgit_parse_snapshots_mask(value);
        else if (!strcmp(name, "enable-index-links"))
@@ -54,6 +59,8 @@ void config_cb(const char *name, const char *value)
                ctx.cfg.enable_log_filecount = atoi(value);
        else if (!strcmp(name, "enable-log-linecount"))
                ctx.cfg.enable_log_linecount = atoi(value);
+       else if (!strcmp(name, "max-stats"))
+               ctx.cfg.max_stats = cgit_find_stats_period(value, NULL);
        else if (!strcmp(name, "cache-size"))
                ctx.cfg.cache_size = atoi(value);
        else if (!strcmp(name, "cache-root"))
@@ -66,6 +73,8 @@ void config_cb(const char *name, const char *value)
                ctx.cfg.cache_static_ttl = atoi(value);
        else if (!strcmp(name, "cache-dynamic-ttl"))
                ctx.cfg.cache_dynamic_ttl = atoi(value);
+       else if (!strcmp(name, "embedded"))
+               ctx.cfg.embedded = atoi(value);
        else if (!strcmp(name, "max-message-length"))
                ctx.cfg.max_msg_len = atoi(value);
        else if (!strcmp(name, "max-repodesc-length"))
@@ -112,6 +121,8 @@ void config_cb(const char *name, const char *value)
                ctx.repo->enable_log_filecount = ctx.cfg.enable_log_filecount * atoi(value);
        else if (ctx.repo && !strcmp(name, "repo.enable-log-linecount"))
                ctx.repo->enable_log_linecount = ctx.cfg.enable_log_linecount * atoi(value);
+       else if (ctx.repo && !strcmp(name, "repo.max-stats"))
+               ctx.repo->max_stats = cgit_find_stats_period(value, NULL);
        else if (ctx.repo && !strcmp(name, "repo.module-link"))
                ctx.repo->module_link= xstrdup(value);
        else if (ctx.repo && !strcmp(name, "repo.readme") && value != NULL) {
@@ -158,6 +169,8 @@ static void querystring_cb(const char *name, const char *value)
                ctx.qry.sort = xstrdup(value);
        } else if (!strcmp(name, "showmsg")) {
                ctx.qry.showmsg = atoi(value);
+       } else if (!strcmp(name, "period")) {
+               ctx.qry.period = xstrdup(value);
        }
 }
 
@@ -181,6 +194,7 @@ static void prepare_context(struct cgit_context *ctx)
        ctx->cfg.max_lock_attempts = 5;
        ctx->cfg.max_msg_len = 80;
        ctx->cfg.max_repodesc_len = 80;
+       ctx->cfg.max_stats = 0;
        ctx->cfg.module_link = "./?repo=%s&page=commit&id=%s";
        ctx->cfg.renamelimit = -1;
        ctx->cfg.robots = "index, nofollow";