From 070ad9615f0bf927442eaf48aa383f5612c339e4 Mon Sep 17 00:00:00 2001 From: RenonDis Date: Wed, 13 Jun 2018 17:30:21 +0200 Subject: [PATCH 1/2] Updated apache2 conf file for websockets --- changes/changelog.d/252.enhancement | 1 + deploy/apache.conf | 8 +++----- docs/installation/index.rst | 9 --------- 3 files changed, 4 insertions(+), 14 deletions(-) create mode 100644 changes/changelog.d/252.enhancement diff --git a/changes/changelog.d/252.enhancement b/changes/changelog.d/252.enhancement new file mode 100644 index 000000000..53f702080 --- /dev/null +++ b/changes/changelog.d/252.enhancement @@ -0,0 +1 @@ +Apache2 reverse proxy now supports websockets (with Apache 2.4.25) (!252) diff --git a/deploy/apache.conf b/deploy/apache.conf index b61493b35..5f86db7bd 100644 --- a/deploy/apache.conf +++ b/deploy/apache.conf @@ -4,10 +4,8 @@ Define funkwhale-sn funkwhale.yourdomain.com # Following variables should be modified according to your setup and if you # use different configuration than what is described in our installation guide. Define funkwhale-api http://localhost:5000 +Define funkwhale-api-ws ws://localhost:5000 Define MUSIC_DIRECTORY_PATH /srv/funkwhale/data/music -# websockets are not working yet -# Define funkwhale-api-ws ws://localhost:5000 - # HTTP requests redirected to HTTPS @@ -70,8 +68,8 @@ Define MUSIC_DIRECTORY_PATH /srv/funkwhale/data/music Allow from all - # Activating WebSockets (not working) - # ProxyPass "/api/v1/instance/activity" "ws://localhost:5000/api/v1/instance/activity" + # Activating WebSockets + ProxyPass "/api/v1/instance/activity" ${funkwhale-api-ws}/api/v1/instance/activity # similar to nginx 'client_max_body_size 30M;' diff --git a/docs/installation/index.rst b/docs/installation/index.rst index 0628fe17f..034f8e9ba 100644 --- a/docs/installation/index.rst +++ b/docs/installation/index.rst @@ -124,15 +124,6 @@ If everything is fine, you can restart your nginx server with ``service nginx re Apache2 ^^^^^^^ -.. note:: - - Apache2 support is still very recent and the following features - are not working yet: - - - Websocket (used for real-time updates on Instance timeline) - - Those features are not necessary to use your Funkwhale instance. - Ensure you have a recent version of apache2 installed on your server. You'll also need the following dependencies:: From ae4a470145cf26d804a6bbc14f3fcaf111b2d5a7 Mon Sep 17 00:00:00 2001 From: RenonDis Date: Wed, 13 Jun 2018 17:40:39 +0200 Subject: [PATCH 2/2] Details in changelog Fix changelog --- changes/changelog.d/252.enhancement | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/changes/changelog.d/252.enhancement b/changes/changelog.d/252.enhancement index 53f702080..eb4fd9dbd 100644 --- a/changes/changelog.d/252.enhancement +++ b/changes/changelog.d/252.enhancement @@ -1 +1,15 @@ -Apache2 reverse proxy now supports websockets (with Apache 2.4.25) (!252) +Apache2 reverse proxy now supports websockets (tested with Apache 2.4.25) (!252) + +Apache support for websocket +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Add this at the beginning of your Apache configuration file:: + + Define funkwhale-api-ws ws://localhost:5000 + +Add this to your Apache configuration file, before the "/api" block:: + + # Activating WebSockets + ProxyPass "/api/v1/instance/activity" ${funkwhale-api-ws}/api/v1/instance/activity + +Websockets may not be supported in older versions of Apache2. Be sure to upgrade to the latest version available.