How can I give read Access to everybody with gitolite

穿精又带淫゛_ 提交于 2019-11-30 15:45:15

问题


in my gitolite.conf i can set

repo    COOL_REPOSITORY
        RW+     =   me
        R       =   @all

This gives me writing access, and all other REGISTERED users have read access to my repository. Now my question is, can i give read access to everybody, not only to users which i have registered by storing their ssh-keys in my keydir?


回答1:


You can call gitolite from an http VirtualHost configuration, like I do in my project.

# GitHttp on @PORT_HTTP_HGIT@
Listen @PORT_HTTP_HGIT@
<VirtualHost @FQN@:@PORT_HTTP_HGIT@>
  ServerName @FQN@
  ServerAlias @HOSTNAME@
  SetEnv GIT_PROJECT_ROOT @H@/repositories
  SetEnv GIT_HTTP_EXPORT_ALL
  SetEnv GITOLITE_HTTP_HOME @H@
  ScriptAlias /hgit/ @H@/sbin/gitolite-shell/
  SetEnv GIT_HTTP_BACKEND "@H@/usr/local/apps/git/libexec/git-core/git-http-backend"
  <Location /hgit>
    ...

Gitolite doesn't require users to register ssh keys: it is only an authorization layer.

But still calling gitolite through http ensure that you keep other Gitolite features active, like:

  • audit trail (in .gitolite/logs: you still know at least which IP address did clone/pull/push your repo)
  • control access (in case you need to remove the @all rule at any moment)

Using directly git-daemon or a direct http access, without using Gitolite at all, would mean renouncing to any control access.




回答2:


Gitolite uses ssh, and I do not think ssh should be used to give access to unregistered users.

Git implements git-daemon and git-http-backend to allow anonymous access via the git:// or http:// protocols, respectively.



来源:https://stackoverflow.com/questions/16758681/how-can-i-give-read-access-to-everybody-with-gitolite

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!