+ $ pear channel-discover pear.geshi.org
+ $ pear install geshi/geshi
+
+ $ pear channel-discover zustellzentrum.cweiske.de
+ $ pear install zz/mime_type_plaindetect-alpha
+
+ $ pear channel-discover pear.michelf.ca
+ $ pear install michelf/Markdown
+
+ $ pear channel-discover pear2.php.net
+ $ pear install pear2/pear2_services_linkback-alpha
+
+
+You can use composer to install all dependencies automatically::
+
+ $ composer install
+
+Note that the ``.phar`` package already contains all dependencies.
+
+
+======
+Search
+======
+
+phorkie makes use of an Elasticsearch__ installation, if you have one.
+
+It is used to provide search capabilities and the list of recent pastes.
+
+Elasticsearch version 2.0 is supported.
+
+You have to install the `delete-by-query`__ plugin::
+
+ $ cd /usr/share/elasticsearch
+ $ bin/plugin install delete-by-query
+
+__ http://www.elasticsearch.org/
+__ https://www.elastic.co/guide/en/elasticsearch/plugins/2.0/plugins-delete-by-query.html
+
+
+Setup
+=====
+Edit ``config.php``, setting the ``elasticsearch`` property to the HTTP URL
+of the index, e.g. ::
+
+ http://localhost:9200/phorkie/
+
+You must use a search namespace with Elasticsearch such as ``phorkie/``.
+Run the index script to import all existing pastes into the index::
+
+ php scripts/index.php
+
+That's all. Open phorkie in your browser, and you'll notice the search box
+in the top menu.
+
+
+Reset
+=====
+In case something really went wrong and you need to reset the search
+index, run the following command::
+
+ $ curl -XDELETE http://localhost:9200/phorkie/
+ {"ok":true,"acknowledged"}
+
+Phorkie will automatically re-index everything when ``setupcheck`` is enabled
+in the configuration file.
+
+You may also manually run the reindexing script with::
+
+ $ php scripts/index.php
+
+
+=====
+HowTo
+=====
+
+Make git repositories clonable
+==============================
+
+HTTP
+----
+By default, the pastes are clonable via ``http`` as long as the ``repos/git/``
+directory is within the ``www/`` directory.
+
+No further setup needed.
+
+
+git-daemon
+----------
+You may use ``git-daemon`` to provide public ``git://`` clone urls.
+Install the ``git-daemon-run`` package on Debian/Ubuntu.
+
+Make the repositories available by symlinking the paste repository
+directory (``$GLOBALS['phorkie']['cfg']['repos']`` setting) into
+``/var/cache/git``, e.g.::
+
+ $ ln -s /home/user/www/paste/repos/git /var/cache/git/paste
+
+Edit your ``config.php`` and set the ``$GLOBALS['phorkie']['cfg']['git']['public']``
+setting to ``git://$yourhostname/git/paste/``.
+The rest will be appended automatically.
+
+
+You're on your own to setup writable repositories.
+
+
+Protect your site with OpenID
+=============================
+You have the option of enabling OpenID authentication to help secure your
+pastes on phorkie.
+Set the ``$GLOBALS['phorkie']['auth']`` values in the
+``data/config.php`` file as desired.
+
+There are two different types of security you can apply.
+First, you can restrict to one of three ``securityLevels``:
+
+- completely open (``0``)
+- protection of write-enabled functions such as add, edit, etc. (``1``)
+- full site protection (``2``)
+
+Additionally, you can restrict your site to ``listedUsersOnly``.
+You will need to add the individual OpenID urls to the
+``$GLOBALS['phorkie']['auth']['users']`` variable.
+
+
+Get information about paste editors
+===================================
+Phorkie stores the user's OpenID or IP address (when not logged in) when
+a paste is edited.
+It is possible to get this information for each single commit::
+
+ // IP / OpenID for the latest commit
+ $ git notes --ref=identity show
+ 127.0.0.1
+
+ // show IP / OpenID for a given commit
+ $ git notes --ref=identity show 29f82a
+ http://cweiske.de/
+
+
+Notifications via webhooks
+==========================
+Depending on how you use phorkie, it might be nice to notify some other service
+when pastes are added or updated.
+Phorkie contains a simply mechanism to post data to a given URL which
+you can then use as needed.
+
+The data are json-encoded POSTed to the URLs contained in the
+``$GLOBALS['phorkie']['cfg']['webhooks']`` setting array, with
+a MIME type of ``application/vnd.phorkie.webhook+json``::
+
+ {
+ 'event': 'create',
+ 'author': {
+ 'name':'Anonymous',
+ 'email': 'anonymous@phorkie',
+ },
+ 'repository': {
+ 'name': 'webhooktest',
+ 'url': 'http://example.org/33',
+ 'description': 'webhooktest',
+ 'owner': {
+ 'name': 'Anonymous',
+ 'email': 'anonymous@phorkie',
+ }
+ }
+ }
+
+The event may be ``create``, ``edit`` or ``delete``.
+