2017-07-17 20:00:32 +00:00
External dependencies
=====================
.. note ::
Those dependencies are handled automatically if you are
:doc: `deploying using docker <./docker>`
Database setup (PostgreSQL)
---------------------------
Funkwhale requires a PostgreSQL database to work properly. Please refer
to the `PostgreSQL documentation <https://www.postgresql.org/download/> `_
for installation instructions specific to your os.
2018-07-01 09:23:36 +00:00
On Debian-like systems, you would install the database server like this:
2017-07-17 20:00:32 +00:00
.. code-block :: shell
2018-04-26 11:14:44 +00:00
sudo apt-get install postgresql postgresql-contrib
2017-07-17 20:00:32 +00:00
2018-07-02 17:56:30 +00:00
On Arch Linux and its derivatives:
.. code-block :: shell
sudo pacman -S postgresql
On Arch, you'll also need to initialize the database. See `the Arch Linux wiki <https://wiki.archlinux.org/index.php/Postgresql#Initial_configuration> `_ .
2017-07-17 20:00:32 +00:00
The remaining steps are heavily inspired from `this Digital Ocean guide <https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04> `_ .
Open a database shell:
.. code-block :: shell
sudo -u postgres psql
Create the project database and user:
.. code-block :: shell
2018-06-08 23:06:05 +00:00
CREATE DATABASE "funkwhale"
2018-06-08 23:09:46 +00:00
WITH ENCODING 'utf8';
2017-07-17 20:00:32 +00:00
CREATE USER funkwhale;
GRANT ALL PRIVILEGES ON DATABASE funkwhale TO funkwhale;
2018-04-27 16:28:44 +00:00
.. warning ::
2018-07-12 19:07:29 +00:00
It's important that you use utf-8 encoding for your database,
2018-04-27 16:28:44 +00:00
otherwise you'll end up with errors and crashes later on when dealing
with music metedata that contains non-ascii chars.
2018-07-12 19:07:29 +00:00
Assuming you already have :ref: `created your funkwhale user <create-funkwhale-user>` ,
you should now be able to open a postgresql shell:
2017-07-17 20:00:32 +00:00
.. code-block :: shell
sudo -u funkwhale -H psql
2018-03-06 16:56:47 +00:00
Unless you give a superuser access to the database user, you should also
enable some extensions on your database server, as those are required
2018-07-01 09:33:55 +00:00
for Funkwhale to work properly:
2018-03-06 16:56:47 +00:00
.. code-block :: shell
2018-06-08 23:44:08 +00:00
sudo -u postgres psql funkwhale -c 'CREATE EXTENSION "unaccent";'
2018-03-06 16:56:47 +00:00
2017-07-17 20:00:32 +00:00
Cache setup (Redis)
-------------------
Funkwhale also requires a cache server:
- To make the whole system faster, by caching network requests or database
queries
- To handle asynchronous tasks such as music import
2018-07-01 09:23:36 +00:00
On Debian-like distributions, a redis package is available, and you can
2017-07-17 20:00:32 +00:00
install it:
.. code-block :: shell
sudo apt-get install redis-server
2018-07-02 17:56:30 +00:00
On Arch Linux and its derivatives:
.. code-block :: shell
sudo pacman -S redis
2017-07-17 20:00:32 +00:00
This should be enough to have your redis server set up.
2018-08-22 18:10:39 +00:00
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.