From 5f9df61e7eff0ee5d3ee1a92888d35e0ee72740f Mon Sep 17 00:00:00 2001
From: Eliot Berriot <contact@eliotberriot.com>
Date: Thu, 21 Mar 2019 10:07:14 +0100
Subject: [PATCH] Updated mono-container documentation with compose file and
 NESTED_PROXY

---
 changes/changelog.d/docker-mono.bugfix |  1 +
 changes/notes.rst                      | 13 +++++++++++++
 docs/installation/docker.rst           | 27 ++++++++++++++++++++++++++
 3 files changed, 41 insertions(+)
 create mode 100644 changes/changelog.d/docker-mono.bugfix

diff --git a/changes/changelog.d/docker-mono.bugfix b/changes/changelog.d/docker-mono.bugfix
new file mode 100644
index 0000000000..648ccb4460
--- /dev/null
+++ b/changes/changelog.d/docker-mono.bugfix
@@ -0,0 +1 @@
+Avoid mixed content when deploying mono-container behind HTTPS proxy (thetarkus/docker-funkwhale#19)
diff --git a/changes/notes.rst b/changes/notes.rst
index 96ac3d7651..a08d3a61d7 100644
--- a/changes/notes.rst
+++ b/changes/notes.rst
@@ -5,3 +5,16 @@ Next release notes
 
     Those release notes refer to the current development branch and are reset
     after each release.
+
+
+Avoid mixed content when deploying mono-container behind proxy [Manual action required]
+---------------------------------------------------------------------------------------------
+
+*You are only concerned if you use the mono-container docker deployment behind a reverse proxy*
+
+Because of `an issue in our mono-container configuration <https://github.com/thetarkus/docker-funkwhale/issues/19>`_, users deploying Funkwhale via docker
+using our `funkwhale/all-in-one` image could face some mixed content warnings (and possibly other troubles)
+when browsing the Web UI.
+
+This is fixed in this release, but on existing deployments, you'll need to add ``NESTED_PROXY=1`` in your container
+environment (either in your ``.env`` file, or via your container management tool), then recreate your funkwhale container.
diff --git a/docs/installation/docker.rst b/docs/installation/docker.rst
index 163c8555b4..b6f67f5e48 100644
--- a/docs/installation/docker.rst
+++ b/docs/installation/docker.rst
@@ -53,6 +53,8 @@ Create an env file to store a few important configuration options:
     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
+    # Remove this if you expose the container directly on ports 80/443
+    echo "NESTED_PROXY=1" >> .env
 
 Then start the container:
 
@@ -112,6 +114,31 @@ Useful commands:
             -d \
             funkwhale/all-in-one:$FUNKWHALE_VERSION
 
+
+    You can use the following docker-compose file to make the management process easier:
+
+    .. code-block:: yaml
+
+        version: "3"
+
+        services:
+          funkwhale:
+            container_name: funkwhale
+            restart: unless-stopped
+            # add the version number in your .env file, or hardcode it
+            image: funkwhale/all-in-one:${FUNKWHALE_VERSION}
+            env_file: .env
+            environment:
+              # adapt to the pid/gid that own /srv/funkwhale/data
+              - PUID=1000
+              - PGID=1000
+            volumes:
+              - /srv/funkwhale/data:/data
+              - /path/to/your/music/dir:/music:ro
+            ports:
+              - "5000:80"
+
+
 .. _docker-multi-container:
 
 Multi-container installation
-- 
GitLab