diff --git a/deploy/docker.proxy.template b/deploy/docker.proxy.template index 812027bfa3b1574e41eaba7ec2a1a2110e0c476e..c4f89057defa8b4142d73dd737e80b238259819a 100644 --- a/deploy/docker.proxy.template +++ b/deploy/docker.proxy.template @@ -65,6 +65,7 @@ server { location / { include /etc/nginx/funkwhale_proxy.conf; + client_max_body_size ${NGINX_MAX_BODY_SIZE}; proxy_pass http://fw/; } } diff --git a/deploy/nginx.template b/deploy/nginx.template index 8f5f674b899b074a82bb1e5f958bb03455b49fe5..125397ea308a9ddaaaef562798b06a18d9bd9181 100644 --- a/deploy/nginx.template +++ b/deploy/nginx.template @@ -22,8 +22,8 @@ map $http_upgrade $connection_upgrade { } server { - listen 443 ssl http2; - listen [::]:443 ssl http2; + listen 443 ssl; + listen [::]:443 ssl; server_name ${FUNKWHALE_HOSTNAME}; # TLS diff --git a/docs/installation/debian.rst b/docs/installation/debian.rst index c538daa7616609899dfbdaec78c3c2598c5f15c8..7f6142a645cf06060c755f1b482903dbe71609f6 100644 --- a/docs/installation/debian.rst +++ b/docs/installation/debian.rst @@ -13,22 +13,27 @@ dependencies. However, Funkwhale requires a :doc:`few external dependencies <./external_dependencies>` for which documentation is outside of this document scope. -Install utilities ------------------ +Install system dependencies +--------------------------- -You'll need a few utilities during this guide that are not always present by -default on system. On Debian-like systems, you can install them using: +On Debian-like systems, you can install them using: .. code-block:: shell sudo apt-get update + # Install dependencies sudo apt-get install curl python3-pip python3-venv git unzip libldap2-dev libsasl2-dev + # Funkwhale dependencies + sudo apt install build-essential ffmpeg libjpeg-dev libmagic-dev libpq-dev postgresql-client python3-dev On Arch Linux and its derivatives: .. code-block:: shell + # Install dependencies sudo pacman -S curl python-pip python-virtualenv git unzip + # Funkwhale dependencies + sudo pacman -S curl file ffmpeg libjpeg-turbo libpqxx python libldap libsasl Layout ------- @@ -130,24 +135,6 @@ Then we'll download the frontend files: You can leave the ZIP archives in the directory, this will help you know which version you've installed next time you want to upgrade your installation. -System dependencies -------------------- - -A few OS packages are required in order to run Funkwhale. On Debian-like -systems, they can be installed with - -.. code-block:: shell - - sudo apt install build-essential ffmpeg libjpeg-dev libmagic-dev libpq-dev postgresql-client python3-dev - -On Arch, run - -.. code-block:: shell - - pacman -S $(cat api/requirements.pac) - -From now on, you should use the funkwhale user for all commands. - Python dependencies -------------------- @@ -205,9 +192,6 @@ Download the sample environment file: .. parsed-literal:: curl -L -o config/.env "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/master/deploy/env.prod.sample" - # symlink it so it's sourced automatically by the API process - # (This won't be needed anymore once release 0.18 is out) - ln -s /srv/funkwhale/config/.env /srv/funkwhale/api/.env .. note:: @@ -215,9 +199,8 @@ Download the sample environment file: cp /srv/funkwhale/deploy/env.prod.sample /srv/funkwhale/config/.env -Generate a secret key for Django: +Generate a secret key for Django:: -.. code-block:: shell openssl rand -base64 45 You can then edit the file: the file is heavily commented, and the most relevant diff --git a/docs/installation/docker.rst b/docs/installation/docker.rst index f47b90b84e909cf58bf3497e369d79dbf29b3e03..ceb7b8d03eaf707208f9f418ff5ab0d7f86abf72 100644 --- a/docs/installation/docker.rst +++ b/docs/installation/docker.rst @@ -25,11 +25,20 @@ Mono-container installation First, ensure you have `Docker <https://docs.docker.com/engine/installation/>`_ installed. -Then set up a directory for your data:: +Create the user and the directory: - mkdir /srv/funkwhale +.. code-block:: shell + + sudo useradd -r -s /usr/bin/nologin -d /srv/funkwhale -m funkwhale + sudo adduser funkwhale docker cd /srv/funkwhale +Log in as the newly created user from now on: + +.. code-block:: shell + + sudo -u funkwhale -H bash + Export the version you want to deploy: .. parsed-literal:: @@ -42,8 +51,8 @@ Create an env file to store a few important configuration options: touch .env echo "FUNKWHALE_HOSTNAME=yourdomain.funkwhale" >> .env - echo "FUNKWHALE_PROTOCOL=https" >> .env # or http - echo "DJANGO_SECRET_KEY=$(openssl rand -hex 45)" >> .env # generate and store a secure secret key for your instance + echo "FUNKWHALE_PROTOCOL=https" >> .env # or http + echo "DJANGO_SECRET_KEY=$(openssl rand -hex 45)" >> .env # generate and store a secure secret key for your instance Then start the container: @@ -76,8 +85,32 @@ Useful commands: - You can start and stop your instance using ``docker start funkwhale`` and ``docker stop funkwhale``, respectively - To have a better idea of the resource usage of your instance (CPU, memory), run ``docker stats funkwhale`` +.. note:: + + The container will not pick up changes made in .env file automatically. + In order to load new configuration, run: + .. parsed-literal:: + export FUNKWHALE_VERSION="|version|" + + .. code-block:: shell + + # stop and remove the existing container + docker stop funkwhale + docker rm funkwhale + # relaunch a new container + docker run \ + --name=funkwhale \ + --restart=unless-stopped \ + --env-file=/srv/funkwhale/.env \ + -v /srv/funkwhale/data:/data \ + -v /path/to/your/music/dir:/music:ro \ + -e PUID=$UID \ + -e PGID=$GID \ + -p 5000:80 \ + -d \ + funkwhale/all-in-one:$FUNKWHALE_VERSION .. _docker-multi-container: @@ -86,6 +119,12 @@ Multi-container installation First, ensure you have `Docker <https://docs.docker.com/engine/installation/>`_ and `docker-compose <https://docs.docker.com/compose/install/>`_ installed. +Export the version you want to deploy: + +.. parsed-literal:: + + export FUNKWHALE_VERSION="|version|" + Download the sample docker-compose file: .. parsed-literal:: @@ -93,9 +132,9 @@ Download the sample docker-compose file: mkdir /srv/funkwhale cd /srv/funkwhale mkdir nginx - curl -L -o nginx/funkwhale.template "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/master/deploy/docker.nginx.template" - curl -L -o nginx/funkwhale_proxy.conf "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/master/deploy/funkwhale_proxy.conf" - curl -L -o docker-compose.yml "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/master/deploy/docker-compose.yml" + curl -L -o nginx/funkwhale.template "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/|version|/deploy/docker.nginx.template" + curl -L -o nginx/funkwhale_proxy.conf "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/|version|/deploy/funkwhale_proxy.conf" + curl -L -o docker-compose.yml "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/|version|/deploy/docker-compose.yml" At this point, the architecture of ``/srv/funkwhale`` should look like that: @@ -103,7 +142,6 @@ At this point, the architecture of ``/srv/funkwhale`` should look like that: . ├── docker-compose.yml - ├── .env └── nginx ├── funkwhale_proxy.conf └── funkwhale.template @@ -112,8 +150,7 @@ Create your env file: .. parsed-literal:: - export FUNKWHALE_VERSION="|version|" - curl -L -o .env "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/master/deploy/env.prod.sample" + curl -L -o .env "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/|version|/deploy/env.prod.sample" sed -i "s/FUNKWHALE_VERSION=latest/FUNKWHALE_VERSION=$FUNKWHALE_VERSION/" .env sudo nano .env diff --git a/docs/installation/index.rst b/docs/installation/index.rst index 06402d15d177b53a454c09eb8581ae0791295952..f2ee1e6e0d1b11614c907167054d7784265f6b7b 100644 --- a/docs/installation/index.rst +++ b/docs/installation/index.rst @@ -149,11 +149,14 @@ match the application configuration and make upgrade/maintenance easier. On docker deployments, run the following commands: -.. code:: shell +.. parsed-literal:: + export FUNKWHALE_VERSION="|version|" # download the needed files - curl -L -o /etc/nginx/funkwhale_proxy.conf "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/master/deploy/funkwhale_proxy.conf" - curl -L -o /etc/nginx/sites-available/funkwhale.template "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/master/deploy/docker.proxy.template" + curl -L -o /etc/nginx/funkwhale_proxy.conf "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/|version|/deploy/funkwhale_proxy.conf" + curl -L -o /etc/nginx/sites-available/funkwhale.template "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/|version|/deploy/docker.proxy.template" + +.. code-block:: shell # create a final nginx configuration using the template based on your environment set -a && source /srv/funkwhale/.env && set +a @@ -165,11 +168,16 @@ On docker deployments, run the following commands: On non-docker deployments, run the following commands: -.. code:: shell + +.. parsed-literal:: + + export FUNKWHALE_VERSION="|version|" # download the needed files - curl -L -o /etc/nginx/funkwhale_proxy.conf "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/master/deploy/funkwhale_proxy.conf" - curl -L -o /etc/nginx/sites-available/funkwhale.template "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/master/deploy/nginx.template" + curl -L -o /etc/nginx/funkwhale_proxy.conf "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/|version|/deploy/funkwhale_proxy.conf" + curl -L -o /etc/nginx/sites-available/funkwhale.template "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/|version|/deploy/nginx.template" + +.. code-block:: shell # create a final nginx configuration using the template based on your environment set -a && source /srv/funkwhale/config/.env && set +a