Gitolite 权限控制
官网 http://gitolite.com/gitolite/index.html
安装配置 http://gitolite.com/gitolite/install/
傻瓜安装教程 http://gitolite.com/gitolite/fool_proof_setup/
快速指南(中文)https://git-scm.com/book/zh/v1/%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%B8%8A%E7%9A%84-Git-Gitolite
快速指南(英文)https://git-scm.com/book/en/v1/Git-on-the-Server-Gitolite
1安装
1) 创建 git 用户
useradd git
passwd changeit
2)使用root用户安装git
yum list git
yum install git
3)安装 perl-Data-Dumper.x86_64 (因为执行 gitolite/install 时的异常 Can't locate Data/Dumper.pm in @INC)
yum list perl*Dumper*
yum install perl-Data-Dumper.x86_64
4)切换到 git 用户并克隆 gitolite 源码
su git
cd ~
git clone https://github.com/sitaramc/gitolite
./install -to <dir>
to copy the entire 'src' directory to <dir>. If <dir> is not in
$PATH, use the full path to run gitolite commands. Please provide a full path, not a relative path.
5)安装 gitolite
ls gitolite -l
./gitolite/install -to ~/bin
Usage: gitolite setup [<option>] -pk, --pubkey <file> pubkey file name '-pk' can be used to replace the admin key; useful if you lost the admin's private key but do have shell access to the server.
6)上传并设置 public key ,公钥文件名即账户名
./bin/gitolite setup -pk zxg.pub
7)在服务器端显示自动创建的仓库的目录结构
./repositories/gitolite-admin.git/
./repositories/gitolite-admin.git/HEAD
./repositories/gitolite-admin.git/logs
./repositories/gitolite-admin.git/logs/HEAD
./repositories/gitolite-admin.git/logs/refs
./repositories/gitolite-admin.git/logs/refs/heads
./repositories/gitolite-admin.git/logs/refs/heads/master
./repositories/gitolite-admin.git/index
./repositories/gitolite-admin.git/description
./repositories/gitolite-admin.git/COMMIT_EDITMSG
./repositories/gitolite-admin.git/hooks
./repositories/gitolite-admin.git/hooks/pre-push.sample
./repositories/gitolite-admin.git/hooks/post-update
./repositories/gitolite-admin.git/hooks/prepare-commit-msg.sample
./repositories/gitolite-admin.git/hooks/update.sample
./repositories/gitolite-admin.git/hooks/commit-msg.sample
./repositories/gitolite-admin.git/hooks/pre-rebase.sample
./repositories/gitolite-admin.git/hooks/update
./repositories/gitolite-admin.git/hooks/pre-commit.sample
./repositories/gitolite-admin.git/hooks/pre-applypatch.sample
./repositories/gitolite-admin.git/hooks/applypatch-msg.sample
./repositories/gitolite-admin.git/hooks/post-update.sample
./repositories/gitolite-admin.git/gl-conf
./repositories/gitolite-admin.git/branches
./repositories/gitolite-admin.git/refs
./repositories/gitolite-admin.git/refs/tags
./repositories/gitolite-admin.git/refs/heads
./repositories/gitolite-admin.git/refs/heads/master
./repositories/gitolite-admin.git/objects
./repositories/gitolite-admin.git/objects/内容略
./repositories/gitolite-admin.git/config
./repositories/gitolite-admin.git/info
./repositories/gitolite-admin.git/info/exclude
8) 在客户端验证该服务是否成功
git ls-remote git@123.206.22.178:gitolite-admin
结果(显示的是gitolite-admin 仓库内容):
e173b96b63241df3946f5babd0fcdc819a4eb0df HEAD
e173b96b63241df3946f5babd0fcdc819a4eb0df refs/heads/master
2 授权
1) 克隆 gitolite-admin 仓库到本地
git clone git@123.206.22.178:gitolite-admin
其目录结构为:
└─gitolite-admin
├─conf
│ gitolite.conf
│
└─keydir
zxg.pub
2)假设为小红授权
① 将 xiaohong.pub 复制到 keydir 下
② 编辑 gitolite.conf 文件追加如下内容:
repo foo
RW+ = xiaohong
R = zxg
③ add 、commit 、push 三步提交到服务器即可
3)权限控制详细文档
access rule examples
Gitolite's access rules are very powerful. The simplest use was already shown above. Here is a slightly more detailed example:
repo foo
RW+ = alice
- master = bob
- refs/tags/v[0-9] = bob
RW = bob
RW refs/tags/v[0-9] = carol
R = dave
Here's what these example rules say:
alice can do anything to any branch or tag -- create, push, delete, rewind/overwrite etc.
bob can create or fast-forward push any branch whose name does not start with "master" and create any tag whose name does not start with "v"+digit.
carol can create tags whose names start with "v"+digit.
dave can clone/fetch.
Please see the main documentation linked above for all the gory details, as well as more features and examples.
groups
Gitolite allows you to group users or repos for convenience. Here's an example that creates two groups of users:
@staff = alice bob carol
@interns = ashok
repo secret
RW = @staff
repo foss
RW+ = @staff
RW = @interns
Group lists accumulate. The following two lines have the same effect as the earlier definition of @staff above:
@staff = alice bob
@staff = carol
You can also use group names in other group names:
@all-devs = @staff @interns
Finally, @all is a special group name that is often convenient to use if you really mean "all repos" or "all users".
Gitolite 权限控制的更多相关文章
- 尝试asp.net mvc 基于controller action 方式权限控制方案可行性
微软在推出mvc框架不久,短短几年里,版本更新之快,真是大快人心,微软在这种优秀的框架上做了大量的精力投入,是值得赞同的,毕竟程序员驾驭在这种框架上,能够强力的精化代码,代码层次也更加优雅,扩展较为方 ...
- MongoDB 安全和访问权限控制
MongoDB的访问控制能够有效保证数据库的安全,访问控制是指绑定Application监听的IP地址,设置监听端口,使用账户和密码登录 一,访问控制的参数 1,绑定IP地址 mongod 参数:-- ...
- WebGIS中快速整合管理多源矢量服务以及服务权限控制的一种设计思路
文章版权由作者李晓晖和博客园共有,若转载请于明显处标明出处:http://www.cnblogs.com/naaoveGIS/ 1.背景 在真实项目中,往往GIS服务数据源被其他多个信息中心或者第三方 ...
- ASP.NET MVC实现权限控制
这篇分享一下 ASP.NET MVC权限控制.也就是说某一用户登录之后,某一个用户是否有权限访问Controller,Action(操作),视图等 想实现这些功能,需要在数据库创建好几个表:[User ...
- springmvc+spring+mybatis+maven项目集成shiro进行用户权限控制【转】
项目结构: 1.maven项目的pom中引入shiro所需的jar包依赖关系 ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 ...
- Appfuse:权限控制
Appfuse的权限控制依赖于Struts的Menu机制,common下的menu.jsp是对菜单顺序的定义,详细的菜单项和菜单链接及权限再menu-config.xml中控制,如下: <Men ...
- .NET WebAPI 用ActionFilterAttribute实现token令牌验证与对Action的权限控制
项目背景是一个社区类的APP(求轻吐...),博主主要负责后台业务及接口.以前没玩过webAPI,但是领导要求必须用这个(具体原因鬼知道),只好硬着头皮上了. 最近刚做完权限这一块,分享出来给大家.欢 ...
- 浅谈Yii-admin的权限控制
说到CMS,最需要有的东西就是权限控制,特别是一些复杂的场景,多用户,多角色,多部门,子父级查看等等.最近在开发一个线下销售的东东,这个系统分为管理员端,省代端,客户端,门店端,销售端, 部门端,部门 ...
- Go语言实战 - revel框架教程之权限控制
一个站点上面最基本都会有三种用户角色,未登录用户.已登录用户和管理员.这一次我们就来看看在revel框架下如何进行权限控制. 因为revel是MVC结构的,每一个url其实都会映射到一个具体的Cont ...
随机推荐
- rbac之 权限粒度控制到按钮级别
rbac之 权限粒度控制到按钮级别: 这里的意思就是 如果当前用户,没有这个权限. 那么这个相对应的这个按钮的权限, 就不应该展示.看都不能给看到. 思路: 为每一个权限,设置一个别名. 这里是这 ...
- 9.10 h5日记
9.10 1.什么是属性 属性是表示某些事物的一些特征 2.属性分为标签属性和样式属性,二者的区别在于哪里 标签属性:<img src="01.jpg" width=&quo ...
- 快速掌握Ajax-Ajax基础实例(Ajax返回Json在Java中的实现)
(转)实例二:Ajax返回Json在Java中的实现 转自http://www.cnblogs.com/lsnproj/archive/2012/02/09/2341524.html#2995114 ...
- Tomcat假死的原因及解决方案
服务器配置:linux+tomcat 现象:Linux服务器没有崩,有浏览器中访问页面,出现无法访问的情况,没有报4xx或5xx错误(假死),并且重启tomcat后,恢复正常. 原因:tomcat默认 ...
- LibreOJ 6004. 「网络流 24 题」圆桌聚餐 网络流版子题
#6004. 「网络流 24 题」圆桌聚餐 内存限制:256 MiB时间限制:5000 ms标准输入输出 题目类型:传统评测方式:Special Judge 上传者: 匿名 提交提交记录统计讨论测试数 ...
- Java界面编程—事件监听机制
组件首先要先注册事件处理器,当用户单击组件.移动鼠标或者敲击键盘时都会产生事件(Event),一旦有时间发生,应用程序就会做出对该事件的响应,这些组件就是事件源(Event source). 接受.解 ...
- c sharp dll
1. generate dll building .cs file, for example: myDll.cs using System; using System.Collections.Gene ...
- https的名词解释
原文 http://www.cnblogs.com/guogangj/p/4118605.html 那些证书相关的玩意儿(SSL,X.509,PEM,DER,CRT,CER,KEY,CSR,P12等) ...
- 在WebGrid中做 批量删除操作
一般的MVC WebGrid都是在每一行中加入 Edit Detail Delete 这些Link 去对每条记录去单独操作. 稍微研究了一下总结一个 做批量删除的办法. 1. 首先是在WebGrid中 ...
- BP神经网络测试MNIST记录
约定: 所有的初始化权值范围,如下,就是说更换激活函数的情况,没有过大的调整初始权重. if(randomMode==1): numpy.random.seed(seedWih) self.wih = ...