Verified Commit 338e1a85 authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Merge branch 'release/0.18'

parents de7b1314 f44d2b06
......@@ -12,3 +12,9 @@ MUSIC_DIRECTORY_PATH=/music
# Uncomment this if you're using traefik/https
# Customize to your needs
......@@ -93,4 +93,6 @@ po/*.po
IMAGE_NAME: funkwhale/funkwhale
ALL_IN_ONE_IMAGE_NAME: funkwhale/all-in-one
......@@ -131,16 +132,15 @@ flake8:
- postgres:9.4
- postgres:11
- redis:3
stage: test
image: funkwhale/funkwhale:latest
image: funkwhale/funkwhale:develop
key: "$CI_PROJECT_ID__pip_cache"
DATABASE_URL: "postgresql://postgres@postgres/postgres"
DJANGO_SETTINGS_MODULE: config.settings.local
......@@ -148,11 +148,10 @@ test_api:
- branches
- cd api
- apt-get update
- grep "^[^#;]" requirements.apt | grep -Fv "python3-dev" | xargs apt-get install -y --no-install-recommends
- pip install -r requirements/base.txt
- pip install -r requirements/local.txt
- pip install -r requirements/test.txt
- sed -i '/Pillow/d' requirements/base.txt
- pip3 install -r requirements/base.txt
- pip3 install -r requirements/local.txt
- pip3 install -r requirements/test.txt
- pytest --cov=funkwhale_api tests/
......@@ -166,7 +165,7 @@ test_front:
- branches
- yarn install
- yarn install --check-files
- yarn test:unit
key: "funkwhale__front_dependencies"
......@@ -194,11 +193,6 @@ build_front:
# cf
- yarn build | tee /dev/stderr | (! grep -i 'ERROR in')
- chmod -R 755 dist
key: "funkwhale__front_dependencies"
- front/node_modules
- front/yarn.lock
name: "front_${CI_COMMIT_REF_NAME}"
......@@ -207,6 +201,7 @@ build_front:
- tags@funkwhale/funkwhale
- master@funkwhale/funkwhale
- develop@funkwhale/funkwhale
- docker
......@@ -236,9 +231,11 @@ pages:
stage: deploy
image: bash
- docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD
- cp -r front/dist api/frontend
- (if [ "$CI_COMMIT_REF_NAME" == "develop" ]; then ./scripts/ $(echo $CI_COMMIT_SHA | cut -c 1-8); fi);
- cd api
- docker build -t $IMAGE .
......@@ -249,15 +246,42 @@ docker_release:
- docker-build
stage: deploy
image: bash
ALL_IN_ONE_REF: master
BUILD_PATH: all_in_one
- docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD
- (if [ "$CI_COMMIT_REF_NAME" == "develop" ]; then ./scripts/ $(echo $CI_COMMIT_SHA | cut -c 1-8); fi);
- unzip -o -d tmpdir
- mv tmpdir/docker-funkwhale-$ALL_IN_ONE_REF $BUILD_PATH && rmdir tmpdir
- cp -r api $BUILD_PATH/src/api
- cp -r front $BUILD_PATH/src/front
- ./scripts/ src/ $CI_COMMIT_REF_NAME
- docker build -t $ALL_IN_ONE_IMAGE .
- docker push $ALL_IN_ONE_IMAGE
- develop@funkwhale/funkwhale
- tags@funkwhale/funkwhale
- docker-build
# Simply publish a zip containing api/ directory
stage: deploy
image: busybox
image: bash
name: "api_${CI_COMMIT_REF_NAME}"
- api
- (if [ "$CI_COMMIT_REF_NAME" == "develop" ]; then ./scripts/ $(echo $CI_COMMIT_SHA | cut -c 1-8); fi);
- chmod -R 750 api
- echo Done!
......@@ -34,6 +34,12 @@ Describe the expected behaviour.
## Context
The version of your instance can be found on the footer : Source code (x.y)
**Funkwhale version(s) affected**: x.y
If relevant, share additional context here like:
......@@ -10,6 +10,297 @@ This changelog is viewable on the web at
.. towncrier
0.18 "Naomi" (2019-01-22)
This release is dedicated to Naomi, an early contributor and beta tester of Funkwhale.
Her positivity, love and support have been incredibly helpful and helped shape the project
as you can enjoy it today. Thank you so much Naomi <3
Upgrade instructions are available at, ensure you also execute the intructions
marked with ``[manual action required]`` and ``[manual action suggested]``.
See ``Full changelog`` below for an exhaustive list of changes!
Audio transcoding is back!
After removal of our first, buggy transcoding implementation, we're proud to announce
that this feature is back. It is enabled by default, and can be configured/disabled
in your instance settings!
This feature works in the browser, with federated/non-federated tracks and using Subsonic clients.
Transcoded tracks are generated on the fly, and cached for a configurable amount of time,
to reduce the load on the server.
Licensing and copyright information
Funkwhale is now able to parse copyright and license data from file and store
this information. Apart from displaying it on each track detail page,
no additional behaviour is currently implemented to use this new data, but this
will change in future releases.
License and copyright data is also broadcasted over federation.
License matching is done on the content of the ``License`` tag in the files,
with a fallback on the ``Copyright`` tag.
Funkwhale will successfully extract licensing data for the following licenses:
- Creative Commons 0 (Public Domain)
- Creative Commons 1.0 (All declinations)
- Creative Commons 2.0 (All declinations)
- Creative Commons 2.5 (All declinations and countries)
- Creative Commons 3.0 (All declinations and countries)
- Creative Commons 4.0 (All declinations)
Support for other licenses such as Art Libre or WTFPL will be added in future releases.
Instance-level moderation tools
This release includes a first set of moderation tools that will give more control
to admins about the way their instance federate with other instance and accounts on the network.
Using these tools, it's now possible to:
- Browse known accounts and domains, and associated data (storage size, software version, etc.)
- Purge data belonging to given accounts and domains
- Block or partially restrict interactions with any account or domain
All those features are usable using a brand new "moderation" permission, meaning
you can appoints one or nultiple moderators to help with this task.
I'd like to thank all Mastodon contributors, because some of the these tools are heavily
inspired from what's being done in Mastodon. Thank you so much!
Iframe widget to embed public tracks and albums [manual action required]
Funkwhale now support embedding a lightweight audio player on external websites
for album and tracks that are available in public libraries. Important pages,
such as artist, album and track pages also include OpenGraph tags that will
enable previews on compatible apps (like sharing a Funkwhale track link on Mastodon
or Twitter).
To achieve that, we had to tweak the way Funkwhale front-end is served. You'll have
to modify your nginx configuration when upgrading to keep your instance working.
**On docker setups**, edit your ``/srv/funkwhale/nginx/funkwhale.template`` and replace
the ``location /api/`` and `location /` blocks by the following snippets::
location / {
include /etc/nginx/funkwhale_proxy.conf;
# this is needed if you have file import via upload enabled
client_max_body_size ${NGINX_MAX_BODY_SIZE};
proxy_pass http://funkwhale-api/;
location /front/ {
alias /frontend/;
The change of configuration will be picked when restarting your nginx container.
**On non-docker setups**, edit your ``/etc/nginx/sites-available/funkwhale.conf`` file,
and replace the ``location /api/`` and `location /` blocks by the following snippets::
location / {
include /etc/nginx/funkwhale_proxy.conf;
# this is needed if you have file import via upload enabled
client_max_body_size ${NGINX_MAX_BODY_SIZE};
proxy_pass http://funkwhale-api/;
location /front/ {
Replace ``${FUNKWHALE_FRONTEND_PATH}`` by the corresponding variable from your .env file,
which should be ``/srv/funkwhale/front/dist`` by default, then reload your nginx process with
``sudo systemctl reload nginx``.
Alternative docker deployment method
Thanks to the awesome done by @thetarkus at,
we're now able to provide an alternative and easier Docker deployment method!
In contrast with our current, multi-container offer, this method integrates
all Funkwhale processes and services (database, redis, etc.) into a single, easier to deploy container.
Both method will coexist in parallel, as each one has pros and cons. You can learn more
about this exciting new deployment option by visiting!
Automatically load .env file
On non-docker deployments, earlier versions required you to source
the config/.env file before launching any Funkwhale command, with ``export $(cat config/.env | grep -v ^# | xargs)``
This led to more complex and error prode deployment / setup.
This is not the case anymore, and Funkwhale will automatically load this file if it's available.
Delete pre 0.17 federated tracks [manual action suggested]
If you were using Funkwhale before the 0.17 release and federated with other instances,
it's possible that you still have some unplayable federated files in the database.
To purge the database of those entries, you can run the following command:
On docker setups::
docker-compose run --rm api python script delete_pre_017_federated_uploads --no-input
On non-docker setups::
python script delete_pre_017_federated_uploads --no-input
Enable gzip compression [manual action suggested]
Gzip compression will be enabled on new instances by default
and will reduce the amount of bandwidth consumed by your instance.
If you with to benefit from gzip compression on your instance,
edit your reverse proxy virtualhost file (located at ``/etc/nginx/sites-available/funkwhale.conf``) and add the following snippet
in the server block, then reload your nginx server::
server {
# ... exiting configuration
# compression settings
gzip on;
gzip_comp_level 5;
gzip_min_length 256;
gzip_proxied any;
gzip_vary on;
# end of compression settings
Full changelog
- Allow embedding of albums and tracks available in public libraries via an <iframe> (#578)
- Audio transcoding is back! (#272)
- First set of instance level moderation tools (#580, !521)
- Store licensing and copyright information from file metadata, if available (#308)
- Add UI elements for multi-disc albums (#631)
- Added alternative funkwhale/all-in-one docker image (#614)
- Broadcast library updates (name, description, visibility) over federation
- Based Docker image on alpine to have a smaller (and faster to build) image
- Improved front-end performance by stripping unused dependencies, reducing bundle size
and enabling gzip compression
- Improved accessibility by using main/section/nav tags and aria-labels in most critical places (#612)
- The progress bar in the player now display loading state / buffer loading (#586)
- Added "type: funkwhale" and "funkwhale-version" in Subsonic responses (#573)
- Documented keyboard shortcuts, list is now available by pressing "h" or in the footer (#611)
- Documented which Subsonic endpoints are implemented (#575)
- Hide invitation code field during signup when it's not required (#410)
- Importer will now pick embedded images in files with OTHER type if no COVER_FRONT is present
- Improved keyboard accessibility on player, queue and various controls (#576)
- Improved performance when listing playable tracks, albums and artists
- Increased default upload limit from 30 to 100MB (#654)
- Load env file in config/.env automatically to avoid sourcing it by hand (#626)
- More resilient date parsing during audio import, will not crash anymore on
invalid dates (#622)
- Now start radios immediatly, skipping any existing tracks in queue (#585)
- Officially support connecting to a password protected redis server, with
the redis://:password@localhost:6379/0 scheme (#640)
- Performance improvement when fetching favorites, down to a single, small http request
- Removed "Activity" page, since all the data is available on the "Browse" page (#600)
- Removed the need to specify the DJANGO_ALLOWED_HOSTS variable
- Restructured the footer, added useful links and removed unused content
- Show short entries first in search results to improve UX
- Store disc number and order tracks by disc number / position) (#507)
- Strip EXIF metadata from uploaded avatars to avoid leaking private data (#374)
- Support blind key rotation in HTTP Signatures (#658)
- Support setting a server URL in settings.json (#650)
- Updated default docker postgres version from 9.4 to 11 (#656)
- Updated lots of dependencies (especially django 2.0->2.1), and removed unused dependencies (#657)
- Improved test suite speed by reducing / disabling expensive operations (#648)
- Fixed parsing of embedded file cover for ogg files tagged with MusicBrainz (#469)
- Upgraded core dependencies to fix websocket/messaging issues and possible memory leaks (#643)
- Fix ".None" extension when downloading Flac file (#473)
- Fixed None extension when downloading an in-place imported file (#621)
- Added a script to prune pre 0.17 federated tracks (#564)
- Advertise public libraries properly in ActivityPub representations (#553)
- Allow opus file upload (#598)
- Do not display "view on MusicBrainz" button if we miss the mbid (#422)
- Do not try to create unaccent extension if it's already present (#663)
- Ensure admin links in sidebar are displayed for users with relavant permissions, and only them (#597)
- Fix broken websocket connexion under Chrome browser (#589)
- Fix play button not starting playback with empty queue (#632)
- Fixed a styling inconsistency on about page when instance description was missing (#659)
- Fixed a UI discrepency in playlist tracks count (#647)
- Fixed greyed tracks in radio builder and detail page (#637)
- Fixed inconsistencies in subsonic error responses (#616)
- Fixed incorrect icon for "next track" in player control (#613)
- Fixed malformed search string when redirecting to LyricsWiki (#608)
- Fixed missing track count on various library cards (#581)
- Fixed skipped track when appending multiple tracks to the queue under certain conditions (#209)
- Fixed wrong album/track count on artist page (#599)
- Hide unplayable/emtpy playlists in "Browse playlist" pages (#424)
- Initial UI render using correct language from browser (#644)
- Invalid URI for reverse proxy websocket with apache (#617)
- Properly encode Wikipedia and lyrics search urls (#470)
- Refresh profile after user settings update to avoid cache issues (#606)
- Use role=button instead of empty links for player controls (#610)
- Deploy documentation from the master branch instead of the develop branch to avoid inconsistencies (#642)
- Document how to find and use library id when importing files in CLI (#562)
- Fix documentation typos (#645)
0.17 (2018-10-07)
......@@ -120,7 +411,7 @@ Then, add the following block at the end of your docker-compose.yml file::
- .env
# Override those variables in your .env file if needed
- "./nginx/funkwhale.template:/etc/nginx/conf.d/funkwhale.template:ro"
- "./nginx/funkwhale_proxy.conf:/etc/nginx/funkwhale_proxy.conf:ro"
......@@ -35,18 +35,20 @@ Setup front-end only development environment
cd funkwhale
cd front
2. Install [nodejs]( and [yarn](
2. Install `nodejs <>`_ and `yarn <>`_
3. Install the dependencies::
yarn install
4. Launch the development server::
# this will serve the front-end on http://localhost:8000
# this will serve the front-end on http://localhost:8000/front/
VUE_PORT=8000 yarn serve
5. Make the front-end talk with an existing server (like,
by clicking on the corresponding link in the footer
6. Start hacking!
Setup your development environment
......@@ -307,7 +309,7 @@ A typical fragment looks like that:
Fixed broken audio player on Chrome 42 for ogg files (#567)
If the work fixes one or more issues, the issue number should be included at the
end of the fragment (``(#567)`` is the issue number in the previous example.
end of the fragment (``(#567)`` is the issue number in the previous example).
If your work is not related to a specific issue, use the merge request
identifier instead, like this:
......@@ -389,7 +391,7 @@ This is regular pytest, so you can use any arguments/options that pytest usually
# Stop on first failure
docker-compose -f dev.yml run --rm api pytest -x
# Run a specific test file
docker-compose -f dev.yml run --rm api pytest tests/
docker-compose -f dev.yml run --rm api pytest tests/music/
Writing tests
......@@ -507,7 +509,7 @@ useful when testing components that depend on each other:
# here, we ensure no email was sent
Views: you can find some readable views tests in :file:`tests/users/`
Views: you can find some readable views tests in file: ``api/tests/users/``
.. note::
FROM python:3.6
FROM alpine:3.8
echo 'installing dependencies' && \
apk add \
bash \
git \
gettext \
musl-dev \
gcc \
postgresql-dev \
python3-dev \
py3-psycopg2 \
py3-pillow \
libldap \
ffmpeg \
libpq \
libmagic \
libffi-dev \
zlib-dev \
openldap-dev && \
ln -s /usr/bin/python3 /usr/bin/python
# Requirements have to be pulled and installed here, otherwise caching won't work
RUN echo 'deb jessie-backports main' > /etc/apt/sources.list.d/ffmpeg.list
COPY ./requirements.apt /requirements.apt
RUN apt-get update; \
grep "^[^#;]" requirements.apt | \
grep -Fv "python3-dev" | \
xargs apt-get install -y --no-install-recommends; \
rm -rf /usr/share/doc/* /usr/share/locale/*
RUN curl -L | tar -xz -C /usr/local/bin --strip 1
RUN mkdir /requirements
COPY ./requirements/base.txt /requirements/base.txt
RUN pip install -r /requirements/base.txt
COPY ./requirements/production.txt /requirements/production.txt
RUN pip install -r /requirements/production.txt
echo 'fixing requirements file for alpine' && \
sed -i '/Pillow/d' /requirements/base.txt && \
echo 'installing pip requirements' && \
pip3 install --no-cache-dir --upgrade pip && \
pip3 install --no-cache-dir setuptools wheel && \
pip3 install --no-cache-dir -r /requirements/base.txt
COPY . /app
# Since youtube-dl code is updated fairly often, we split it here
RUN pip install --upgrade youtube-dl
ARG install_dev_deps=0
COPY ./requirements/*.txt /requirements/
if [ "$install_dev_deps" = "1" ] ; then echo "Installing dev dependencies" && pip3 install --no-cache-dir -r /requirements/local.txt -r /requirements/test.txt ; else echo "Skipping dev deps installation" ; fi
ENTRYPOINT ["./compose/django/"]
CMD ["./compose/django/"]
COPY . /app
#!/bin/bash -eux
python /app/ collectstatic --noinput
/usr/local/bin/daphne -b -p 5000 config.asgi:application --proxy-headers
daphne -b -p 5000 config.asgi:application --proxy-headers
set -e
# This entrypoint is used to play nicely with the current cookiecutter configuration.
# Since docker-compose relies heavily on environment variables itself for configuration, we'd have to define multiple
......@@ -10,7 +10,7 @@ from funkwhale_api.playlists import views as playlists_views
from funkwhale_api.subsonic.views import SubsonicViewSet
router = routers.SimpleRouter()
router.register(r"settings", GlobalPreferencesViewSet, base_name="settings")
router.register(r"settings", GlobalPreferencesViewSet, basename="settings")
router.register(r"activity", activity_views.ActivityViewSet, "activity")
router.register(r"tags", views.TagViewSet, "tags")
router.register(r"tracks", views.TrackViewSet, "tracks")
......@@ -19,6 +19,7 @@ router.register(r"libraries", views.LibraryViewSet, "libraries")
router.register(r"listen", views.ListenViewSet, "listen")
router.register(r"artists", views.ArtistViewSet, "artists")
router.register(r"albums", views.AlbumViewSet, "albums")
router.register(r"licenses", views.LicenseViewSet, "licenses")
router.register(r"playlists", playlists_views.PlaylistViewSet, "playlists")
r"playlist-tracks", playlists_views.PlaylistTrackViewSet, "playlist-tracks"
......@@ -26,10 +27,11 @@ router.register(
v1_patterns = router.urls
subsonic_router = routers.SimpleRouter(trailing_slash=False)
subsonic_router.register(r"subsonic/rest", SubsonicViewSet, base_name="subsonic")
subsonic_router.register(r"subsonic/rest", SubsonicViewSet, basename="subsonic")
v1_patterns += [
url(r"^oembed/$", views.OembedView.as_view(), name="oembed"),
include(("funkwhale_api.instance.urls", "instance"), namespace="instance"),
......@@ -13,7 +13,7 @@ from __future__ import absolute_import, unicode_literals
import datetime
import logging
from urllib.parse import urlparse, urlsplit
from urllib.parse import urlsplit
import environ
from celery.schedules import crontab
......@@ -69,12 +69,23 @@ else:
FUNKWHALE_HOSTNAME = _parsed.netloc
FUNKWHALE_PROTOCOL = _parsed.scheme