List for cgit developers and users
 help / color / mirror / Atom feed
From: "Björn Lässig" <b.laessig@pengutronix.de>
To: John Keeping <john@keeping.me.uk>
Cc: cgit@lists.zx2c4.com
Subject: Re: [PATCH] expand environmentvariables in root-title and root-descr
Date: Mon, 11 Jul 2022 16:57:11 +0200	[thread overview]
Message-ID: <60c76e29104be2e46a2a96253673a018f319482e.camel@pengutronix.de> (raw)
In-Reply-To: <20180616162519.GD1922@john.keeping.me.uk>

[-- Attachment #1: Type: text/plain, Size: 575 bytes --]

On Sat, 2018-06-16 at 17:25 +0100, John Keeping wrote:
> On Thu, Apr 12, 2018 at 11:19:12AM +0200, b.laessig@pengutronix.de wrote:
> > From: Björn Lässig <b.laessig@pengutronix.de>
> > 
> > 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

[-- Attachment #2: 0001-expand-environmentvariables-in-root-title-and-root-d.patch --]
[-- Type: text/x-patch, Size: 2211 bytes --]

From cbdbb56693c0d8d160c6681c2783525ea086cd7c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20L=C3=A4ssig?= <b.laessig@pengutronix.de>
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 <b.laessig@pengutronix.de>
---
 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


      parent reply	other threads:[~2022-07-11 14:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-12  9:19 b.laessig
2018-06-16 16:25 ` john
2018-06-18  6:36   ` 
2022-07-11 14:57   ` Björn Lässig [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=60c76e29104be2e46a2a96253673a018f319482e.camel@pengutronix.de \
    --to=b.laessig@pengutronix.de \
    --cc=cgit@lists.zx2c4.com \
    --cc=john@keeping.me.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).