List for cgit developers and users
 help / color / mirror / Atom feed
* [PATCH] expand environmentvariables in root-title and root-descr
@ 2018-04-12  9:19 b.laessig
  2018-06-16 16:25 ` john
  0 siblings, 1 reply; 4+ messages in thread
From: b.laessig @ 2018-04-12  9:19 UTC (permalink / raw)


From: Bj?rn L?ssig <b.laessig at pengutronix.de>

For having personanlized cgit configuration i need to use

  root-desc=$REMOTE_USER@$HTTP_HOST
---
 cgit.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cgit.c b/cgit.c
index bd9cb3f..1d7d67e 100644
--- a/cgit.c
+++ b/cgit.c
@@ -120,9 +120,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"))
-- 
2.11.0



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] expand environmentvariables in root-title and root-descr
  2018-04-12  9:19 [PATCH] expand environmentvariables in root-title and root-descr b.laessig
@ 2018-06-16 16:25 ` john
  2018-06-18  6:36   ` 
  2022-07-11 14:57   ` Björn Lässig
  0 siblings, 2 replies; 4+ messages in thread
From: john @ 2018-06-16 16:25 UTC (permalink / raw)


On Thu, Apr 12, 2018 at 11:19:12AM +0200, b.laessig at pengutronix.de wrote:
> From: Bj?rn L?ssig <b.laessig at 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.

[1] https://elinux.org/Developer_Certificate_Of_Origin

> ---
>  cgit.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/cgit.c b/cgit.c
> index bd9cb3f..1d7d67e 100644
> --- a/cgit.c
> +++ b/cgit.c
> @@ -120,9 +120,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"))
> -- 
> 2.11.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] expand environmentvariables in root-title and root-descr
  2018-06-16 16:25 ` john
@ 2018-06-18  6:36   ` 
  2022-07-11 14:57   ` Björn Lässig
  1 sibling, 0 replies; 4+ messages in thread
From:  @ 2018-06-18  6:36 UTC (permalink / raw)


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

Thanks for your comments. I'll fix this and send a better version.

Bj?rn L?ssig


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] expand environmentvariables in root-title and root-descr
  2018-06-16 16:25 ` john
  2018-06-18  6:36   ` 
@ 2022-07-11 14:57   ` Björn Lässig
  1 sibling, 0 replies; 4+ messages in thread
From: Björn Lässig @ 2022-07-11 14:57 UTC (permalink / raw)
  To: John Keeping; +Cc: cgit

[-- 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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-07-11 14:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-12  9:19 [PATCH] expand environmentvariables in root-title and root-descr b.laessig
2018-06-16 16:25 ` john
2018-06-18  6:36   ` 
2022-07-11 14:57   ` Björn Lässig

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).