How we can gain read access to public gitolite repos, without authentiaction?
More description
As gitolite provide authorization over repos, you can define some repos that all users can access. But about authentication and how this access can be achieved, I couldnt find any appropriate solution.
gitolite: Gitolite does not do authentication. It only does authorisation.
If we want to use 2 popular git protocol: SSH and HTTP for our works.
I think it is not appropriate to provide public access over ssh for security reason(and not even sure how it can be done). So if we want to have public access over HTTP how can this be achieved?
And it seems that apache had some changes to block unauthenticated access.
gitolite: This does not seem to happen any more. Apache seems to insist on a userid, period
public repos can define in gitolite conf:
repo testing
RW+ = @all public
where 'public' is defined in .gitolite.rc and @all is for all users.
HTTP_ANON_USER => 'public',
So it seems answers from before 2019 will not work (I tried this work for excluding an uri from authentication but failed):
https://stackoverflow.com/a/16759565/13663683
my config was:
<Location /git>
SetEnvIf Request_URI "^/git/public_repo/$" NOPASSWD=true
AuthType Basic
AuthName "Git Access"
Require valid-user
AuthUserFile /etc/apache2/git.passwd
Order Deny,Allow
Satisfy any
Deny from all
Require valid-user
Allow from env=NOPASSWD
</Location>
And some works where inefficient to implement, because they have overhead:
https://commentedcode.org/blog/2017/06/12/gitolite-public-http-access/
and some works with broken links:
public repository with gitolite
TY.
Update
I was able to do this work with some tweak around apache config
https://stackoverflow.com/a/16759565/13663683
This will create public repo with no authentication, but still lack in someway. You need to absolutely define your public repo subtree and this lack dynamic locations. And more important with this approach you can not define a user to fill this repo, because no-auth route have higher priority.