On Sat, 2018-06-16 at 17:25 +0100, John Keeping wrote: > On Thu, Apr 12, 2018 at 11:19:12AM +0200, [email protected] wrote: > > From: Björn Lässig <[email protected]> > > > > For having personanlized cgit configuration i need to use > > > > root-desc=$REMOTE_USER@$HTTP_HOST > > Missing sign-off (see [1] for what this means). > > Also, this needs a corresponding change in cgitrc.5.txt to indicate that > these variables are now subject to macro expansion.
it took some time :-) but i fixed it. Attached is the new version. regards Björn Lässig
From cbdbb56693c0d8d160c6681c2783525ea086cd7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20L=C3=A4ssig?= <[email protected]> Date: Thu, 12 Apr 2018 11:13:54 +0200 Subject: [PATCH] expand environmentvariables in root-title and root-descr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For having personanlized cgit configuration i need to use root-desc=$REMOTE_USER@$HTTP_HOST Signed-off-by: Björn Lässig <[email protected]> --- cgit.c | 4 ++-- cgitrc.5.txt | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/cgit.c b/cgit.c index 08d81a1d4b63..b6ad378d105b 100644 --- a/cgit.c +++ b/cgit.c @@ -136,9 +136,9 @@ static void config_cb(const char *name, const char *value) else if (!strcmp(name, "readme")) string_list_append(&ctx.cfg.readme, xstrdup(value)); else if (!strcmp(name, "root-title")) - ctx.cfg.root_title = xstrdup(value); + ctx.cfg.root_title = xstrdup(expand_macros(value)); else if (!strcmp(name, "root-desc")) - ctx.cfg.root_desc = xstrdup(value); + ctx.cfg.root_desc = xstrdup(expand_macros(value)); else if (!strcmp(name, "root-readme")) ctx.cfg.root_readme = xstrdup(value); else if (!strcmp(name, "css")) diff --git a/cgitrc.5.txt b/cgitrc.5.txt index 33a6a8c0c758..ed06d92cc9f1 100644 --- a/cgitrc.5.txt +++ b/cgitrc.5.txt @@ -354,7 +354,8 @@ robots:: root-desc:: Text printed below the heading on the repository index page. Default - value: "a fast webinterface for the git dscm". + value: "a fast webinterface for the git dscm". See also: + "MACRO EXPANSION". root-readme:: The content of the file specified with this option will be included @@ -363,7 +364,8 @@ root-readme:: root-title:: Text printed as heading on the repository index page. Default value: - "Git Repository Browser". + "Git Repository Browser". See also: "MACRO EXPANSION". + scan-hidden-path:: If set to "1" and scan-path is enabled, scan-path will recurse into @@ -749,6 +751,8 @@ named environment variable: - include - project-list - scan-path +- root-title +- root-desc Macro expansion will also happen on the content of $CGIT_CONFIG, if defined. -- 2.34.1
