Funkwhale

Instances can be federated via the ActivityPub protocol.

Quoting the main documentation page:

Funkwhale is a self-hosted, modern, free and open-source music server, heavily inspired by Grooveshark.

Installation

Funkwhale requires a reverse proxy (), so nginx or Apache HTTP Server need to be installed.

It also needs a configured PostgreSQL database and a Redis cache server. See #Configuration and the respective pages for information.

Installation from AUR

Install the package.

Warning: This installation does not use a python virtualenv, so all the python dependencies are installed system-wide, mainly from the AUR. Package versions may differ from the upstream requirements and cause problems.

Manual install

Follow instructions for the Arch installation at . This will install all components in /srv/funkwhale.

Docker install

Follow instructions for the Docker installation at .

Configuration

The following sections assume that Funkwhale was installed from AUR, for a manual installation the folders should be changed appropriately.

It also assumes that you are using Funkwhale on a local network. See the official documentation for making it accessible outside, especially for the certificates using Certbot.

Host config

Make sure your file is setup correctly. The Funkwhale server is running on with alias , but this can be changed.

Your file should look something like the following,

#<ip-address>   <hostname.domain.org>   <hostname>
127.0.0.1       localhost
::1             localhost
127.0.0.1       funkwhale.local

Configure nginx

The upstream template of the Nginx configuration file is provided in . However, this file contains variables that need to be replaced by their value from the file (see section #Initialization on how to create this file):

$ set -a && source /srv/funkwhale/config/env && set +a
$ envsubst "`env | awk -F = '{printf \" $%s\", $1}'`" \
   < /etc/webapps/funkwhale/nginx.conf \
   > /etc/nginx/sites-available/funkwhale.conf

The paths to the certificates should also be modified accordingly.

Then enable the site:

$ ln -s /etc/nginx/sites-available/funkwhale.conf /etc/nginx/sites-enabled/

And start the .

Configure apache

A template Apache configuration file is provided in . It configures the Funkwhale instance to be accessible at https://funkwhale.local.

The folder names should be change to fit your installation. More explanation on which lines need to be modified is provided in .

Copy the template to the apache configuration folder,

$ cp /etc/webapps/funkwhale/apache-funkwhale.conf /etc/httpd/conf/extra/funkwhale.conf

Next, edit the Apache HTTP Server configuration file and add the following:

For the changes to be applied, you need to restart (Apache) using systemd.

Configure PostgreSQL

Here we follow the official documentation:

Connect to the PostgreSQL command line using the user to create the user and the database.

$ sudo -u postgres psql
CREATE DATABASE "funkwhale"
 WITH ENCODING 'utf8';
CREATE USER funkwhale;
GRANT ALL PRIVILEGES ON DATABASE funkwhale TO funkwhale;
\c funkwhale;
CREATE EXTENSION "unaccent";
CREATE EXTENSION "citext";

The last three lines load the and extensions, which are needed for funkwhale to work ( since version 0.20).

Initialization

Funkwhale user

Funkwhale should be run as the user. It is automatically created by the AUR package. If you followed the manual installation, create it with

# useradd -r -d /srv/funkwhale -m funkwhale -c "Funkwhale music server -s /sbin/nologin"

Create Funkwhale's data folders in /srv/funkwhale, owned by the user:

# mkdir /srv/funkwhale
# chown funkwhale:funkwhale /srv/funkwhale

Run the following commands as the user.

Create sub-folders for API files and storage.

To work, Funkwhale needs several environment variables to be present, these should be defined in the environment file . There is a template at , copy and modify it to fit your installation.

[funkwhale]$ cp /etc/webapps/funkwhale/env.template /srv/funkwhale/config/env

The variable should correspond to the hostname in . DJANGO_ALLOWED_HOSTS needs also to match the address where the funkwhale instance will be reached. You should generate a unique and change the paths accordingly to your installation.

Database setup

Initialize the database before launching the application:

Create a superuser for your Funkwhale instance:

[funkwhale]$ python /usr/share/webapps/funkwhale/api/manage.py createsuperuser

Collect the static files for the webapp:

[funkwhale]$ python /usr/share/webapps/funkwhale/api/manage.py collectstatic

Version upgrade

All commands should be entered as user. Stop the funkwhale.service before upgrading.

The static files have to be collected again:

[funkwhale]$ funkwhale_manage collectstatic --no-input

Apply database migrations:

[funkwhale]$ funkwhale_manage migrate

To upgrade to version 1.0, the thumbnails quality has been increased from 70 to 95, so all the thumbnails should be regenerated (or set in the file so nothing changes). First delete the in your directory, then regenerate the thumbnails,

[funkwhale]$ rm -rf /srv/funkwhale/data/media/__sized__
[funkwhale]$ funkwhale_manage fw media generate-thumbnails

Starting from version 0.20.1, there is a new parameter in the file set to True (you can set it to so nothing changes). It is a performance enhancement and to make it work you need to run the following command,

[funkwhale]$ python /usr/share/webapps/funkwhale/api/manage.py rebuild_music_permissions

After completing all these steps, the funkwhale.service can be started again.

Usage

Upstream provides systemd services that are already installed with the AUR package.

To start the instance, just start funkwhale.service.

This starts three services, you can check their status with:

$ systemctl status funkwhale-\*

Troubleshooting

See https://docs.funkwhale.audio/admin/troubleshooting.html

Proxy logs

Apache logs for funkwhale:

$ tail -f /var/log/httpd/funkwhale/error.log
This article is issued from Archlinux. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.