author | wenzelm |
Thu, 12 Dec 2019 15:42:58 +0100 | |
changeset 71278 | 197aa6b57a83 |
parent 71276 | b4401dfd6544 |
child 71279 | 2e873da296ae |
permissions | -rw-r--r-- |
71099 | 1 |
(*:maxLineLen=78:*) |
2 |
||
3 |
theory Phabricator |
|
4 |
imports Base |
|
5 |
begin |
|
6 |
||
7 |
chapter \<open>Phabricator server administration\<close> |
|
8 |
||
9 |
text \<open> |
|
10 |
Phabricator\<^footnote>\<open>\<^url>\<open>https://www.phacility.com/phabricator\<close>\<close> is an open-source |
|
11 |
product to support the development process of complex software projects |
|
12 |
(open or closed ones). The official slogan is: |
|
13 |
||
14 |
\begin{quote} |
|
15 |
Discuss. Plan. Code. Review. Test. \\ |
|
16 |
Every application your project needs, all in one tool. |
|
17 |
\end{quote} |
|
18 |
||
19 |
Ongoing changes and discussions about changes are maintained uniformly |
|
20 |
within a MySQL database. There are standard connections to major version |
|
21 |
control systems: \<^bold>\<open>Subversion\<close>, \<^bold>\<open>Mercurial\<close>, \<^bold>\<open>Git\<close>. So Phabricator offers |
|
22 |
a counter-model to trends of monoculture and centralized version control, |
|
23 |
especially due to Microsoft's Github and Atlassian's Bitbucket. |
|
24 |
||
25 |
The small company behind Phabricator provides paid plans for support and |
|
71131 | 26 |
hosting of servers, but it is easy to do \<^emph>\<open>independent self-hosting\<close> on a |
27 |
standard LAMP server (Linux, Apache, MySQL, PHP). This merely requires a |
|
28 |
virtual machine on the Net, which can be rented cheaply from local hosting |
|
29 |
providers --- there is no need to follow big cloud corporations. So it is |
|
30 |
feasible to remain the master of your virtual home, following the slogan |
|
31 |
``own all your data''. In many respects, Phabricator is similar to the |
|
32 |
well-known Nextcloud\<^footnote>\<open>\<^url>\<open>https://nextcloud.org\<close>\<close> product, concerning both |
|
33 |
the technology and sociology. |
|
71099 | 34 |
|
35 |
\<^medskip> |
|
36 |
The following Phabricator instances may serve as examples: |
|
37 |
||
38 |
\<^item> Phabricator development \<^url>\<open>https://secure.phabricator.com\<close> |
|
39 |
\<^item> Wikimedia development \<^url>\<open>https://phabricator.wikimedia.org\<close> |
|
71133 | 40 |
\<^item> Blender development \<^url>\<open>https://developer.blender.org/\<close> |
71099 | 41 |
\<^item> Mercurial development \<^url>\<open>https://phab.mercurial-scm.org\<close> |
42 |
\<^item> Isabelle development \<^url>\<open>https://isabelle-dev.sketis.net\<close> |
|
43 |
||
71131 | 44 |
\<^medskip> Initial Phabricator configuration requires many details to be done |
71105 | 45 |
right.\<^footnote>\<open>See also |
46 |
\<^url>\<open>https://secure.phabricator.com/book/phabricator/article/installation_guide\<close> |
|
47 |
in the context of \<^url>\<open>https://help.ubuntu.com/lts/serverguide\<close>.\<close> Isabelle |
|
48 |
provides some command-line tools to help with the setup, and afterwards |
|
49 |
Isabelle support is optional: it is possible to run and maintain the server, |
|
71131 | 50 |
without requiring the somewhat bulky Isabelle distribution again. |
71099 | 51 |
\<close> |
52 |
||
53 |
||
54 |
section \<open>Quick start\<close> |
|
55 |
||
56 |
text \<open> |
|
71131 | 57 |
The starting point is a fresh installation of \<^bold>\<open>Ubuntu 18.04 |
58 |
LTS\<close>\<^footnote>\<open>\<^url>\<open>https://ubuntu.com/download\<close>\<close>: this version is mandatory due to |
|
59 |
subtle dependencies on system packages and configuration that is assumed by |
|
60 |
the Isabelle setup tool. |
|
71099 | 61 |
|
62 |
For production use, a proper \<^emph>\<open>Virtual Server\<close> or \<^emph>\<open>Root Server\<close> product |
|
63 |
from a hosting provider will be required, including an Internet Domain Name |
|
64 |
(a pseudo sub-domain in the style of Apache is sufficient). |
|
65 |
||
66 |
Initial experimentation also works on a local host, e.g.\ via |
|
71131 | 67 |
VirtualBox\<^footnote>\<open>\<^url>\<open>https://www.virtualbox.org\<close>\<close>. The public domain \<^verbatim>\<open>lvh.me\<close> is |
68 |
used below: it maps arbitrary subdomains to \<^verbatim>\<open>localhost\<close>. |
|
71099 | 69 |
|
70 |
All administrative commands need to be run as \<^verbatim>\<open>root\<close> user (e.g.\ via |
|
71131 | 71 |
\<^verbatim>\<open>sudo\<close>). Note that Isabelle refers to user-specific configuration in the |
72 |
user home directory via @{setting ISABELLE_HOME_USER} |
|
73 |
(\secref{sec:settings}); that may be different or absent for the root user |
|
74 |
and thus cause confusion. |
|
71099 | 75 |
\<close> |
76 |
||
77 |
||
78 |
subsection \<open>Initial setup\<close> |
|
79 |
||
80 |
text \<open> |
|
71131 | 81 |
Isabelle can manage multiple named Phabricator installations: this allows to |
82 |
separate administrative responsibilities, e.g.\ different approaches to user |
|
83 |
management for different projects. Subsequently we always use the default |
|
84 |
name ``\<^verbatim>\<open>vcs\<close>'': it will appear in file and directory locations, internal |
|
85 |
database names and URLs. |
|
71099 | 86 |
|
71131 | 87 |
The initial setup works as follows (with full Linux package upgrade): |
71099 | 88 |
|
89 |
@{verbatim [display] \<open> isabelle phabricator_setup -U\<close>} |
|
90 |
||
71131 | 91 |
After installing many packages, cloning the Phabricator distribution, |
92 |
initializing the MySQL database and Apache, the tool prints an URL for |
|
93 |
further configuration. The following needs to be provided by the web |
|
94 |
interface: |
|
71099 | 95 |
|
71131 | 96 |
\<^item> An initial user that will get administrator rights. There is no need to |
97 |
create a special \<^verbatim>\<open>admin\<close> account. Instead, a regular user that will take |
|
98 |
over this responsibility can be used here. Subsequently we assume that |
|
99 |
user \<^verbatim>\<open>makarius\<close> becomes the initial administrator. |
|
71099 | 100 |
|
101 |
\<^item> An \<^emph>\<open>Auth Provider\<close> to manage user names and passwords. None is provided |
|
102 |
by default, and Phabricator points out this omission prominently in its |
|
103 |
overview of \<^emph>\<open>Setup Issues\<close>: following these hints quickly leads to the |
|
104 |
place where a regular \<^emph>\<open>Username/Password\<close> provider can be added. |
|
105 |
||
71131 | 106 |
Alternatively, Phabricator can delegate the responsibility of |
107 |
authentication to big corporations like Google and Facebook, but these can |
|
108 |
be ignored. Genuine self-hosting means to manage users directly, without |
|
109 |
outsourcing of authentication. |
|
71099 | 110 |
|
71131 | 111 |
\<^item> A proper password for the administrator can now be set, e.g.\ by the |
112 |
following command: |
|
71099 | 113 |
|
71131 | 114 |
@{verbatim [display] \<open> isabelle phabricator bin/auth recover makarius\<close>} |
71099 | 115 |
|
71131 | 116 |
The printed URL gives access to a login and password dialog in the web |
117 |
interface. |
|
71099 | 118 |
|
71131 | 119 |
Any further users will be able to provide a password directly, because the |
120 |
Auth Provider is already active. |
|
121 |
||
122 |
\<^item> The list of Phabricator \<^bold>\<open>Setup Issues\<close> should be studied with some |
|
123 |
care, to make sure that no serious problems are remaining. The request to |
|
124 |
lock the configuration can be fulfilled as follows: |
|
71099 | 125 |
|
71131 | 126 |
@{verbatim [display] \<open> isabelle phabricator bin/auth lock\<close>} |
71099 | 127 |
|
71131 | 128 |
\<^medskip> A few other Setup Issues might be relevant as well, e.g.\ the timezone |
129 |
of the server. Some more exotic points can be ignored: Phabricator |
|
130 |
provides careful explanations about what it thinks could be wrong, always |
|
131 |
leaving some room for interpretation. |
|
71099 | 132 |
\<close> |
133 |
||
134 |
||
135 |
subsection \<open>Mailer configuration\<close> |
|
136 |
||
137 |
text \<open> |
|
138 |
The next important thing is messaging: Phabricator needs to be able to |
|
71131 | 139 |
communicate with users on its own account, e.g.\ to reset passwords. The |
140 |
documentation has many variations on \<^emph>\<open>Configuring Outbound |
|
141 |
Email\<close>\<^footnote>\<open>\<^url>\<open>https://secure.phabricator.com/book/phabricator/article/configuring_outbound_email\<close>\<close>, |
|
142 |
but a conventional SMTP server with a dedicated \<^verbatim>\<open>phabricator\<close> user is |
|
143 |
sufficient. There is no need to run a separate mail server on the |
|
144 |
self-hosted Linux machine: hosting providers often include such a service |
|
145 |
for free, e.g.\ as part of a web-hosting package. As a last resort it is |
|
146 |
also possible to use a corporate service like Gmail, but such dependency |
|
147 |
dilutes the whole effort of self-hosting. |
|
71099 | 148 |
|
149 |
\<^medskip> |
|
150 |
Mailer configuration requires a few command-line invocations as follows: |
|
151 |
||
152 |
@{verbatim [display] \<open> isabelle phabricator_setup_mail\<close>} |
|
153 |
||
71131 | 154 |
\<^noindent> This generates a JSON template file for the the mail account details. |
155 |
After editing that, the subsequent command will add and test it with |
|
156 |
Phabricator: |
|
71099 | 157 |
|
158 |
@{verbatim [display] \<open> isabelle phabricator_setup_mail -T makarius\<close>} |
|
159 |
||
71131 | 160 |
This tells Phabricator to send a message to the administrator created |
161 |
before; the output informs about success or errors. |
|
162 |
||
163 |
The mail configuration process can be refined and repeated until it works |
|
164 |
properly: host name, port number, protocol etc.\ all need to be correct. The |
|
165 |
\<^verbatim>\<open>key\<close> field in the JSON file identifies the name of the configuration that |
|
71099 | 166 |
will be overwritten each time, when taking over the parameters via |
167 |
\<^verbatim>\<open>isabelle phabricator_setup_mail\<close>. |
|
168 |
||
169 |
\<^medskip> |
|
71131 | 170 |
This is how to query the current mail configuration: |
71099 | 171 |
|
71103 | 172 |
@{verbatim [display] \<open> isabelle phabricator bin/config get cluster.mailers\<close>} |
173 |
\<close> |
|
174 |
||
175 |
||
71132 | 176 |
subsection \<open>SSH configuration\<close> |
177 |
||
178 |
text \<open> |
|
179 |
SSH configuration is optional, but important to access hosted repositories |
|
180 |
with public-key authentication. |
|
181 |
||
182 |
The subsequent configuration is convenient, but also ambitious: it takes |
|
183 |
away the standard port 22 from the operating system and assigns it to |
|
71267 | 184 |
Isabelle/Phabricator: |
71132 | 185 |
|
186 |
@{verbatim [display] \<open> isabelle phabricator_setup_ssh -p 22 -q 222\<close>} |
|
187 |
||
188 |
Afterwards, remote login to the server host needs to use that alternative |
|
71267 | 189 |
port 222. If there is a problem with it, the administrator can usually |
190 |
connect to a remote console via some web interface of the virtual server |
|
191 |
provider. |
|
71132 | 192 |
|
193 |
\<^medskip> |
|
71267 | 194 |
The following alternative is more modest: it uses port 2222 for Phabricator, |
195 |
and retains port 22 for the operating system: |
|
71132 | 196 |
|
197 |
@{verbatim [display] \<open> isabelle phabricator_setup_ssh -p 2222 -q 22\<close>} |
|
198 |
||
199 |
\<^medskip> |
|
200 |
The tool can be invoked multiple times with different parameters; ports are |
|
201 |
changed back and forth each time and services restarted. |
|
202 |
\<close> |
|
203 |
||
204 |
||
71278 | 205 |
subsection \<open>Public domain name and HTTPS configuration\<close> |
206 |
||
207 |
text \<open> |
|
208 |
So far the Phabricator server has been accessible only on \<^verbatim>\<open>localhost\<close> (via |
|
209 |
the alias \<^verbatim>\<open>lvh.me\<close>). Proper configuration of a public Internet domain name |
|
210 |
(with HTTPS certificate from \<^emph>\<open>Let's Encrypt\<close>) works as follows. |
|
211 |
||
212 |
\<^item> Register a subdomain (e.g.\ \<^verbatim>\<open>vcs.example.org\<close>) as an alias for the IP |
|
213 |
address of the underlying Linux host. This usually works by some web |
|
214 |
interface of the hosting provider to edit DNS entries; it might require |
|
215 |
some time for updated DNS records to become publicly available. |
|
216 |
||
217 |
\<^item> Edit the Phabricator website configuration file in |
|
218 |
\<^path>\<open>/etc/apache2/sites-available/\<close> to specify \<^verbatim>\<open>ServerName\<close> and |
|
219 |
\<^verbatim>\<open>ServerAdmin\<close> like this: @{verbatim [display] \<open> ServerName vcs.example.org |
|
220 |
ServerAdmin webmaster@example.org\<close>} |
|
221 |
||
222 |
Then reload (or restart) Apache like this: |
|
223 |
@{verbatim [display] \<open> systemctl reload apache2\<close>} |
|
224 |
||
225 |
\<^item> Install \<^verbatim>\<open>certbot\<close> from \<^url>\<open>https://certbot.eff.org\<close> following the |
|
226 |
description for Apache and Ubuntu 18.04 on |
|
227 |
\<^url>\<open>https://certbot.eff.org/lets-encrypt/ubuntubionic-apache\<close>. Run |
|
228 |
\<^verbatim>\<open>certbot\<close> interactively and let it operate on the domain |
|
229 |
\<^verbatim>\<open>vcs.example.org\<close>. |
|
230 |
||
231 |
\<^item> Inform Phabricator about its new domain name like this: |
|
232 |
@{verbatim [display] \<open> isabelle phabricator bin/config set |
|
233 |
phabricator.base-uri https://vcs.example.org\<close>} |
|
234 |
||
235 |
\<^item> Visit the website \<^verbatim>\<open>https://vcs.example.org\<close> and continue Phabricator |
|
236 |
configuration as described before. The following options are particularly |
|
237 |
relevant for a public website: |
|
238 |
||
239 |
\<^item> \<^emph>\<open>Auth Provider / Username/Password\<close>: disable \<^emph>\<open>Allow Registration\<close> to |
|
240 |
avoid arbitrary registrants; users can be invited via email instead. |
|
241 |
||
242 |
\<^item> Enable \<^verbatim>\<open>policy.allow-public\<close> to allow read-only access to resources, |
|
243 |
without requiring user registration. |
|
244 |
\<close> |
|
245 |
||
246 |
||
71271 | 247 |
section \<open>Global data storage and backups\<close> |
248 |
||
249 |
text \<open> |
|
250 |
The global state of a Phabricator installation consists of two main parts: |
|
251 |
||
252 |
\<^enum> The \<^emph>\<open>root directory\<close> according to |
|
253 |
\<^path>\<open>/etc/isabelle-phabricator.conf\<close> or \<^verbatim>\<open>isabelle phabricator -l\<close>: it |
|
254 |
contains the main PHP program suite with administrative tools, and some |
|
255 |
configuration files. The default setup also puts hosted repositories here |
|
256 |
(subdirectory \<^verbatim>\<open>repo\<close>). |
|
257 |
||
258 |
\<^enum> Multiple \<^emph>\<open>MySQL databases\<close> with a common prefix derived from the |
|
259 |
installation name --- the same name is used as database user name. |
|
260 |
||
261 |
The Linux root may invoke \<^verbatim>\<open>/usr/local/bin/isabelle-phabricator-dump\<close> to |
|
262 |
create a complete database dump within the root directory. Afterwards it is |
|
263 |
sufficient to make a conventional \<^bold>\<open>file-system backup\<close> of everything. To |
|
264 |
restore the database state, see the explanations on \<^verbatim>\<open>mysqldump\<close> in |
|
265 |
\<^url>\<open>https://secure.phabricator.com/book/phabricator/article/configuring_backups\<close>. |
|
266 |
\<close> |
|
267 |
||
268 |
||
71103 | 269 |
section \<open>Reference of command-line tools\<close> |
270 |
||
271 |
text \<open> |
|
272 |
The subsequent command-line tools usually require root user privileges on |
|
273 |
the underlying Linux system (e.g.\ via \<^verbatim>\<open>sudo bash\<close> to open a subshell, or |
|
71131 | 274 |
directly via \<^verbatim>\<open>sudo isabelle phabricator ...\<close>). |
71103 | 275 |
\<close> |
276 |
||
277 |
||
278 |
subsection \<open>\<^verbatim>\<open>isabelle phabricator\<close>\<close> |
|
279 |
||
280 |
text \<open> |
|
281 |
The @{tool_def phabricator} tool invokes a GNU bash command-line within the |
|
282 |
Phabricator home directory: |
|
283 |
@{verbatim [display] |
|
284 |
\<open>Usage: isabelle phabricator [OPTIONS] COMMAND [ARGS...] |
|
285 |
||
286 |
Options are: |
|
287 |
-l list available Phabricator installations |
|
288 |
-n NAME Phabricator installation name (default: "vcs") |
|
289 |
||
290 |
Invoke a command-line tool within the home directory of the named |
|
291 |
Phabricator installation.\<close>} |
|
292 |
||
293 |
Isabelle/Phabricator installations are registered in the global |
|
294 |
configuration file \<^path>\<open>/etc/isabelle-phabricator.conf\<close>, with name and |
|
295 |
root directory separated by colon (no extra whitespace). The home directory |
|
296 |
is the subdirectory \<^verbatim>\<open>phabricator\<close> within the root. |
|
297 |
||
298 |
\<^medskip> Option \<^verbatim>\<open>-l\<close> lists the available Phabricator installations with name and |
|
71276
b4401dfd6544
clarified "isabelle phabricator -l": avoid surprise with non-existent default installation;
wenzelm
parents:
71271
diff
changeset
|
299 |
root directory --- without invoking a command. |
71103 | 300 |
|
301 |
Option \<^verbatim>\<open>-n\<close> selects the explicitly named Phabricator installation. |
|
302 |
\<close> |
|
303 |
||
304 |
||
305 |
subsubsection \<open>Examples\<close> |
|
306 |
||
307 |
text \<open> |
|
308 |
Print the home directory of the Phabricator installation: |
|
71132 | 309 |
@{verbatim [display] \<open> isabelle phabricator pwd\<close>} |
71103 | 310 |
|
311 |
Print some Phabricator configuration information: |
|
71132 | 312 |
@{verbatim [display] \<open> isabelle phabricator bin/config get phabricator.base-uri\<close>} |
71103 | 313 |
|
314 |
The latter conforms to typical command templates seen in the original |
|
315 |
Phabricator documentation: |
|
71132 | 316 |
@{verbatim [display] \<open> phabricator/ $ ./bin/config get phabricator.base-uri\<close>} |
71103 | 317 |
|
318 |
Here the user is meant to navigate to the Phabricator home manually, in |
|
71131 | 319 |
contrast to \<^verbatim>\<open>isabelle phabricator\<close> doing it automatically thanks to the |
320 |
global configuration \<^path>\<open>/etc/isabelle-phabricator.conf\<close>. |
|
71103 | 321 |
\<close> |
322 |
||
323 |
||
324 |
subsection \<open>\<^verbatim>\<open>isabelle phabricator_setup\<close>\<close> |
|
325 |
||
326 |
text \<open> |
|
327 |
The @{tool_def phabricator_setup} installs a fresh Phabricator instance on |
|
71131 | 328 |
Ubuntu 18.04 LTS: |
71103 | 329 |
@{verbatim [display] \<open>Usage: isabelle phabricator_setup [OPTIONS] |
330 |
||
331 |
Options are: |
|
332 |
-R DIR repository directory (default: "/var/www/phabricator-NAME/repo") |
|
333 |
-U full update of system packages before installation |
|
334 |
-n NAME Phabricator installation name (default: "vcs") |
|
335 |
-r DIR installation root directory (default: "/var/www/phabricator-NAME") |
|
336 |
||
337 |
Install Phabricator as LAMP application (Linux, Apache, MySQL, PHP). |
|
338 |
||
339 |
The installation name (default: "vcs") is mapped to a regular |
|
340 |
Unix user; this is relevant for public SSH access.\<close>} |
|
341 |
||
71131 | 342 |
Installation requires Linux root permissions. All required packages are |
71103 | 343 |
installed automatically beforehand, this includes the Apache web server and |
344 |
the MySQL database engine. |
|
345 |
||
71131 | 346 |
Global configuration in \<^verbatim>\<open>/etc\<close> or a few other directories like \<^verbatim>\<open>/var/www\<close> |
347 |
uses name prefixes like \<^verbatim>\<open>isabelle-phabricator\<close> or \<^verbatim>\<open>phabricator\<close>. Local |
|
71103 | 348 |
configuration for a particular installation uses more specific names derived |
71131 | 349 |
from \<^verbatim>\<open>phabricator-\<close>\<open>NAME\<close>, e.g.\ \<^verbatim>\<open>/var/www/phabricator-vcs\<close> for the |
350 |
default. |
|
71103 | 351 |
|
71131 | 352 |
Knowing the naming conventions, it is possible to purge a Linux installation |
353 |
from Isabelle/Phabricator with some effort, but there is no automated |
|
354 |
procedure for de-installation. In the worst case, it might be better to |
|
355 |
re-install the virtual machine from a clean image. |
|
71103 | 356 |
|
357 |
\<^medskip> |
|
358 |
Option \<^verbatim>\<open>-U\<close> ensures a full update of system packages, before installing |
|
71131 | 359 |
further packages required by Phabricator. This might require to reboot. |
71103 | 360 |
|
361 |
Option \<^verbatim>\<open>-n\<close> provides an alternative installation name. The default name |
|
71131 | 362 |
\<^verbatim>\<open>vcs\<close> means ``version control system''. The name appears in the URL for SSH |
363 |
access, and thus has some relevance to end-users. The initial server URL |
|
364 |
also uses the same suffix, but that can (and should) be changed later via |
|
365 |
regular Apache configuration. |
|
71103 | 366 |
|
367 |
Option \<^verbatim>\<open>-r\<close> specifies an alternative installation root directory: it needs |
|
368 |
to be accessible for the Apache web server. |
|
369 |
||
370 |
Option \<^verbatim>\<open>-R\<close> specifies an alternative directory for repositories that are |
|
371 |
hosted by Phabricator. Provided that it is accessible for the Apache web |
|
71131 | 372 |
server, the directory can be reused for the \<^verbatim>\<open>hgweb\<close> view by Mercurial.\<^footnote>\<open>See |
373 |
also the documentation |
|
374 |
\<^url>\<open>https://www.mercurial-scm.org/wiki/PublishingRepositories\<close> and the |
|
375 |
example \<^url>\<open>https://isabelle.sketis.net/repos\<close>.\<close> |
|
71103 | 376 |
\<close> |
377 |
||
378 |
||
379 |
subsection \<open>\<^verbatim>\<open>isabelle phabricator_setup_mail\<close>\<close> |
|
380 |
||
381 |
text \<open> |
|
382 |
The @{tool_def phabricator_setup_mail} provides mail configuration for an |
|
71131 | 383 |
existing Phabricator installation: |
71103 | 384 |
@{verbatim [display] \<open>Usage: isabelle phabricator_setup_mail [OPTIONS] |
385 |
||
386 |
Options are: |
|
387 |
-T USER send test mail to Phabricator user |
|
388 |
-f FILE config file (default: "mailers.json" within |
|
389 |
Phabricator root) |
|
390 |
-n NAME Phabricator installation name (default: "vcs") |
|
391 |
||
392 |
Provide mail configuration for existing Phabricator installation.\<close>} |
|
393 |
||
394 |
Proper mail configuration is vital for Phabricator, but the details can be |
|
395 |
tricky. A common approach is to re-use an existing SMTP mail service, as is |
|
71131 | 396 |
often included in regular web hosting packages. It is sufficient to create |
397 |
one mail account for multiple Phabricator installations, but the |
|
398 |
configuration needs to be set for each installation. |
|
71103 | 399 |
|
400 |
The first invocation of \<^verbatim>\<open>isabelle phabricator_setup_mail\<close> without options |
|
401 |
creates a JSON template file. Its \<^verbatim>\<open>key\<close> entry should be changed to |
|
402 |
something sensible to identify the configuration, e.g.\ the Internet Domain |
|
71131 | 403 |
Name of the mail address. The \<^verbatim>\<open>options\<close> specify the SMTP server address and |
404 |
account information. |
|
71103 | 405 |
|
406 |
Another invocation of \<^verbatim>\<open>isabelle phabricator_setup_mail\<close> with updated JSON |
|
407 |
file will change the underlying Phabricator installation. This can be done |
|
408 |
repeatedly, until everything works as expected. |
|
409 |
||
410 |
Option \<^verbatim>\<open>-T\<close> invokes a standard Phabricator test procedure for the mail |
|
411 |
configuration. The argument needs to be a valid Phabricator user: the mail |
|
412 |
address is derived from the user profile. |
|
413 |
||
414 |
Option \<^verbatim>\<open>-f\<close> refers to an existing JSON configuration file, e.g.\ from a |
|
71131 | 415 |
previous successful Phabricator installation: sharing mailers setup with the |
416 |
same mail address is fine for outgoing mails; incoming mails are optional |
|
417 |
and not configured here. |
|
71099 | 418 |
\<close> |
419 |
||
71132 | 420 |
|
421 |
subsection \<open>\<^verbatim>\<open>isabelle phabricator_setup_ssh\<close>\<close> |
|
422 |
||
423 |
text \<open> |
|
424 |
The @{tool_def phabricator_setup_ssh} configures a special SSH service |
|
425 |
for all Phabricator installations: |
|
426 |
@{verbatim [display] \<open>Usage: isabelle phabricator_setup_ssh [OPTIONS] |
|
427 |
||
428 |
Options are: |
|
429 |
-p PORT sshd port for Phabricator servers (default: 2222) |
|
430 |
-q PORT sshd port for the operating system (default: 22) |
|
431 |
-T test the ssh service for each Phabricator installation |
|
432 |
||
433 |
Configure ssh service for all Phabricator installations: a separate sshd |
|
434 |
is run in addition to the one of the operating system, and ports need to |
|
435 |
be distinct. |
|
436 |
||
437 |
A particular Phabricator installation is addressed by using its |
|
438 |
name as the ssh user; the actual Phabricator user is determined via |
|
439 |
stored ssh keys.\<close>} |
|
440 |
||
441 |
This is optional, but very useful. It allows to refer to hosted repositories |
|
442 |
via ssh with the usual public-key authentication. It also allows to |
|
443 |
communicate with a Phabricator server via the JSON API of |
|
444 |
\<^emph>\<open>Conduit\<close>\<^footnote>\<open>\<^url>\<open>https://secure.phabricator.com/book/phabricator/article/conduit\<close>\<close>. |
|
445 |
||
446 |
\<^medskip> The Phabricator SSH server distinguishes installations by their name, |
|
447 |
e.g.\ \<^verbatim>\<open>vcs\<close> as SSH user name. The public key that is used for |
|
448 |
authentication identifies the user within Phabricator: there is a web |
|
449 |
interface to provide that as part of the user profile. |
|
450 |
||
451 |
The operating system already has an SSH server (by default on port 22) that |
|
452 |
remains important for remote administration of the machine. |
|
453 |
||
454 |
\<^medskip> |
|
455 |
Options \<^verbatim>\<open>-p\<close> and \<^verbatim>\<open>-q\<close> allow to change the port assignment for both servers. |
|
456 |
A common scheme is \<^verbatim>\<open>-p 22 -q 222\<close> to leave the standard port to |
|
457 |
Phabricator, to simplify the ssh URL that users will see for remote |
|
458 |
repository clones. |
|
459 |
||
460 |
Redirecting the operating system sshd to port 222 requires some care: it |
|
461 |
requires to adjust the remote login procedure, e.g.\ in \<^verbatim>\<open>$HOME/.ssh/config\<close> |
|
462 |
to add a \<^verbatim>\<open>Port\<close> specification for the server machine. |
|
463 |
||
464 |
\<^medskip> |
|
465 |
Option \<^verbatim>\<open>-T\<close> tests the SSH connection by communicating via Conduit. This |
|
466 |
requires to install the public key of the Linux root in some Phabricator |
|
467 |
user profile, e.g.\ for the administrator. |
|
468 |
\<close> |
|
469 |
||
71099 | 470 |
end |