View | Details | Raw Unified | Return to bug 233183 | Differences between
and this patch

Collapse All | Expand All

(-)devel/phabricator/Makefile (+20 lines)
Lines 70-75 Link Here
70
70
71
PHP_DESTDIR=	lib/php/phabricator
71
PHP_DESTDIR=	lib/php/phabricator
72
72
73
post-extract:
74
	@${INSTALL_DATA} ${FILESDIR}/phabricator-sudoers.sample \
75
	    ${WRKSRC}/resources/sshd/phabricator-sudoers.sample
76
77
post-patch:
78
	@${REINPLACE_CMD} -e 's|/path/to/phabricator|${LOCALBASE}/lib/php/phabricator|g' \
79
	    -e 's|vcs-user|git|g' \
80
	    ${WRKSRC}/resources/sshd/phabricator-ssh-hook.sh
81
	@${REINPLACE_CMD} -e 's|/usr/libexec/phabricator-ssh-hook.sh|${LOCALBASE}/lib/php/phabricator/resources/sshd/phabricator-ssh-hook.sh|' \
82
	    -e 's|vcs-user|git|g' \
83
	    -e 's|PrintLastLog no||g' \
84
	    -e 's|PidFile /var/run/sshd-phabricator.pid||g' \
85
	    ${WRKSRC}/resources/sshd/sshd_config.phabricator.example
86
	@${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
87
	    -e 's|daemon-user|www|g' \
88
	    -e 's|vcs-user|git|g' \
89
	    -e 's|www-user|www|g' \
90
	    ${WRKSRC}/resources/sshd/phabricator-sudoers.sample
91
	@${FIND} "${WRKSRC}" -name "*.bak" -type f -delete
92
73
do-install:
93
do-install:
74
	@${MKDIR} ${STAGEDIR}${PREFIX}/${PHP_DESTDIR}/conf/local
94
	@${MKDIR} ${STAGEDIR}${PREFIX}/${PHP_DESTDIR}/conf/local
75
	${INSTALL_DATA} ${FILESDIR}/local.json.sample \
95
	${INSTALL_DATA} ${FILESDIR}/local.json.sample \
(-)devel/phabricator/files/local.json.sample (-2 / +18 lines)
Lines 1-4 Link Here
1
{
1
{
2
  "mysql.user": "root",
2
  "phd.user": "www",
3
  "mysql.pass": ""
3
  "phd.log-directory": "/var/log",
4
  "phd.pid-directory": "/var/run/phd",
5
  "mysql.host": "localhost",
6
  "mysql.port": "3306",
7
  "mysql.user": "phabric",
8
  "mysql.pass": "SECRET",
9
  "repository.default-local-path": "/var/phabricator/repo",
10
  "storage.local-disk.path": "/var/phabricator/files",
11
  "phabricator.base-uri": "http://phabricator.example.com/",
12
  "phabricator.show-prototypes": true,
13
  "diffusion.ssh-user": "git",
14
  "diffusion.ssh-port": 22,
15
  "phpmailer.smtp-host": "mail.example.com",
16
  "phpmailer.smtp-port": 25,
17
  "phpmailer.smtp-user": "phabricator@example.com",
18
  "phpmailer.smtp-password": "SECRET",
19
  "phpmailer.smtp-protocol": "tls"
4
}
20
}
(-)devel/phabricator/files/phabricator-sudoers.sample (+4 lines)
Line 0 Link Here
1
# Phabricator sudoers file.
2
3
www-user ALL=(daemon-user) SETENV: NOPASSWD: %%LOCALBASE%%/bin/git, %%LOCALBASE%%/libexec/git-core/git-http-backend, %%LOCALBASE%%/bin/hg, %%LOCALBASE%%/bin/ssh, /usr/bin/ssh
4
vcs-user ALL=(daemon-user) SETENV: NOPASSWD: %%LOCALBASE%%/bin/git, %%LOCALBASE%%/bin/git-upload-pack, %%LOCALBASE%%/bin/git-receive-pack, %%LOCALBASE%%/bin/hg, %%LOCALBASE%%/bin/svnserve, %%LOCALBASE%%/bin/ssh, /usr/bin/ssh
(-)devel/phabricator/files/phd.in (-5 / +29 lines)
Lines 4-10 Link Here
4
#
4
#
5
5
6
# PROVIDE: phd
6
# PROVIDE: phd
7
# REQUIRE: LOGIN
7
# REQUIRE: LOGIN mysql
8
# KEYWORD: shutdown
8
# KEYWORD: shutdown
9
9
10
#
10
#
Lines 23-33 Link Here
23
23
24
: ${phd_enable="NO"}
24
: ${phd_enable="NO"}
25
: ${phd_user="www"}
25
: ${phd_user="www"}
26
: ${phd_pids_dir=""}
26
27
27
command="%%PREFIX%%/lib/php/phabricator/bin/phd"
28
command="%%PREFIX%%/lib/php/phabricator/bin/phd"
29
phd_config="%%PREFIX%%/lib/php/phabricator/conf/local/local.json"
28
30
29
extra_commands="launch list log"
31
extra_commands="launch list log"
30
poll_cmd="phd_poll"
32
poll_cmd="phd_poll"
33
start_precmd="${name}_prestart"
34
start_cmd="${command} start"
31
stop_cmd="${command} stop"
35
stop_cmd="${command} stop"
32
status_cmd="${command} status"
36
status_cmd="${command} status"
33
restart_cmd="phd_restart"
37
restart_cmd="phd_restart"
Lines 35-50 Link Here
35
list_cmd="${command} list"
39
list_cmd="${command} list"
36
log_cmd="${command} log"
40
log_cmd="${command} log"
37
41
38
start_precmd="eval command_args=start"
42
required_files="${phd_config}"
39
43
40
required_files="%%PREFIX%%/lib/php/phabricator/conf/local/local.json"
41
42
PATH="${PATH}:%%PREFIX%%/bin"
44
PATH="${PATH}:%%PREFIX%%/bin"
43
45
46
if [ ! -n "${phd_pids_dir}" ]; then
47
	# Try to read from config.
48
	phd_pids_dir=$(grep -Eo '"phd.pid-directory":(\d*?,|.*?[^\\]",)' \
49
	    "${phd_config}" | \
50
		sed -e "s/\"phd.pid-directory\" *: *\"//" -e 's/",.*//')
51
fi
52
if [ ! -n "${phd_pids_dir}" ]; then
53
	# Default location.
54
	phd_pids_dir="/var/tmp/phd/pid"
55
fi
56
57
58
phd_prestart()
59
{
60
	install -d -o "${phd_user}" -g wheel -m 0777 "${phd_pids_dir}"
61
	find "${phd_pids_dir}" -name "daemon.*" -type f -delete
62
}
63
44
phd_poll()
64
phd_poll()
45
{
65
{
46
	pids=`${status_cmd} 2>/dev/null | awk '{ print $4 }' | egrep "^[0-9]+$" | sort | uniq`
66
	pids=`${status_cmd} 2>/dev/null | awk '{ print $4 }' | egrep "^[0-9]+$" | sort | uniq`
47
	wait_for_pids $pids
67
	if [ -n "${pids}" ]; then
68
		kill "${pids}"
69
		wait_for_pids "${pids}"
70
	fi
71
	find "${phd_pids_dir}" -name "daemon.*" -type f -delete
48
}
72
}
49
73
50
phd_restart()
74
phd_restart()
(-)devel/phabricator/files/pkg-message.in (+32 lines)
Lines 29-31 Link Here
29
to fix permissions of /var/tmp/phd and repositories. Alternatively
29
to fix permissions of /var/tmp/phd and repositories. Alternatively
30
you can continue to run phabricator daemons as root by adding
30
you can continue to run phabricator daemons as root by adding
31
phd_user="root" to /etc/rc.conf.
31
phd_user="root" to /etc/rc.conf.
32
Phabricator daemons and ssh-git requires setup sudo, example config:
33
%%PREFIX%%lib/php/phabricator/resources/sshd/phabricator-sudoers.sample
34
35
Phabricator example config installed here:
36
%%PREFIX%%lib/php/phabricator/conf/local/local.json.sample
37
38
Dont forget after update run:
39
service phd stop
40
cd %%PREFIX%%/lib/php/phabricator/
41
./bin/storage upgrade
42
service phd start
43
44
If you want to work with git via SSH, add to you sshd.conf
45
and restart openssh:
46
========================================================================
47
Match User git
48
	AllowUsers git
49
	AuthorizedKeysCommand %%PREFIX%%/lib/php/phabricator/resources/sshd/phabricator-ssh-hook.sh
50
	AuthorizedKeysCommandUser git
51
	AuthorizedKeysFile none
52
	AuthenticationMethods publickey
53
	PermitRootLogin no
54
	PasswordAuthentication no
55
	PermitTTY no
56
	AllowAgentForwarding no
57
	AllowTcpForwarding no
58
	GatewayPorts no
59
	PermitOpen none
60
	PermitTunnel no
61
	X11Forwarding no
62
========================================================================
63
(-)devel/phabricator/pkg-plist (+1 lines)
Lines 2165-2170 Link Here
2165
lib/php/phabricator/resources/sql/stopwords.txt
2165
lib/php/phabricator/resources/sql/stopwords.txt
2166
lib/php/phabricator/resources/sql/stopwords_myisam.txt
2166
lib/php/phabricator/resources/sql/stopwords_myisam.txt
2167
lib/php/phabricator/resources/sshd/phabricator-ssh-hook.sh
2167
lib/php/phabricator/resources/sshd/phabricator-ssh-hook.sh
2168
lib/php/phabricator/resources/sshd/phabricator-sudoers.sample
2168
lib/php/phabricator/resources/sshd/sshd_config.phabricator.example
2169
lib/php/phabricator/resources/sshd/sshd_config.phabricator.example
2169
lib/php/phabricator/scripts/__init_script__.php
2170
lib/php/phabricator/scripts/__init_script__.php
2170
lib/php/phabricator/scripts/almanac/manage_almanac.php
2171
lib/php/phabricator/scripts/almanac/manage_almanac.php

Return to bug 233183