From b20269966a569d5ec0ce69246e2bdb7bbf70d967 Mon Sep 17 00:00:00 2001
From: Eliot Berriot <contact@eliotberriot.com>
Date: Tue, 22 Jan 2019 09:45:43 +0100
Subject: [PATCH] Lots of small fixes in the documentation

---
 docs/installation/debian.rst                | 21 ++++++++++++---------
 docs/installation/external_dependencies.rst |  2 +-
 docs/installation/index.rst                 | 13 +++++++++++++
 docs/installation/ldap.rst                  |  2 +-
 docs/installation/systemd.rst               |  4 ++++
 5 files changed, 31 insertions(+), 11 deletions(-)

diff --git a/docs/installation/debian.rst b/docs/installation/debian.rst
index f49b8d3c..c538daa7 100644
--- a/docs/installation/debian.rst
+++ b/docs/installation/debian.rst
@@ -133,12 +133,6 @@ which version you've installed next time you want to upgrade your installation.
 System dependencies
 -------------------
 
-First, switch to the api directory:
-
-.. code-block:: shell
-
-    cd api
-
 A few OS packages are required in order to run Funkwhale. On Debian-like
 systems, they can be installed with
 
@@ -221,12 +215,21 @@ Download the sample environment file:
 
         cp /srv/funkwhale/deploy/env.prod.sample /srv/funkwhale/config/.env
 
+Generate a secret key for Django:
 
-You can then edit it: the file is heavily commented, and the most relevant
+.. code-block:: shell
+    openssl rand -base64 45
+
+You can then edit the file: the file is heavily commented, and the most relevant
 configuration options are mentioned at the top of the file.
 
-Especially, populate the ``DATABASE_URL`` and ``CACHE_URL`` values based on
-how you configured your PostgreSQL and Redis servers in
+.. code-block:: shell
+    nano /srv/funkwhale/api/.env
+
+Paste the secret key you generated earlier at the entry
+``DJANGO_SECRET_KEY`` and populate the ``DATABASE_URL``
+and ``CACHE_URL`` values based on how you configured
+your PostgreSQL and Redis servers in
 :doc:`external dependencies <./external_dependencies>`.
 
 Database setup
diff --git a/docs/installation/external_dependencies.rst b/docs/installation/external_dependencies.rst
index ba652e8a..60be2b53 100644
--- a/docs/installation/external_dependencies.rst
+++ b/docs/installation/external_dependencies.rst
@@ -95,4 +95,4 @@ This should be enough to have your redis server set up.
 External Authentication (LDAP)
 ----------------------
 
-LDAP support requires some additional dependencies to enable. On the OS level both ``libldap2-dev`` and ``libsasl2-dev`` are required, and the Python modules ``python-ldap`` and ``django-auth-ldap`` must be installed. These dependencies are all included in the ``requirements.*`` files so deploying with those will install these dependencies by default. However, they are not required unless LDAP support is explicitly enabled. See :doc:`./ldap` for more details.
+LDAP support requires some additional dependencies to enable. On the OS level both ``libldap2-dev`` and ``libsasl2-dev`` are required, and the Python modules ``python-ldap`` and ``python-django-auth-ldap`` must be installed. These dependencies are all included in the ``requirements.*`` files so deploying with those will install these dependencies by default. However, they are not required unless LDAP support is explicitly enabled. See :doc:`./ldap` for more details.
diff --git a/docs/installation/index.rst b/docs/installation/index.rst
index e155572b..06402d15 100644
--- a/docs/installation/index.rst
+++ b/docs/installation/index.rst
@@ -197,6 +197,14 @@ Finally, enable the resulting configuration:
 .. code-block:: bash
     ln -s /etc/nginx/sites-available/funkwhale.conf /etc/nginx/sites-enabled/
 
+.. note::
+
+    At this point you will need a certificate to enable HTTPS on your server.
+    There are many ways to obtain this certificate. The most popular and free
+    way is to obtain it from Let's Encryt. To do this, you can use an utility
+    called certbot. You can find a complete documentation on how to use certbot
+    at the `certbot documentation <https://certbot.eff.org/docs/>`.
+
 Check the configuration is valid with ``nginx -t`` then reload your nginx server with ``systemctl restart nginx``.
 
 .. warning::
@@ -230,6 +238,11 @@ You can tweak the configuration file according to your setup, especially the
 TLS configuration. Otherwise, defaults, should work if you followed the
 installation guide.
 
+.. note::
+
+    To obtain a certificate to enable HTTPS on your server, please refer to the note in
+    the nginx chapter above.
+
 Check the configuration is valid with ``apache2ctl configtest``, and once you're
 done, load the new configuration with ``service apache2 restart``.
 
diff --git a/docs/installation/ldap.rst b/docs/installation/ldap.rst
index d38ba87a..a30bb5e6 100644
--- a/docs/installation/ldap.rst
+++ b/docs/installation/ldap.rst
@@ -14,7 +14,7 @@ Funkwhale supports LDAP through the Django LDAP authentication module and by set
 Dependencies
 ------------
 
-LDAP support requires some additional dependencies to enable. On the OS level both ``libldap2-dev`` and ``libsasl2-dev`` are required, and the Python modules ``python-ldap`` and ``django-auth-ldap`` must be installed. These dependencies are all included in the ``requirements.*`` files so deploying with those will install these dependencies by default. However, they are not required unless LDAP support is explicitly enabled.
+LDAP support requires some additional dependencies to enable. On the OS level both ``libldap2-dev`` and ``libsasl2-dev`` are required, and the Python modules ``python-ldap`` and ``python-django-auth-ldap`` must be installed. These dependencies are all included in the ``requirements.*`` files so deploying with those will install these dependencies by default. However, they are not required unless LDAP support is explicitly enabled.
 
 Environment variables
 ---------------------
diff --git a/docs/installation/systemd.rst b/docs/installation/systemd.rst
index 6dfee767..33f6a38e 100644
--- a/docs/installation/systemd.rst
+++ b/docs/installation/systemd.rst
@@ -1,6 +1,10 @@
 Systemd configuration
 ----------------------
 
+.. note::
+
+    All the command lines below should be executed as root.
+
 Systemd offers a convenient way to manage your Funkwhale instance if you're
 not using docker.
 
-- 
GitLab