phabricator通过http推送和拉取代码

一、服务端配置:

检查nginx用户

[root@59et mnt]# ps -ef|grep nginx
www      12734 29854  0 Mar10 ?        00:01:16 nginx: worker process
www      12735 29854  0 Mar10 ?        00:01:20 nginx: worker process
www      12736 29854  0 Mar10 ?        00:01:09 nginx: worker process
www      12737 29854  0 Mar10 ?        00:01:15 nginx: worker process
www      12738 29854  0 Mar10 ?        00:01:16 nginx: worker process
www      12739 29854  0 Mar10 ?        00:01:22 nginx: worker process
www      12740 29854  0 Mar10 ?        00:01:17 nginx: worker process
www      12741 29854  0 Mar10 ?        00:01:21 nginx: worker process
www      12742 29854  0 Mar10 ?        00:00:00 nginx: cache manager process
root     29854     1  0  2019 ?        00:00:00 nginx: master process /opt/nginx/sbin/nginx

检查php用户

[root@59et mnt]# ps -ef|grep php
root     21288     1  0 Mar11 ?        00:00:02 php-fpm: master process (/etc/php-fpm.conf)
apache   21289 21288  0 Mar11 ?        00:06:56 php-fpm: pool www
apache   21290 21288  0 Mar11 ?        00:07:01 php-fpm: pool www
apache   21291 21288  0 Mar11 ?        00:07:01 php-fpm: pool www
apache   21292 21288  0 Mar11 ?        00:07:15 php-fpm: pool www
apache   21293 21288  0 Mar11 ?        00:06:58 php-fpm: pool www
apache   21295 21288  0 Mar11 ?        00:06:57 php-fpm: pool www
apache   21308 21288  0 Mar11 ?        00:06:55 php-fpm: pool www
apache   21400 21288  0 Mar11 ?        00:07:03 php-fpm: pool www
apache   21421 21288  0 Mar11 ?        00:07:02 php-fpm: p

检查phd用户

[root@59et mnt]# ps -ef|grep phd
phd      26182     1  0 09:26 ?        00:00:04 php ./phd-daemon
phd      26185 26182  0 09:26 ?        00:00:00 php /alidata2/phabricator/phabricator/scripts/daemon/exec/exec_daemon.php PhabricatorFactDaemon
root     28077 26077  0 10:41 pts/0    00:00:00 grep phd
[root@59et mnt]# 

赋予权限

#includedir /etc/sudoers
git ALL=(ALL)       NOPASSWD: ALL
git ALL=(phd) SETENV: NOPASSWD: /usr/bin/git-upload-pack, /usr/bin/git-receive-pack
www ALL=(phd) SETENV: NOPASSWD: /usr/local/libexec/git-core/git-http-backend
apache ALL=(phd) SETENV: NOPASSWD: /usr/local/libexec/git-core/git-http-backend

Phabricator开通支持http功能

首先,请确认Phabricator的配置项 diffusion.allow-http-auth 设置为 true。可以在 左侧菜单面板 All Setttings 中查找 diffusion.allow-http-auth ,点击之后可设置,请设置为 Allow HTTP Basic Auth。然后,所有用户需要使用 HTTP 访问仓库之前,需要设置自己的密码:点击你的头像 ---> 左侧菜单面板 Manage ---> 右侧菜单面板 Edit Settings ---> 左侧菜单面板 VCS Password, 一般来说,不需要其它配置就可以使用 HTTP 了 。VCS密码会对密码难易度做校验,建议8位以上大写字母+小写字母+数字

二、客户端测试:

提交代码:

11:37:27.922: [JWordpress] git -c core.quotepath=false -c log.showSignature=false push --progress --porcelain pha refs/heads/master:master --follow-tags
To http://phabricator.59et.com/diffusion/1/jwordpress.git
=    refs/heads/master:refs/heads/master [up to date]
Done

下载代码

11:35:49.701: [JWordpress] git -c core.quotepath=false -c log.showSignature=false push --progress --porcelain pha refs/heads/master:master --follow-tags
To http://phabricator.59et.com/diffusion/1/jwordpress.git
=    refs/heads/master:refs/heads/master [up to date]
Done

打完 收工,享受过程

三、常见问题

问题1描述:

git push到远程分支时报错 11:15:13.627: [JWordpress] git -c core.quotepath=false -c log.showSignature=false push --progress --porcelain pha refs/heads/master:master --follow-tags Delta compression using up to 8 threads. error: RPC failed; HTTP 411 curl 22 The requested URL returned error: 411 Length Required fatal: The remote end hung up unexpectedly Total 908 (delta 466), reused 774 (delta 392) fatal: The remote end hung up unexpectedly

解决方案:

客户端设置 git POST 缓冲区过小. git config http.postBuffer 524288000

目前100000+人已关注加入我们

       

       

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值