List for cgit developers and users
 help / color / mirror / Atom feed
* simple-authentication.lua gives "Invalid request"
@ 2014-09-21 13:48 jazepstein
  2014-09-27  2:44 ` jazepstein
  0 siblings, 1 reply; 2+ messages in thread
From: jazepstein @ 2014-09-21 13:48 UTC (permalink / raw)


Hi,

I'm trying to set up cgit on my server, with password protection
per-repository using the "filters/simple-authentication.lua" script:

https://github.com/zx2c4/cgit/blob/master/filters/simple-authentication.lua

After spending some time installing lua and luacrypto, I'm correctly
getting the "Authentication Required" page when I try to view a
protected repo. However, when I enter a username / password and click
"login", all I get after that is "Invalid request" (as a 404
response).

I have cgit running behind nginx, configured more-or-less per these
instructions:

https://gist.github.com/stran12/1394757

Would be great to get this working. As I'll be using cgit for private
repos (for client projects), the password-protection is a must. I
realise that this feature is new, so I understand if there are still
some hiccups involved.

Cheers,
Jeremy.


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

* simple-authentication.lua gives "Invalid request"
  2014-09-21 13:48 simple-authentication.lua gives "Invalid request" jazepstein
@ 2014-09-27  2:44 ` jazepstein
  0 siblings, 0 replies; 2+ messages in thread
From: jazepstein @ 2014-09-27  2:44 UTC (permalink / raw)


For now, I've created a separate nginx virtualhost for each repo, and
I've configured HTTP basic authentication in each virtualhost.

I didn't think that this was possible before - but then I realised
that it's actually quite easy, all I needed to do was to create a
cgitrc file for each repo (rather than just having the global
/etc/cgitrc), and then in the nginx virtualhost config, add this:

fastcgi_param   CGIT_CONFIG     /path/to/repo_foo/cgitrc;

(to set the CGIT_CONFIG environment variable per vhost).

This is not as ideal as actually getting the cgit authentication
feature working - but it achieves the same end result (i.e. per-repo
access control).

So, if anyone else is in the same boat, and if there have still been
no solutions suggested for the problem, you might want to consider
taking my approach too.

Cheers,
Jeremy.

On Sun, Sep 21, 2014 at 11:48 PM, Jeremy Epstein <jazepstein at gmail.com> wrote:
> Hi,
>
> I'm trying to set up cgit on my server, with password protection
> per-repository using the "filters/simple-authentication.lua" script:
>
> https://github.com/zx2c4/cgit/blob/master/filters/simple-authentication.lua
>
> After spending some time installing lua and luacrypto, I'm correctly
> getting the "Authentication Required" page when I try to view a
> protected repo. However, when I enter a username / password and click
> "login", all I get after that is "Invalid request" (as a 404
> response).
>
> I have cgit running behind nginx, configured more-or-less per these
> instructions:
>
> https://gist.github.com/stran12/1394757
>
> Would be great to get this working. As I'll be using cgit for private
> repos (for client projects), the password-protection is a must. I
> realise that this feature is new, so I understand if there are still
> some hiccups involved.
>
> Cheers,
> Jeremy.


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

end of thread, other threads:[~2014-09-27  2:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-21 13:48 simple-authentication.lua gives "Invalid request" jazepstein
2014-09-27  2:44 ` jazepstein

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