src/Doc/System/Phabricator.thy
author wenzelm
Tue, 12 Nov 2019 22:15:21 +0100
changeset 71105 1159e52e5b05
parent 71103 c073c4e79518
child 71131 1579a9160c7f
permissions -rw-r--r--
tuned;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
71099
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
     1
(*:maxLineLen=78:*)
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
     2
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
     3
theory Phabricator
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
     4
imports Base
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
     5
begin
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
     6
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
     7
chapter \<open>Phabricator server administration\<close>
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
     8
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
     9
text \<open>
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    10
  Phabricator\<^footnote>\<open>\<^url>\<open>https://www.phacility.com/phabricator\<close>\<close> is an open-source
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    11
  product to support the development process of complex software projects
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    12
  (open or closed ones). The official slogan is:
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    13
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    14
  \begin{quote}
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    15
    Discuss. Plan. Code. Review. Test. \\
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    16
    Every application your project needs, all in one tool.
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    17
  \end{quote}
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    18
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    19
  Ongoing changes and discussions about changes are maintained uniformly
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    20
  within a MySQL database. There are standard connections to major version
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    21
  control systems: \<^bold>\<open>Subversion\<close>, \<^bold>\<open>Mercurial\<close>, \<^bold>\<open>Git\<close>. So Phabricator offers
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    22
  a counter-model to trends of monoculture and centralized version control,
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    23
  especially due to Microsoft's Github and Atlassian's Bitbucket.
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    24
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    25
  The small company behind Phabricator provides paid plans for support and
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    26
  hosting of servers, but it is relatively easy to do \<^emph>\<open>independent
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    27
  self-hosting\<close> on a standard LAMP server (Linux, Apache, MySQL, PHP). This
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    28
  merely requires a virtual Ubuntu server on the net, which can be rented
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    29
  rather cheaply from local hosting providers (there is no need to follow big
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    30
  cloud corporations). So it is feasible to remain the master of your virtual
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    31
  home, following the slogan ``own all your data''. In many respects,
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    32
  Phabricator is similar to the well-known
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    33
  Nextcloud\<^footnote>\<open>\<^url>\<open>https://nextcloud.com\<close>\<close> product, concerning both the
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    34
  technology and sociology.
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    35
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    36
  \<^medskip>
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    37
  The following Phabricator instances may serve as examples:
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    38
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    39
    \<^item> Phabricator development \<^url>\<open>https://secure.phabricator.com\<close>
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    40
    \<^item> Wikimedia development \<^url>\<open>https://phabricator.wikimedia.org\<close>
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    41
    \<^item> Mercurial development \<^url>\<open>https://phab.mercurial-scm.org\<close>
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    42
    \<^item> Isabelle development \<^url>\<open>https://isabelle-dev.sketis.net\<close>
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    43
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    44
  \<^medskip> Initial Phabricator server configuration requires many details to be done
71105
wenzelm
parents: 71103
diff changeset
    45
  right.\<^footnote>\<open>See also
wenzelm
parents: 71103
diff changeset
    46
  \<^url>\<open>https://secure.phabricator.com/book/phabricator/article/installation_guide\<close>
wenzelm
parents: 71103
diff changeset
    47
  in the context of \<^url>\<open>https://help.ubuntu.com/lts/serverguide\<close>.\<close> Isabelle
wenzelm
parents: 71103
diff changeset
    48
  provides some command-line tools to help with the setup, and afterwards
wenzelm
parents: 71103
diff changeset
    49
  Isabelle support is optional: it is possible to run and maintain the server,
wenzelm
parents: 71103
diff changeset
    50
  without requiring a full Isabelle distribution again.
71099
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    51
\<close>
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    52
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    53
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    54
section \<open>Quick start\<close>
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    55
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    56
text \<open>
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    57
  The starting point is a fresh installation of \<^bold>\<open>Ubuntu 18.04 LTS\<close>: that
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    58
  particular version is required due to subtle dependencies on system
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    59
  configuration and add-on packages.
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    60
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    61
  For production use, a proper \<^emph>\<open>Virtual Server\<close> or \<^emph>\<open>Root Server\<close> product
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    62
  from a hosting provider will be required, including an Internet Domain Name
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    63
  (a pseudo sub-domain in the style of Apache is sufficient).
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    64
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    65
  Initial experimentation also works on a local host, e.g.\ via
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    66
  VirtualBox\<^footnote>\<open>\<^url>\<open>https://www.virtualbox.org\<close>\<close>. The public server behind
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    67
  \<^verbatim>\<open>lvh.me\<close> provides arbitrary subdomains as an alias to \<^verbatim>\<open>localhost\<close>, which
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    68
  will be used for the default installation below.
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    69
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    70
  All administrative commands need to be run as \<^verbatim>\<open>root\<close> user (e.g.\ via
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    71
  \<^verbatim>\<open>sudo\<close>).
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    72
\<close>
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    73
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    74
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    75
subsection \<open>Initial setup\<close>
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    76
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    77
text \<open>
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    78
  Isabelle can managed multiple named installations Phabricator installations:
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    79
  this allows to separate administrative responsibilities, e.g.\ different
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    80
  approaches to user management for different projects. Subsequently we always
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    81
  use the implicit default name ``\<^verbatim>\<open>vcs\<close>'': it will appear in file and
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    82
  directory locations, internal database names and URLs.
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    83
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    84
  The initial setup (with full Linux package upgrade) works as follows:
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    85
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    86
  @{verbatim [display] \<open>  isabelle phabricator_setup -U\<close>}
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    87
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    88
  After installing many packages and cloning the Phabricator distribution, the
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    89
  final output of the tool should be the URL for further manual configuration
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    90
  (using a local web browser). Here the key points are:
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    91
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    92
    \<^item> An initial user account that will get administrator rights. There is no
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    93
    need to create a separate \<^verbatim>\<open>admin\<close> account. Instead, a regular user that
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    94
    will take over this responsibility can be used here. Subsequently we
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    95
    assume that user \<^verbatim>\<open>makarius\<close> becomes the initial administrator.
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    96
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    97
    \<^item> An \<^emph>\<open>Auth Provider\<close> to manage user names and passwords. None is provided
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    98
    by default, and Phabricator points out this omission prominently in its
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    99
    overview of \<^emph>\<open>Setup Issues\<close>: following these hints quickly leads to the
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   100
    place where a regular \<^emph>\<open>Username/Password\<close> provider can be added.
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   101
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   102
  Note that Phabricator allows to delegate the responsibility of
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   103
  authentication to big corporations like Google and Facebook, but these can
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   104
  be easily avoided. Genuine self-hosting means to manage users directly,
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   105
  without outsourcing of authentication.
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   106
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   107
  \<^medskip>
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   108
  With the Auth Provider available, the administrator can now set a proper
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   109
  password. This works e.g.\ by initiating a local password reset procedure:
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   110
71103
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   111
  @{verbatim [display] \<open>  isabelle phabricator bin/auth recover makarius\<close>}
71099
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   112
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   113
  The printed URL gives access to a password dialog in the web browser.
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   114
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   115
  Further users will be able to provide a password more directly, because the
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   116
  Auth Provider is now active.
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   117
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   118
  \<^medskip>
71105
wenzelm
parents: 71103
diff changeset
   119
  The pending request in Phabricator \<^bold>\<open>Setup Issues\<close> to lock the configuration
71099
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   120
  can be fulfilled as follows:
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   121
71103
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   122
  @{verbatim [display] \<open>  isabelle phabricator bin/auth lock\<close>}
71105
wenzelm
parents: 71103
diff changeset
   123
wenzelm
parents: 71103
diff changeset
   124
  \<^medskip>
wenzelm
parents: 71103
diff changeset
   125
  Most other Setup Issues can be ignored, after reading through them briefly
wenzelm
parents: 71103
diff changeset
   126
  to make sure that there are no genuine problems remaining.
71099
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   127
\<close>
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   128
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   129
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   130
subsection \<open>Mailer configuration\<close>
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   131
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   132
text \<open>
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   133
  The next important thing is messaging: Phabricator needs to be able to
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   134
  communicate with users. There are many variations on \<^emph>\<open>Mailer
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   135
  Configuration\<close>, but a conventional SMTP server connection with a dedicated
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   136
  \<^verbatim>\<open>phabricator\<close> user is sufficient. Note that there is no need to run a mail
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   137
  server on the self-hosted Linux machine: regular web-hosting packages
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   138
  usually allow to create new mail accounts easily. (As a last resort it is
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   139
  possible to use a service like Gmail, but that would again introduce
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   140
  unnecessary dependency on Google.)
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   141
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   142
  \<^medskip>
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   143
  Mailer configuration requires a few command-line invocations as follows:
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   144
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   145
  @{verbatim [display] \<open>  isabelle phabricator_setup_mail\<close>}
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   146
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   147
  \<^noindent> Now edit the generated JSON file to provide the mail account details. Then
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   148
  add and test it with Phabricator like this (to let Phabricator send a
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   149
  message to the administrator from above):
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   150
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   151
  @{verbatim [display] \<open>  isabelle phabricator_setup_mail -T makarius\<close>}
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   152
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   153
  The mail configuration process can be refined and repeated until it really
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   154
  works: host name, port number, protocol etc.\ all need to be correct. The
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   155
  \<^verbatim>\<open>key\<close> field in the JSON file identifies the name of the configuration; it
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   156
  will be overwritten each time, when taking over the parameters via
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   157
  \<^verbatim>\<open>isabelle phabricator_setup_mail\<close>.
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   158
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   159
  \<^medskip>
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   160
  For information, the resulting mailer configuration can be queried like
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   161
  this:
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   162
71103
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   163
  @{verbatim [display] \<open>  isabelle phabricator bin/config get cluster.mailers\<close>}
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   164
\<close>
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   165
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   166
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   167
section \<open>Reference of command-line tools\<close>
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   168
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   169
text \<open>
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   170
  The subsequent command-line tools usually require root user privileges on
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   171
  the underlying Linux system (e.g.\ via \<^verbatim>\<open>sudo bash\<close> to open a subshell, or
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   172
  directly via \<^verbatim>\<open>sudo isabelle ...\<close>). Note that Isabelle refers to
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   173
  user-specific configuration in the user home directory via @{setting
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   174
  ISABELLE_HOME_USER} (\secref{sec:settings}); that may be different or absent
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   175
  for the root user and thus cause confusion.
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   176
\<close>
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   177
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   178
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   179
subsection \<open>\<^verbatim>\<open>isabelle phabricator\<close>\<close>
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   180
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   181
text \<open>
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   182
  The @{tool_def phabricator} tool invokes a GNU bash command-line within the
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   183
  Phabricator home directory:
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   184
  @{verbatim [display]
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   185
\<open>Usage: isabelle phabricator [OPTIONS] COMMAND [ARGS...]
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   186
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   187
  Options are:
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   188
    -l           list available Phabricator installations
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   189
    -n NAME      Phabricator installation name (default: "vcs")
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   190
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   191
  Invoke a command-line tool within the home directory of the named
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   192
  Phabricator installation.\<close>}
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   193
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   194
  Isabelle/Phabricator installations are registered in the global
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   195
  configuration file \<^path>\<open>/etc/isabelle-phabricator.conf\<close>, with name and
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   196
  root directory separated by colon (no extra whitespace). The home directory
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   197
  is the subdirectory \<^verbatim>\<open>phabricator\<close> within the root.
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   198
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   199
  \<^medskip> Option \<^verbatim>\<open>-l\<close> lists the available Phabricator installations with name and
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   200
  root directory.
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   201
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   202
  Option \<^verbatim>\<open>-n\<close> selects the explicitly named Phabricator installation.
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   203
\<close>
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   204
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   205
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   206
subsubsection \<open>Examples\<close>
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   207
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   208
text \<open>
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   209
  Print the home directory of the Phabricator installation:
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   210
  @{verbatim [display] \<open>isabelle phabricator pwd\<close>}
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   211
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   212
  Print some Phabricator configuration information:
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   213
  @{verbatim [display] \<open>isabelle phabricator bin/config get phabricator.base-uri\<close>}
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   214
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   215
  The latter conforms to typical command templates seen in the original
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   216
  Phabricator documentation:
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   217
  @{verbatim [display] \<open>phabricator/ $ ./bin/config get phabricator.base-uri\<close>}
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   218
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   219
  Here the user is meant to navigate to the Phabricator home manually, in
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   220
  contrast to \<^verbatim>\<open>isabelle phabricator\<close> doing it automatically based on
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   221
  \<^path>\<open>/etc/isabelle-phabricator.conf\<close>.
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   222
\<close>
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   223
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   224
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   225
subsection \<open>\<^verbatim>\<open>isabelle phabricator_setup\<close>\<close>
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   226
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   227
text \<open>
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   228
  The @{tool_def phabricator_setup} installs a fresh Phabricator instance on
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   229
  Ubuntu Linux (notably 18.04 LTS):
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   230
  @{verbatim [display] \<open>Usage: isabelle phabricator_setup [OPTIONS]
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   231
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   232
  Options are:
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   233
    -R DIR       repository directory (default: "/var/www/phabricator-NAME/repo")
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   234
    -U           full update of system packages before installation
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   235
    -n NAME      Phabricator installation name (default: "vcs")
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   236
    -r DIR       installation root directory (default: "/var/www/phabricator-NAME")
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   237
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   238
  Install Phabricator as LAMP application (Linux, Apache, MySQL, PHP).
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   239
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   240
  The installation name (default: "vcs") is mapped to a regular
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   241
  Unix user; this is relevant for public SSH access.\<close>}
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   242
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   243
  Installation requires Linux root user access. All required packages are
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   244
  installed automatically beforehand, this includes the Apache web server and
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   245
  the MySQL database engine.
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   246
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   247
  Global configuration in \<^verbatim>\<open>/etc\<close> and other directories like \<^verbatim>\<open>/var/www\<close>
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   248
  always use name prefixes \<^verbatim>\<open>isabelle-phabricator\<close> or \<^verbatim>\<open>phabricator\<close>. Local
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   249
  configuration for a particular installation uses more specific names derived
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   250
  from \<^verbatim>\<open>phabricator-\<close>\<open>NAME\<close>, e.g. \<^verbatim>\<open>/var/www/phabricator-vcs\<close> for a default
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   251
  installation.
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   252
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   253
  Knowing the conventions, it is possible to purge a Linux installation from
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   254
  Isabelle/Phabricator with some effort. There is no automated
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   255
  de-installation: it is often better to re-install a clean virtual machine
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   256
  image.
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   257
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   258
  \<^medskip>
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   259
  Option \<^verbatim>\<open>-U\<close> ensures a full update of system packages, before installing
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   260
  further packages required by Phabricator.
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   261
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   262
  Option \<^verbatim>\<open>-n\<close> provides an alternative installation name. The default name
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   263
  \<^verbatim>\<open>vcs\<close> means ``Version Control System''. The name will appear in the URL for
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   264
  SSH access, and thus has some relevance to end-users. The initial server URL
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   265
  also uses that name suffix, but it can be changed later via regular Apache
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   266
  configuration.
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   267
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   268
  Option \<^verbatim>\<open>-r\<close> specifies an alternative installation root directory: it needs
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   269
  to be accessible for the Apache web server.
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   270
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   271
  Option \<^verbatim>\<open>-R\<close> specifies an alternative directory for repositories that are
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   272
  hosted by Phabricator. Provided that it is accessible for the Apache web
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   273
  server, the directory can be re-used directly for the builtin \<^verbatim>\<open>hgweb\<close> view
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   274
  by Mercurial. See also the documentation
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   275
  \<^url>\<open>https://www.mercurial-scm.org/wiki/PublishingRepositories#hgweb\<close> and the
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   276
  example \<^url>\<open>https://isabelle.sketis.net/repos\<close> for repositories in
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   277
  \<^url>\<open>https://isabelle-dev.sketis.net/diffusion\<close>.
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   278
\<close>
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   279
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   280
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   281
subsection \<open>\<^verbatim>\<open>isabelle phabricator_setup_mail\<close>\<close>
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   282
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   283
text \<open>
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   284
  The @{tool_def phabricator_setup_mail} provides mail configuration for an
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   285
  existing Phabricator installation (preferably via SMTP):
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   286
  @{verbatim [display] \<open>Usage: isabelle phabricator_setup_mail [OPTIONS]
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   287
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   288
  Options are:
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   289
    -T USER      send test mail to Phabricator user
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   290
    -f FILE      config file (default: "mailers.json" within
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   291
                 Phabricator root)
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   292
    -n NAME      Phabricator installation name (default: "vcs")
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   293
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   294
  Provide mail configuration for existing Phabricator installation.\<close>}
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   295
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   296
  Proper mail configuration is vital for Phabricator, but the details can be
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   297
  tricky. A common approach is to re-use an existing SMTP mail service, as is
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   298
  often included in regular web hosting packages. A single account for
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   299
  multiple Phabricator installations is sufficient, but the configuration
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   300
  needs to be set for each installation separately.
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   301
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   302
  The first invocation of \<^verbatim>\<open>isabelle phabricator_setup_mail\<close> without options
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   303
  creates a JSON template file. Its \<^verbatim>\<open>key\<close> entry should be changed to
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   304
  something sensible to identify the configuration, e.g.\ the Internet Domain
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   305
  Name of the mail address being used here. The \<^verbatim>\<open>options\<close> specify the SMTP
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   306
  server address and account information.
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   307
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   308
  Another invocation of \<^verbatim>\<open>isabelle phabricator_setup_mail\<close> with updated JSON
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   309
  file will change the underlying Phabricator installation. This can be done
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   310
  repeatedly, until everything works as expected.
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   311
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   312
  Option \<^verbatim>\<open>-T\<close> invokes a standard Phabricator test procedure for the mail
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   313
  configuration. The argument needs to be a valid Phabricator user: the mail
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   314
  address is derived from the user profile.
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   315
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   316
  Option \<^verbatim>\<open>-f\<close> refers to an existing JSON configuration file, e.g.\ from a
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   317
  different Phabricator installation: sharing mailers setup with the same mail
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   318
  address works for outgoing mails; incoming mails are not strictly needed.
71099
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   319
\<close>
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   320
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   321
end