src/Doc/System/Phabricator.thy
author wenzelm
Thu, 14 Nov 2019 21:49:49 +0100
changeset 71131 1579a9160c7f
parent 71105 1159e52e5b05
child 71132 e5984c853f77
permissions -rw-r--r--
misc tuning and clarification;
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
71131
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
    26
  hosting of servers, but it is easy to do \<^emph>\<open>independent self-hosting\<close> on a
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
    27
  standard LAMP server (Linux, Apache, MySQL, PHP). This merely requires a
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
    28
  virtual machine on the Net, which can be rented cheaply from local hosting
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
    29
  providers --- there is no need to follow big cloud corporations. So it is
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
    30
  feasible to remain the master of your virtual home, following the slogan
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
    31
  ``own all your data''. In many respects, Phabricator is similar to the
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
    32
  well-known Nextcloud\<^footnote>\<open>\<^url>\<open>https://nextcloud.org\<close>\<close> product, concerning both
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
    33
  the technology and sociology.
71099
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    34
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    35
  \<^medskip>
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    36
  The following Phabricator instances may serve as examples:
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    37
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    38
    \<^item> Phabricator development \<^url>\<open>https://secure.phabricator.com\<close>
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    39
    \<^item> Wikimedia development \<^url>\<open>https://phabricator.wikimedia.org\<close>
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    40
    \<^item> Mercurial development \<^url>\<open>https://phab.mercurial-scm.org\<close>
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    41
    \<^item> Isabelle development \<^url>\<open>https://isabelle-dev.sketis.net\<close>
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    42
71131
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
    43
  \<^medskip> Initial Phabricator configuration requires many details to be done
71105
wenzelm
parents: 71103
diff changeset
    44
  right.\<^footnote>\<open>See also
wenzelm
parents: 71103
diff changeset
    45
  \<^url>\<open>https://secure.phabricator.com/book/phabricator/article/installation_guide\<close>
wenzelm
parents: 71103
diff changeset
    46
  in the context of \<^url>\<open>https://help.ubuntu.com/lts/serverguide\<close>.\<close> Isabelle
wenzelm
parents: 71103
diff changeset
    47
  provides some command-line tools to help with the setup, and afterwards
wenzelm
parents: 71103
diff changeset
    48
  Isabelle support is optional: it is possible to run and maintain the server,
71131
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
    49
  without requiring the somewhat bulky Isabelle distribution again.
71099
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    50
\<close>
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    51
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    52
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    53
section \<open>Quick start\<close>
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    54
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    55
text \<open>
71131
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
    56
  The starting point is a fresh installation of \<^bold>\<open>Ubuntu 18.04
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
    57
  LTS\<close>\<^footnote>\<open>\<^url>\<open>https://ubuntu.com/download\<close>\<close>: this version is mandatory due to
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
    58
  subtle dependencies on system packages and configuration that is assumed by
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
    59
  the Isabelle setup tool.
71099
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
71131
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
    66
  VirtualBox\<^footnote>\<open>\<^url>\<open>https://www.virtualbox.org\<close>\<close>. The public domain \<^verbatim>\<open>lvh.me\<close> is
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
    67
  used below: it maps arbitrary subdomains to \<^verbatim>\<open>localhost\<close>.
71099
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    68
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    69
  All administrative commands need to be run as \<^verbatim>\<open>root\<close> user (e.g.\ via
71131
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
    70
  \<^verbatim>\<open>sudo\<close>). Note that Isabelle refers to user-specific configuration in the
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
    71
  user home directory via @{setting ISABELLE_HOME_USER}
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
    72
  (\secref{sec:settings}); that may be different or absent for the root user
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
    73
  and thus cause confusion.
71099
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    74
\<close>
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    75
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    76
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    77
subsection \<open>Initial setup\<close>
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    78
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    79
text \<open>
71131
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
    80
  Isabelle can manage multiple named Phabricator installations: this allows to
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
    81
  separate administrative responsibilities, e.g.\ different approaches to user
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
    82
  management for different projects. Subsequently we always use the default
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
    83
  name ``\<^verbatim>\<open>vcs\<close>'': it will appear in file and directory locations, internal
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
    84
  database names and URLs.
71099
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    85
71131
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
    86
  The initial setup works as follows (with full Linux package upgrade):
71099
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    87
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    88
  @{verbatim [display] \<open>  isabelle phabricator_setup -U\<close>}
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    89
71131
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
    90
  After installing many packages, cloning the Phabricator distribution,
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
    91
  initializing the MySQL database and Apache, the tool prints an URL for
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
    92
  further configuration. The following needs to be provided by the web
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
    93
  interface:
71099
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    94
71131
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
    95
    \<^item> An initial user that will get administrator rights. There is no need to
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
    96
    create a special \<^verbatim>\<open>admin\<close> account. Instead, a regular user that will take
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
    97
    over this responsibility can be used here. Subsequently we assume that
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
    98
    user \<^verbatim>\<open>makarius\<close> becomes the initial administrator.
71099
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
    99
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   100
    \<^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
   101
    by default, and Phabricator points out this omission prominently in its
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   102
    overview of \<^emph>\<open>Setup Issues\<close>: following these hints quickly leads to the
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   103
    place where a regular \<^emph>\<open>Username/Password\<close> provider can be added.
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   104
71131
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   105
    Alternatively, Phabricator can delegate the responsibility of
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   106
    authentication to big corporations like Google and Facebook, but these can
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   107
    be ignored. Genuine self-hosting means to manage users directly, without
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   108
    outsourcing of authentication.
71099
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   109
71131
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   110
    \<^item> A proper password for the administrator can now be set, e.g.\ by the
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   111
    following command:
71099
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   112
71131
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   113
    @{verbatim [display] \<open>  isabelle phabricator bin/auth recover makarius\<close>}
71099
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   114
71131
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   115
    The printed URL gives access to a login and password dialog in the web
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   116
    interface.
71099
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   117
71131
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   118
    Any further users will be able to provide a password directly, because the
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   119
    Auth Provider is already active.
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   120
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   121
    \<^item> The list of Phabricator \<^bold>\<open>Setup Issues\<close> should be studied with some
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   122
    care, to make sure that no serious problems are remaining. The request to
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   123
    lock the configuration can be fulfilled as follows:
71099
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   124
71131
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   125
    @{verbatim [display] \<open>  isabelle phabricator bin/auth lock\<close>}
71099
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   126
71131
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   127
    \<^medskip> A few other Setup Issues might be relevant as well, e.g.\ the timezone
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   128
    of the server. Some more exotic points can be ignored: Phabricator
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   129
    provides careful explanations about what it thinks could be wrong, always
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   130
    leaving some room for interpretation.
71099
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   131
\<close>
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   132
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   133
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   134
subsection \<open>Mailer configuration\<close>
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   135
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   136
text \<open>
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   137
  The next important thing is messaging: Phabricator needs to be able to
71131
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   138
  communicate with users on its own account, e.g.\ to reset passwords. The
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   139
  documentation has many variations on \<^emph>\<open>Configuring Outbound
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   140
  Email\<close>\<^footnote>\<open>\<^url>\<open>https://secure.phabricator.com/book/phabricator/article/configuring_outbound_email\<close>\<close>,
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   141
  but a conventional SMTP server with a dedicated \<^verbatim>\<open>phabricator\<close> user is
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   142
  sufficient. There is no need to run a separate mail server on the
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   143
  self-hosted Linux machine: hosting providers often include such a service
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   144
  for free, e.g.\ as part of a web-hosting package. As a last resort it is
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   145
  also possible to use a corporate service like Gmail, but such dependency
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   146
  dilutes the whole effort of self-hosting.
71099
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   147
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   148
  \<^medskip>
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   149
  Mailer configuration requires a few command-line invocations as follows:
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\<close>}
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   152
71131
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   153
  \<^noindent> This generates a JSON template file for the the mail account details.
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   154
  After editing that, the subsequent command will add and test it with
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   155
  Phabricator:
71099
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   156
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   157
  @{verbatim [display] \<open>  isabelle phabricator_setup_mail -T makarius\<close>}
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   158
71131
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   159
  This tells Phabricator to send a message to the administrator created
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   160
  before; the output informs about success or errors.
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   161
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   162
  The mail configuration process can be refined and repeated until it works
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   163
  properly: host name, port number, protocol etc.\ all need to be correct. The
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   164
  \<^verbatim>\<open>key\<close> field in the JSON file identifies the name of the configuration that
71099
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   165
  will be overwritten each time, when taking over the parameters via
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   166
  \<^verbatim>\<open>isabelle phabricator_setup_mail\<close>.
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   167
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   168
  \<^medskip>
71131
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   169
  This is how to query the current mail configuration:
71099
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   170
71103
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   171
  @{verbatim [display] \<open>  isabelle phabricator bin/config get cluster.mailers\<close>}
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   172
\<close>
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   173
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   174
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   175
section \<open>Reference of command-line tools\<close>
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   176
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   177
text \<open>
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   178
  The subsequent command-line tools usually require root user privileges on
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   179
  the underlying Linux system (e.g.\ via \<^verbatim>\<open>sudo bash\<close> to open a subshell, or
71131
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   180
  directly via \<^verbatim>\<open>sudo isabelle phabricator ...\<close>).
71103
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   181
\<close>
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   182
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   183
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   184
subsection \<open>\<^verbatim>\<open>isabelle phabricator\<close>\<close>
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   185
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   186
text \<open>
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   187
  The @{tool_def phabricator} tool invokes a GNU bash command-line within the
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   188
  Phabricator home directory:
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   189
  @{verbatim [display]
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   190
\<open>Usage: isabelle phabricator [OPTIONS] COMMAND [ARGS...]
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   191
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   192
  Options are:
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   193
    -l           list available Phabricator installations
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   194
    -n NAME      Phabricator installation name (default: "vcs")
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   195
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   196
  Invoke a command-line tool within the home directory of the named
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   197
  Phabricator installation.\<close>}
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   198
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   199
  Isabelle/Phabricator installations are registered in the global
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   200
  configuration file \<^path>\<open>/etc/isabelle-phabricator.conf\<close>, with name and
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   201
  root directory separated by colon (no extra whitespace). The home directory
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   202
  is the subdirectory \<^verbatim>\<open>phabricator\<close> within the root.
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   203
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   204
  \<^medskip> Option \<^verbatim>\<open>-l\<close> lists the available Phabricator installations with name and
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   205
  root directory.
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   206
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   207
  Option \<^verbatim>\<open>-n\<close> selects the explicitly named Phabricator installation.
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   208
\<close>
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   209
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   210
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   211
subsubsection \<open>Examples\<close>
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   212
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   213
text \<open>
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   214
  Print the home directory of the Phabricator installation:
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   215
  @{verbatim [display] \<open>isabelle phabricator pwd\<close>}
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   216
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   217
  Print some Phabricator configuration information:
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   218
  @{verbatim [display] \<open>isabelle phabricator bin/config get phabricator.base-uri\<close>}
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   219
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   220
  The latter conforms to typical command templates seen in the original
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   221
  Phabricator documentation:
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   222
  @{verbatim [display] \<open>phabricator/ $ ./bin/config get phabricator.base-uri\<close>}
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   223
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   224
  Here the user is meant to navigate to the Phabricator home manually, in
71131
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   225
  contrast to \<^verbatim>\<open>isabelle phabricator\<close> doing it automatically thanks to the
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   226
  global configuration \<^path>\<open>/etc/isabelle-phabricator.conf\<close>.
71103
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   227
\<close>
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   228
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   229
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   230
subsection \<open>\<^verbatim>\<open>isabelle phabricator_setup\<close>\<close>
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   231
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   232
text \<open>
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   233
  The @{tool_def phabricator_setup} installs a fresh Phabricator instance on
71131
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   234
  Ubuntu 18.04 LTS:
71103
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   235
  @{verbatim [display] \<open>Usage: isabelle phabricator_setup [OPTIONS]
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   236
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   237
  Options are:
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   238
    -R DIR       repository directory (default: "/var/www/phabricator-NAME/repo")
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   239
    -U           full update of system packages before installation
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   240
    -n NAME      Phabricator installation name (default: "vcs")
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   241
    -r DIR       installation root directory (default: "/var/www/phabricator-NAME")
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   242
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   243
  Install Phabricator as LAMP application (Linux, Apache, MySQL, PHP).
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   244
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   245
  The installation name (default: "vcs") is mapped to a regular
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   246
  Unix user; this is relevant for public SSH access.\<close>}
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   247
71131
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   248
  Installation requires Linux root permissions. All required packages are
71103
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   249
  installed automatically beforehand, this includes the Apache web server and
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   250
  the MySQL database engine.
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   251
71131
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   252
  Global configuration in \<^verbatim>\<open>/etc\<close> or a few other directories like \<^verbatim>\<open>/var/www\<close>
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   253
  uses name prefixes like \<^verbatim>\<open>isabelle-phabricator\<close> or \<^verbatim>\<open>phabricator\<close>. Local
71103
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   254
  configuration for a particular installation uses more specific names derived
71131
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   255
  from \<^verbatim>\<open>phabricator-\<close>\<open>NAME\<close>, e.g.\ \<^verbatim>\<open>/var/www/phabricator-vcs\<close> for the
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   256
  default.
71103
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   257
71131
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   258
  Knowing the naming conventions, it is possible to purge a Linux installation
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   259
  from Isabelle/Phabricator with some effort, but there is no automated
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   260
  procedure for de-installation. In the worst case, it might be better to
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   261
  re-install the virtual machine from a clean image.
71103
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   262
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   263
  \<^medskip>
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   264
  Option \<^verbatim>\<open>-U\<close> ensures a full update of system packages, before installing
71131
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   265
  further packages required by Phabricator. This might require to reboot.
71103
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   266
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   267
  Option \<^verbatim>\<open>-n\<close> provides an alternative installation name. The default name
71131
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   268
  \<^verbatim>\<open>vcs\<close> means ``version control system''. The name appears in the URL for SSH
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   269
  access, and thus has some relevance to end-users. The initial server URL
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   270
  also uses the same suffix, but that can (and should) be changed later via
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   271
  regular Apache configuration.
71103
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   272
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   273
  Option \<^verbatim>\<open>-r\<close> specifies an alternative installation root directory: it needs
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   274
  to be accessible for the Apache web server.
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   275
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   276
  Option \<^verbatim>\<open>-R\<close> specifies an alternative directory for repositories that are
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   277
  hosted by Phabricator. Provided that it is accessible for the Apache web
71131
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   278
  server, the directory can be reused for the \<^verbatim>\<open>hgweb\<close> view by Mercurial.\<^footnote>\<open>See
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   279
  also the documentation
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   280
  \<^url>\<open>https://www.mercurial-scm.org/wiki/PublishingRepositories\<close> and the
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   281
  example \<^url>\<open>https://isabelle.sketis.net/repos\<close>.\<close>
71103
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   282
\<close>
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   283
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   284
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   285
subsection \<open>\<^verbatim>\<open>isabelle phabricator_setup_mail\<close>\<close>
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   286
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   287
text \<open>
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   288
  The @{tool_def phabricator_setup_mail} provides mail configuration for an
71131
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   289
  existing Phabricator installation:
71103
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   290
  @{verbatim [display] \<open>Usage: isabelle phabricator_setup_mail [OPTIONS]
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   291
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   292
  Options are:
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   293
    -T USER      send test mail to Phabricator user
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   294
    -f FILE      config file (default: "mailers.json" within
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   295
                 Phabricator root)
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   296
    -n NAME      Phabricator installation name (default: "vcs")
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   297
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   298
  Provide mail configuration for existing Phabricator installation.\<close>}
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   299
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   300
  Proper mail configuration is vital for Phabricator, but the details can be
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   301
  tricky. A common approach is to re-use an existing SMTP mail service, as is
71131
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   302
  often included in regular web hosting packages. It is sufficient to create
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   303
  one mail account for multiple Phabricator installations, but the
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   304
  configuration needs to be set for each installation.
71103
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   305
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   306
  The first invocation of \<^verbatim>\<open>isabelle phabricator_setup_mail\<close> without options
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   307
  creates a JSON template file. Its \<^verbatim>\<open>key\<close> entry should be changed to
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   308
  something sensible to identify the configuration, e.g.\ the Internet Domain
71131
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   309
  Name of the mail address. The \<^verbatim>\<open>options\<close> specify the SMTP server address and
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   310
  account information.
71103
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   311
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   312
  Another invocation of \<^verbatim>\<open>isabelle phabricator_setup_mail\<close> with updated JSON
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   313
  file will change the underlying Phabricator installation. This can be done
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   314
  repeatedly, until everything works as expected.
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   315
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   316
  Option \<^verbatim>\<open>-T\<close> invokes a standard Phabricator test procedure for the mail
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   317
  configuration. The argument needs to be a valid Phabricator user: the mail
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   318
  address is derived from the user profile.
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   319
c073c4e79518 more documentation;
wenzelm
parents: 71099
diff changeset
   320
  Option \<^verbatim>\<open>-f\<close> refers to an existing JSON configuration file, e.g.\ from a
71131
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   321
  previous successful Phabricator installation: sharing mailers setup with the
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   322
  same mail address is fine for outgoing mails; incoming mails are optional
1579a9160c7f misc tuning and clarification;
wenzelm
parents: 71105
diff changeset
   323
  and not configured here.
71099
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   324
\<close>
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   325
20c1b9516d27 documentation on Phabricator server administration;
wenzelm
parents:
diff changeset
   326
end