http代码_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位以上大写字母+小写字母+数字

6607588d9db982271acce9e34ed0076f.png

二、客户端测试:

提交代码:

8fec43f8025a50681066d2aa1d8f5017.png

cbb12e4d7e8a5553d892a9987d76f7af.png

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

下载代码

3695089c8cac58f78777ccd04af4a1cc.png

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

134906b84c383fd400ee1847ae787292.png

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

e756bcc275b0578ef9f1eb87374fd65f.gif 369d133069eb225da8efd364080fac05.gif 92e5c7f87bfc79b7cc1af8e12e993970.gif cda0b125fbc9ecb3f8c4c87febcfe5ec.gif b880b9051400f0d9e9598c54174aef63.gif 7a9006d44f4c2a11adeffac712ae1540.gif ddc9a30a54c6f643a4b9e6d32dcb5e48.gif bbd9c475575014e3389f1c468dbdc683.gif

c5129bb0387d42d05d624c08a2d34acf.gif d2c25ad001692ed8ea09ee65086f56d7.gif 63d72139d5e0c57797789b0f9f1ef9f3.gif f29bec6e988ee17267ca59d4b9def085.gif 50c5c0e07d77666417a1590b88d8082b.gif 41a62a0dda302a193c141795ddff24be.gif 0ab88001ce90ab94e1ac920a9d015467.gif b880b9051400f0d9e9598c54174aef63.gif

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值