Phabricator
来源:互联网 发布:防水js是什么 编辑:程序博客网 时间:2024/05/18 02:59
1. 概述
官网:https://www.phacility.com/
项目地址:https://github.com/phacility/phabricator
Phabricator是一套基于Web的软件开发协作工具,一个Web应用用于帮助软件公司构建更好的软件。
原是facebook员工开发的可视化代码评审工具,现在离开facebook去Phacility,并持续维护
主要包含以下几个功能:
1. 源码的review与审核2. 代码托管,代码浏览3. BUG跟踪4. 项目管理5. 团队成员交流6. 组织风险讨论7. 事件备注,以及回顾(统计等)8. 权限设置9. 其他功能
注:以上部分来自本人翻译,有不正确的地方,请大家多多包含。哈哈
2. 安装
安装向导:https://secure.phabricator.com/book/phabricator/article/installation_guide/
Phabricator :一个基于LAMP架构的应用(Linux, Apache, MySQL, PHP)
环境要求:
1. 一个安装Linux操作系统的普通计算机,Linux版本不限(不支持Windows操作系统)2. 一个共享域名(如phabricator.mycompany.com),测试时可以使用(127.0.0.1/局域网IP限局域网内使用),域名中必须包含‘.’,官方解释是为了兼容浏览器cookie,如果没有,域名校验不通过是无法访问的3. 基本的Linux系统管理员技术(包括域名,IP,权限等配置,软件的安装等等)4. web服务器(可以根据自身情况进行选择,包括Apache, Nginx, lighttpd等)5. PHP, MySQL, and Git(基础组件的安装)
注意事项:
1. 共享主机域名:这个是必须的,而且必须用'.',Phabricator会对域名进行校验2. Web服务器:(Apache + mod_php),(nginx + php-fpm)3. ( MySQL 5.5+)(PHP 5.2+)
技术要求:常用命令行操作,软件安装,文件系统,进程管理,选项管理,软件配置,环境变量设置。
环境组件:
1. 官方提高了Ubuntu和RedHat安装脚本,如果使用这两款操作系统,可以直接使用脚本进行安装,不过还是推荐自行安装,可以遇到很多问题,然后有个更深入的理解,安装完后,直接参考配置向导进行配置。2. git:项目版本控制3. Apache, httpd, nginx4. MySQL Server (mysqld, mysql-server)5. PHP6. Phabricator项目clone
APC安装(可选,推荐):pcre-devel
3. 配置
配置向导:https://secure.phabricator.com/book/phabricator/article/configuration_guide/
Phabricator:简单的基础配置介绍
基础配置:
1. 服务器配置(本文以Nginx配置为例,操作系统 MAC OS X)2. 浏览器访问:Phabricator3. 根据指示完成配置
Nginx服务器配置:
nginx.conf
server { server_name phabricator.example.com; root /path/to/phabricator/webroot; location / { index index.php; rewrite ^/(.*)$ /index.php?__path__=/$1 last; } location /index.php { fastcgi_pass localhost:9000; fastcgi_index index.php; #required if PHP was built with --enable-force-cgi-redirect fastcgi_param REDIRECT_STATUS 200; #variables to make the $_SERVER populate in PHP fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param GATEWAY_INTERFACE CGI/1.1; fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; fastcgi_param REMOTE_ADDR $remote_addr; }}
Nginx作为前端代理服务器,配置也比较简单,主要为虚拟主机配置
1. server_name(主机、域名配置),phabricator强制要求域名中必须包含'.',否则在域名校验的时候会失败,因为这个使我花了半小时找问题,结果使用127.0.0.1进行访问,问题成功解决。官方解释是为了保证浏览器cookie的正常使用2. root(根路径配置):/path/to/phabricator/webroot3. location / (首页配置) :index.php,phabricator使用php构建的4. rewrite(重定向配置) : 5. proxy(代理配置):使用fastcgi协议进行Nginx与phabricator的通信,主要就是请求的转发 1. fastcgi_pass —— 代理主机以及端口配置 2. fastcgi_index —— 代理首页 3. fastcgi_param —— 相关参数配置,请求状态码,请求方式,等等参数
Nginx命令-》go
MySQL数据库存储配置:
MySQL安装与配置-》go
加载Phabricator数据库:
phabricator/ $ ./bin/storage upgrade
如果使用的是没有root权限的用户进行配置,需要修改Phabricator的默认用户配置(使用Root或管理员权限用户进行配置,或者将当前用户赋予root权限):
phabricator/ $ ./bin/storage upgrade --user <user> --password <password>
强制执行命令:
phabricator/ $ ./bin/storage upgrade –force
注:当更新Phabricator后,及时对数据库进行更新
接下来的配置:
* setting up your admin account and login/registration with Configuring Accounts and Registration; or (设置管理员账号,登录与注册配置)* understanding advanced configuration topics with Configuration User Guide: Advanced Configuration; or (高级配置)* configuring an alternate file domain with Configuring a File Domain; or (备用文件主机配置)* configuring a preamble script to set up the environment properly behind a load balancer, or adjust rate limiting with Configuring a Preamble Script; or (使用脚本来进行负载均衡配置,和限速配置)* configuring where uploaded files and attachments will be stored with Configuring File Storage; or (文件上传以及附件存储配置)* configuring Phabricator so it can send mail with Configuring Outbound Email; or (配置phabricator的邮件发送)* configuring inbound mail with Configuring Inbound Email; or (接入邮箱配置)* importing repositories with Diffusion User Guide; or (导入代码仓库)* learning about daemons with Managing Daemons with phd; or (守护进程的配置和学习)* learning about notification with Notifications User Guide: Setup and Configuration; or (通知的学习)* configuring backups with Configuring Backups and Performing Migrations; or (备份配置)* contributing to Phabricator with Contributor Introduction. (加入phabricator的开发维护)
3. 1 登录注册配置
用户访问配置:
Phabricator支持多种登录方式,通过管理原账号可以开启或关闭相应的登录方式。
认证方式:
1. 用户名/密码,注册登录2. LDAP(Lightweight Directory Access Protocol ):LDAP认证注册登录,具体详解-》go3. oAuth认证协议进行注册登录(GitHub, Sina, Facebook, Google)4. 其他认证方式:自定义认证方式
默认情况下,这些认证方式都是关闭的,需要管理原手动开启
覆盖管理员账号:此处的username是指Phabricator中的账号名称
phabricator/ $ ./bin/auth recover <username>
注:这里有两个概念,一个是Phabricator注册登录的username,一个是操作系统的用户,这两个将在后面的配置中会遇到,请不要弄混淆。
使用Web控制接口管理账号:
使用管理员账号登录,在首页中点击/people/,进行管理
手动创建账号:
有两种方式:1.通过上文提到的Web接口进行创建,2.通过命令行进行设置。很显然第一种方式比较简单
phabricator/ $ ./bin/accountadmin
3.2 高级配置
Configuration User Guide: Advanced Configuration(高级配置向导)
对环境配置与部署:通过配置,让Phabricator适应多种部署环境,
这是一个相对复杂的专题,并不是必须的。
配置源:优先级从高到低排列
1. 数据库:数据被存储在数据库中,管理员可以通过Web页面进行修改,拥有最高的优先级,并可以对其他配置源进行覆盖。2. 本地数据:数据被存储在~/conf/local/config.json,可以通过命令行进行修改或者进行用终端进行修改。3. 配置文件:数据被存储在/conf/文件夹下,通过修改conf/local/ENVIRONMENT文件或设置环境变量PHABRICATOR_ENV生效。4. 默认值:通过硬编码实现,不可编辑,优先级最低,可以被以上任何一个配置所覆盖
配置文件:配置文件通过了一个相对数据库配置的另一种动态选择,可以用于多环境部署。
创建配置文件:
1. exampleconfig.conf.php,文件名可自行定义,路径:phabricator/conf/custom/exampleconfig.conf.php2. 内容如下所示:以键值对形式存在,'mysql.host' => 'localhost',如果存在多个则以","进行分隔
<?phpreturn array( // Specify whichever keys and values you want to set. 'example.key' => 'examplevalue',);
3. 选择配置文件:将配置文件的名称写入phabrictor/conf/local/ENVIRONMENT文件中
phabricator/ $ echo custom/exampleconfig > conf/local/ENVIRONMENTphabricator/ $ cat conf/local/ENVIRONMENTcustom/exampleconfigphabricator/ $
或者设置全局变量:PHABRICATOR_ENV,设置该变量后要设置Web服务器环境
# Shellexport PHABRICATOR_ENV=custom/exampleconfig# ApacheSetEnv PHABRICATOR_ENV custom/exampleconfig# nginxfastcgi_param PHABRICATOR_ENV "custom/exampleconfig";# lighttpdsetenv.add-environment = ( "PHABRICATOR_ENV" => "custom/exampleconfig",)
参考
Phabricator 配置
搭建安装Phabricator代码评审工具
Phabricator入门手册
- Phabricator
- phabricator
- Phabricator
- phabricator
- phabricator安装
- Phabricator使用说明
- Phabricator配置
- Phabricator实践
- Phabricator搭建
- phabricator安装
- Phabricator使用指南
- phabricator用法
- Phabricator logo可视化代码评审工具 Phabricator
- Phabricator安装(Ubuntu)
- Phabricator 实践之安装
- Phabricator入门手册
- 初探git/phabricator
- 开发集成工具phabricator
- ubuntu apt-get 安装的路径
- python3 小知识点
- leetcode 63. Unique Paths II
- MySQL重要概念图解(重要)
- notes Windows Batch Scripting wiki
- Phabricator
- 111. Minimum Depth of Binary Tree
- 数据结构实验之求二叉树后序遍历和层次遍历
- spring boot(一):入门篇
- MongoDB3.2磁盘碎片整理---compact详述
- 数据结构实验之二叉树三:统计叶子数
- 携程基于Storm的实时大数据平台实践
- 通带纹波,阻带衰减
- 【LeetCode】500. Keyboard Row