Skip to content

Instantly share code, notes, and snippets.

@zengxs
Last active July 9, 2020 10:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zengxs/111935207f27cd250b70b56ef0ef0a6e to your computer and use it in GitHub Desktop.
Save zengxs/111935207f27cd250b70b56ef0ef0a6e to your computer and use it in GitHub Desktop.
Phabricator configuration
apache ALL=(phd) SETENV: NOPASSWD: /usr/bin/git, /usr/bin/git-upload-pack, /usr/bin/git-receive-pack
git ALL=(phd) SETENV: NOPASSWD: /usr/bin/git, /usr/bin/git-upload-pack, /usr/bin/git-receive-pack

phd.service

# Systemd unit file for phd
[Unit]
Description=Phabricator Daemon
After=syslog.target network.target

[Service]
Type=forking

ExecStart=/usr/share/nginx/phabricator/bin/phd start
ExecStop=/usr/share/nginx/phabricator/bin/phd stop

Restart=on-failure

User=phd
Group=phd

[Install]
WantedBy=multi-user.target

SSH 配置

复制 <phabricator_root>/resources/sshd/phabricator-ssh-hook.sh/usr/local/sbin/ 并修改其中的配置。

修改 /etc/ssh/sshd_config,向尾部添加下面的配置:

Match User git
	AllowAgentForwarding no
	AllowTcpForwarding no
	PasswordAuthentication no
	AuthorizedKeysFile none
	AuthorizedKeysCommand /usr/local/sbin/phabricator-ssh-hook.sh
	AuthorizedKeysCommandUser git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment