From mboxrd@z Thu Jan 1 00:00:00 1970 From: john at keeping.me.uk (John Keeping) Date: Thu, 30 Apr 2015 14:06:18 +0100 Subject: [Idea] A local cgit configuration per project? In-Reply-To: References: Message-ID: <20150430130618.GE16113@serenity.lan> On Thu, Apr 30, 2015 at 02:57:22PM +0200, Vincent F?rotin wrote: > As a newbie to cgit, I'm currently trying to configure it for a a > project which hosts some git repos. > It seems to me (please refute me if I'm wrong) that cgit takes its > configuration from a given hard-coded path, i.e. "/etc/cgitrc". > This mean that basically there should only be one instance of cgit per system. > > I wonder if it is feasible that cgit would take its *main* > configuration from "/etc/cgitrc", > but also would override it from a *local* one, e.g. a given > configuration from a project > (typically per Apache virtual host)? > > Perhaps this could be "easily" achieved either by wrapping cgit CGI in > an other dedicated script, > setting a project's environment, or by cgit searching for additional > config. pointed by an environment variable, or else through argument > on command-line? > > If this is already achievable, could you please point me to some > related documentation? You can set CGIT_CONFIG in the environment to override the location of the config file. Alternatively you can use environment variables to select a per-project file to include with the "include" directive via macro expansion. This is documented in cgitrc(5) (search for "include=").