2023-04-02 19:41:22 +02:00
# Funkwhale
2023-04-02 18:19:58 +02:00
[Funkwhale ](funkwhale.audio/ ) is a community-driven project that lets you listen and share music and audio within a decentralized, open network.
## Dependencies
This service requires the following other services:
- a [Postgres ](postgres.md ) database
2024-03-26 16:19:03 +01:00
- a [KeyDB ](keydb.md ) data-store, installation details [below ](#keydb )
2023-04-02 18:19:58 +02:00
- a [Traefik ](traefik.md ) reverse-proxy server
## Configuration
To enable this service, add the following configuration to your `vars.yml` file and re-run the [installation ](../installing.md ) process:
```yaml
########################################################################
# #
# funkwhale #
# #
########################################################################
2023-04-02 19:41:22 +02:00
2023-04-02 18:19:58 +02:00
funkwhale_enabled: true
2023-04-02 19:41:22 +02:00
2023-04-02 18:19:58 +02:00
funkwhale_hostname: mash.example.com
2023-04-02 19:41:22 +02:00
2023-04-02 18:19:58 +02:00
# Put a strong secret below, generated with `pwgen -s 64 1` or in another way
funkwhale_django_secret_key: ''
2023-04-02 19:41:22 +02:00
2024-03-26 16:19:03 +01:00
# KeyDB configuration, as described below
2023-04-02 19:41:22 +02:00
2023-04-02 18:19:58 +02:00
########################################################################
# #
# /funkwhale #
# #
########################################################################
```
2024-03-26 16:19:03 +01:00
### KeyDB
2023-04-02 18:19:58 +02:00
2024-03-26 16:19:03 +01:00
As described on the [KeyDB ](keydb.md ) documentation page, if you're hosting additional services which require KeyDB on the same server, you'd better go for installing a separate KeyDB instance for each service. See [Creating a KeyDB instance dedicated to funkwhale ](#creating-a-keydb-instance-dedicated-to-funkwhale ).
2023-04-02 18:19:58 +02:00
2024-03-26 16:19:03 +01:00
If you're only running funkwhale on this server and don't need to use KeyDB for anything else, you can [use a single KeyDB instance ](#using-the-shared-keydb-instance-for-funkwhale ).
2023-04-02 18:19:58 +02:00
2024-03-26 16:19:03 +01:00
#### Using the shared KeyDB instance for funkwhale
2023-04-02 18:19:58 +02:00
2024-03-26 16:19:03 +01:00
To install a single (non-dedicated) KeyDB instance (`mash-keydb`) and hook funkwhale to it, add the following **additional** configuration:
2023-04-02 18:19:58 +02:00
```yaml
########################################################################
# #
2024-03-26 16:19:03 +01:00
# keydb #
2023-04-02 18:19:58 +02:00
# #
########################################################################
2023-04-02 19:41:22 +02:00
2024-03-26 16:19:03 +01:00
keydb_enabled: true
2023-04-02 19:41:22 +02:00
2023-04-02 18:19:58 +02:00
########################################################################
# #
2024-03-26 16:19:03 +01:00
# /keydb #
2023-04-02 18:19:58 +02:00
# #
########################################################################
2023-04-02 19:41:22 +02:00
2023-04-02 18:19:58 +02:00
########################################################################
# #
2023-11-29 16:13:53 +01:00
# funkwhale #
2023-04-02 18:19:58 +02:00
# #
########################################################################
2023-04-02 19:41:22 +02:00
2023-04-02 18:19:58 +02:00
# Base configuration as shown above
2023-04-02 19:41:22 +02:00
2024-03-26 16:19:03 +01:00
# Point funkwhale to the shared KeyDB instance
funkwhale_config_redis_hostname: "{{ keydb_identifier }}"
2023-04-02 19:41:22 +02:00
2024-03-26 16:19:03 +01:00
# Make sure the funkwhale API service (mash-funkwhale-api.service) starts after the shared KeyDB service
2023-11-29 16:13:53 +01:00
funkwhale_api_systemd_required_services_list_custom:
2024-03-26 16:19:03 +01:00
- "{{ keydb_identifier }}.service"
2023-04-02 19:41:22 +02:00
2024-03-26 16:19:03 +01:00
# Make sure the funkwhale API service (mash-funkwhale-api.service) is connected to the container network of the shared KeyDB service
2023-11-29 16:13:53 +01:00
funkwhale_api_container_additional_networks_custom:
2024-03-26 16:19:03 +01:00
- "{{ keydb_container_network }}"
2023-04-02 19:41:22 +02:00
2023-04-02 18:19:58 +02:00
########################################################################
# #
2023-11-29 16:13:53 +01:00
# /funkwhale #
2023-04-02 18:19:58 +02:00
# #
########################################################################
```
2024-03-26 16:19:03 +01:00
This will create a `mash-keydb` KeyDB instance on this host.
2023-04-02 18:19:58 +02:00
2024-03-26 16:19:03 +01:00
This is only recommended if you won't be installing other services which require KeyDB. Alternatively, go for [Creating a KeyDB instance dedicated to funkwhale ](#creating-a-keydb-instance-dedicated-to-funkwhale ).
2023-04-02 18:19:58 +02:00
2024-03-26 16:19:03 +01:00
#### Creating a KeyDB instance dedicated to funkwhale
2023-04-02 18:19:58 +02:00
The following instructions are based on the [Running multiple instances of the same service on the same host ](../running-multiple-instances.md ) documentation.
Adjust your `inventory/hosts` file as described in [Re-do your inventory to add supplementary hosts ](../running-multiple-instances.md#re-do-your-inventory-to-add-supplementary-hosts ), adding a new supplementary host (e.g. if `funkwhale.example.com` is your main one, create `funkwhale.example.com-deps` ).
Then, create a new `vars.yml` file for the
`inventory/host_vars/funkwhale.example.com-deps/vars.yml` :
```yaml
---
2023-04-02 19:41:22 +02:00
2023-04-02 18:19:58 +02:00
########################################################################
# #
# Playbook #
# #
########################################################################
2023-04-02 19:41:22 +02:00
2023-04-02 18:19:58 +02:00
# Put a strong secret below, generated with `pwgen -s 64 1` or in another way
# Various other secrets will be derived from this secret automatically.
mash_playbook_generic_secret_key: ''
2023-04-02 19:41:22 +02:00
2023-04-02 18:19:58 +02:00
# Override service names and directory path prefixes
mash_playbook_service_identifier_prefix: 'mash-funkwhale-'
mash_playbook_service_base_directory_name_prefix: 'funkwhale-'
2023-04-02 19:41:22 +02:00
2023-04-02 18:19:58 +02:00
########################################################################
# #
# /Playbook #
# #
########################################################################
2023-04-02 19:41:22 +02:00
2023-04-02 18:19:58 +02:00
########################################################################
# #
2024-03-26 16:19:03 +01:00
# keydb #
2023-04-02 18:19:58 +02:00
# #
########################################################################
2023-04-02 19:41:22 +02:00
2024-03-26 16:19:03 +01:00
keydb_enabled: true
2023-04-02 19:41:22 +02:00
2023-04-02 18:19:58 +02:00
########################################################################
# #
2024-03-26 16:19:03 +01:00
# /keydb #
2023-04-02 18:19:58 +02:00
# #
########################################################################
```
2024-03-26 16:19:03 +01:00
This will create a `mash-funkwhale-keydb` instance on this host with its data in `/mash/funkwhale-keydb` .
2023-04-02 18:19:58 +02:00
Then, adjust your main inventory host's variables file (`inventory/host_vars/funkwhale.example.com/vars.yml`) like this:
```yaml
########################################################################
# #
2023-11-29 16:13:53 +01:00
# funkwhale #
2023-04-02 18:19:58 +02:00
# #
########################################################################
2023-04-02 19:41:22 +02:00
2023-04-02 18:19:58 +02:00
# Base configuration as shown above
2023-04-02 19:41:22 +02:00
2024-03-26 16:19:03 +01:00
# Point funkwhale to its dedicated KeyDB instance
funkwhale_config_redis_hostname: mash-funkwhale-keydb
2023-04-02 19:41:22 +02:00
2024-03-26 16:19:03 +01:00
# Make sure the funkwhale API service (mash-funkwhale-api.service) starts after its dedicated KeyDB service
2023-11-29 16:13:53 +01:00
funkwhale_api_systemd_required_services_list_custom:
2024-03-26 16:19:03 +01:00
- "mash-funkwhale-keydb.service"
2023-04-02 19:41:22 +02:00
2024-03-26 16:19:03 +01:00
# Make sure the funkwhale API service (mash-funkwhale-api.service) is connected to the container network of its dedicated KeyDB service
2023-11-29 16:13:53 +01:00
funkwhale_api_container_additional_networks_custom:
2024-03-26 16:19:03 +01:00
- "mash-funkwhale-keydb"
2023-04-02 19:41:22 +02:00
2023-04-02 18:19:58 +02:00
########################################################################
# #
2023-11-29 16:13:53 +01:00
# /funkwhale #
2023-04-02 18:19:58 +02:00
# #
########################################################################
```
## Installation
2024-03-26 16:19:03 +01:00
If you've decided to install a dedicated KeyDB instance for funkwhale, make sure to first do [installation ](../installing.md ) for the supplementary inventory host (e.g. `funkwhale.example.com-deps` ), before running installation for the main one (e.g. `funkwhale.example.com` ).
2023-04-02 18:19:58 +02:00
## Usage
2023-04-02 21:38:37 +02:00
After installation, you can go to the funkwhale URL, as defined in `funkwhale_hostname` . To login and get started you first have to create a user. you can do this with
2023-04-02 19:41:22 +02:00
```bash
2023-04-02 21:38:37 +02:00
just run-tags funkwhale-add-superuser --extra-vars=username=USERNAME --extra-vars=password=PASSWORD --extra-vars=email=EMAIL
2023-04-02 19:41:22 +02:00
```
All other users can be created in the Web GUI.