Verified Commit 75c12de7 authored by Jeff's avatar Jeff
Browse files
parents 8259080e 4a336a0c
Pipeline #15583 failed with stages
in 1 minute and 46 seconds
......@@ -117,6 +117,24 @@ flake8:
paths:
- "$PIP_CACHE_DIR"
eslint:
interruptible: true
image: node:12-buster
stage: lint
allow_failure: true
before_script:
- cd front
- yarn install
script:
# We search for all files ending with .vue or .js in src which changed in relation to develop
# and lint them. This way we focus on some errors instead of checking the hole repository
- export changedFiles=$(git diff --relative --name-only --diff-filter=d origin/develop -- src/ | grep -E "\.(vue|js)$")
- yarn run eslint --quiet -f table $changedFiles
cache:
key: "$CI_PROJECT_ID__eslint_npm_cache"
paths:
- front/node_modules
test_api:
interruptible: true
services:
......@@ -208,6 +226,7 @@ build_backend:
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script:
- docker system prune -af
- cd api
- docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME .
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
......@@ -247,10 +266,13 @@ docker_release:
- (if [ "$CI_COMMIT_REF_NAME" == "develop" ] || [ "$CI_COMMIT_REF_NAME" == "master" ]; then ./scripts/set-api-build-metadata.sh $(echo $CI_COMMIT_SHA | cut -c 1-8); fi);
script:
- if [[ ! -z "$CI_COMMIT_TAG" ]]; then (./docs/get-releases-json.py | scripts/is-docker-latest.py $CI_COMMIT_TAG -) && export DOCKER_LATEST_TAG="-t $IMAGE_LATEST" || export DOCKER_LATEST_TAG=; fi
- if [[ "$CI_COMMIT_REF_NAME" =~ ^[0-9]+(.[0-9]+){1,2}$ ]]; then export stable=1 && export major="$(echo $CI_COMMIT_REF_NAME | cut -d '.' -f 1)" && export minor="$(echo $CI_COMMIT_REF_NAME | cut -d '.' -f 1,2)"; fi
- cd api
- docker build -t $IMAGE $DOCKER_LATEST_TAG .
- docker push $IMAGE
- if [[ ! -z "$DOCKER_LATEST_TAG" ]]; then docker push $IMAGE_LATEST; fi
- if [[ $stable == 1 ]]; then docker tag $IMAGE $IMAGE_NAME:$major && docker push $IMAGE_NAME:$major; fi
- if [[ $stable == 1 ]]; then docker tag $IMAGE $IMAGE_NAME:$minor && docker push $IMAGE_NAME:$minor; fi
only:
- develop@funkwhale/funkwhale
- master@funkwhale/funkwhale
......
......@@ -10,6 +10,23 @@ This changelog is viewable on the web at https://docs.funkwhale.audio/changelog.
.. towncrier
1.1.3 (unreleased)
Upgrade instructions are available at
https://docs.funkwhale.audio/admin/upgrading.html
Enhancements:
- Test better tagging of Docker Images (#1505)
Bugfixes:
- Fix the scrobbler plugin submitting literal "None" as MusicBrainz ID (#1498)
- Add worker-src to nginx header to prevent issues (#1489)
- Only suggest typed tag once if it already exists
- Implement access control on the moderation views (#1494)
- Prevent open redirect on login (#1492)
1.1.2 (2021-05-19)
------------------
......
......@@ -8,7 +8,9 @@ application = ProtocolTypeRouter(
{
# Empty for now (http->django views is added by default)
"websocket": AuthMiddlewareStack(
URLRouter([url("^api/v1/activity$", consumers.InstanceActivityConsumer)])
URLRouter(
[url("^api/v1/activity$", consumers.InstanceActivityConsumer.as_asgi())]
)
)
}
)
# -*- coding: utf-8 -*-
__version__ = "1.1.2"
__version__ = "1.1.3"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
......
......@@ -17,6 +17,7 @@ class PodcastRSSRenderer(renderers.JSONRenderer):
"version": "2.0",
"xmlns:atom": "http://www.w3.org/2005/Atom",
"xmlns:itunes": "http://www.itunes.com/dtds/podcast-1.0.dtd",
"xmlns:content": "http://purl.org/rss/1.0/modules/content/",
"xmlns:media": "http://search.yahoo.com/mrss/",
}
final.update(data)
......
django~=3.2.3
setuptools~=56.2.0
setuptools~=57.1.0
# Configuration
django-environ~=0.4.0
# Images
Pillow~=8.2.0
Pillow~=8.3.0
django-allauth~=0.42.0
......@@ -26,17 +26,17 @@ musicbrainzngs~=0.7.1
djangorestframework~=3.12.2
arrow~=1.1.0
persisting-theory~=0.2.0
django-versatileimagefield~=2.0.0
django-versatileimagefield~=2.1.0
django-filter~=2.4.0
django-rest-auth~=0.9.0
ipython~=7.23.1
ipython~=7.25.0
mutagen~=1.45.0
pymemoize~=1.0.0
django-dynamic-preferences~=1.10
python-magic~=0.4.0
channels~=2.4.0
channels~=3.0.3
channels_redis~=3.3.0
uvicorn[standard]~=0.14.0
gunicorn~=20.1.0
......@@ -71,5 +71,4 @@ feedparser~=6.0.0
watchdog~=2.1.2
## Pin third party dependency to avoid issue with latest version
twisted==20.3.0
asgiref==3.3.4
......@@ -8,5 +8,6 @@ pytest-env~=0.6.0
pytest-mock~=3.6.0
pytest-randomly~=3.8.0
pytest-sugar~=0.9.0
pytest-asyncio~=0.15.1
requests-mock~=1.9.0
faker~=8.9.1
from funkwhale_api.common import consumers
import pytest
from channels.testing import WebsocketCommunicator
from funkwhale_api.common.consumers import JsonAuthConsumer
def test_auth_consumer_requires_valid_user(mocker):
m = mocker.patch("funkwhale_api.common.consumers.JsonAuthConsumer.close")
scope = {"user": None}
consumer = consumers.JsonAuthConsumer(scope=scope)
consumer.connect()
m.assert_called_once_with()
@pytest.mark.asyncio
async def test_auth_consumer_requires_valid_user():
communicator = WebsocketCommunicator(JsonAuthConsumer.as_asgi(), "api/v1/activity")
communicator.scope["user"] = None
connected, subprotocol = await communicator.connect()
assert not connected
def test_auth_consumer_requires_user_in_scope(mocker):
m = mocker.patch("funkwhale_api.common.consumers.JsonAuthConsumer.close")
scope = {}
consumer = consumers.JsonAuthConsumer(scope=scope)
consumer.connect()
m.assert_called_once_with()
def test_auth_consumer_accepts_connection(mocker, factories):
user = factories["users.User"]()
m = mocker.patch("funkwhale_api.common.consumers.JsonAuthConsumer.accept")
scope = {"user": user}
consumer = consumers.JsonAuthConsumer(scope=scope)
consumer.connect()
m.assert_called_once_with()
@pytest.mark.asyncio
async def test_auth_consumer_requires_user_in_scope():
communicator = WebsocketCommunicator(JsonAuthConsumer.as_asgi(), "api/v1/activity")
connected, subprotocol = await communicator.connect()
assert not connected
Partially fixed playing two tracks at same time (#1213)
Fix federation issues by increasing FUNKWHALE_WEB_WORKERS (#1303)
Add xmlns:content to feed schemas fixes #1535
Use global Howler volume instead of setting it separatly for each track (fixes #1542)
Store volume in logarithmic scale and convert when setting it to audio (fixes #1543)
Changed volume dynamic range from 60dB to 40dB (fixes #1544)
Document location of cli env file on macOS (\!1354)
\ No newline at end of file
......@@ -43,12 +43,21 @@ FUNKWHALE_WEB_WORKERS=4
FUNKWHALE_HOSTNAME=yourdomain.funkwhale
FUNKWHALE_PROTOCOL=https
# Log level (debug, info, warning, error, critical)
LOGLEVEL=error
# Configure e-mail sending using this variale
# By default, funkwhale will output e-mails sent to stdout
# here are a few examples for this setting
# EMAIL_CONFIG=consolemail:// # output e-mails to console (the default)
# EMAIL_CONFIG=dummymail:// # disable e-mail sending completely
# On a production instance, you'll usually want to use an external SMTP server:
# If `user` or `password` contain special characters (eg.
# `noreply@youremail.host` as `user`), be sure to urlencode them, using
# for example the command:
# `python3 -c 'import urllib.parse; print(urllib.parse.quote_plus
# ("noreply@youremail.host"))'`
# (returns `noreply%40youremail.host`)
# EMAIL_CONFIG=smtp://user@:password@youremail.host:25
# EMAIL_CONFIG=smtp+ssl://user@:password@youremail.host:465
# EMAIL_CONFIG=smtp+tls://user@:password@youremail.host:587
......
......@@ -63,10 +63,32 @@ by hand (which is outside the scope of this guide).
At the moment, we do not support S3 when using Apache as a reverse proxy.
.. note::
If you are attempting to integrate your docker deployment with an existing nginx webserver,
such as the one provided by `linuxserver/swag <https://docs.linuxserver.io/images/docker-swag>`_
(formerly `linuxserver/letsencrypt <https://docs.linuxserver.io/images/docker-swag#migrating-from-the-old-linuxserver-letsencrypt-image>`_),
you may run into an issue where an additional ``Content-Security-Policy`` header appears in responses from the server,
without the newly included S3 URL values.
In this case, you can suppress the extraneous ``Content-Security-Policy`` header by specifying it in a ``proxy_hide_header``
`directive <http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_hide_header>`_ in the ``location /`` block.
.. code-block:: shell
location / {
proxy_pass http://funkwhale:80;
# ...
# ... include the rest of the preset directives
# ...
proxy_hide_header Content-Security-Policy;
}
Serving audio files directly from the bucket
********************************************
Depending on your setup, you may want to serve audio fils directly from the S3 bucket
Depending on your setup, you may want to serve audio files directly from the S3 bucket
instead of proxying them through Funkwhale, e.g to reduce the bandwidth consumption on your server,
or get better performance.
......
......@@ -28,6 +28,11 @@ Each category comes with its own set of diagnose tools and/or commands we will d
steps for each type of problem. Please try those to see if it fix your issues. If none of those works, please report your issue on our
issue tracker.
.. note::
To get detailed log messages, set the environment variable ``LOGLEVEL=debug``.
If you are using the docker setup you can configure this in the ``.env`` file.
Backend issues
^^^^^^^^^^^^^^
......@@ -136,7 +141,7 @@ Report an issue or get help
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Well be more than happy to help you to debug installation and configuration issues. The main channel
for receiving support about your Funkwhale installation is the `#funkwhale-troubleshooting:matrix.org <https://riot.im/app/#/room/#funkwhale-troubleshooting:matrix.org>`_ Matrix channel.
for receiving support about your Funkwhale installation is the `#funkwhale-troubleshooting:matrix.org <https://matrix.to/#/#funkwhale-troubleshooting:matrix.org>`_ Matrix channel.
Before asking for help, we'd really appreciate if you took the time to go through this document and try to diagnose the problem yourself. But if you don't find
anything relevant or don't have the time, we'll be there for you!
......
......@@ -24,5 +24,5 @@ If you're not comfortable with writing documents or don't feel like you can, you
by requesting a document be written. There are three ways to request new documents:
- Open a new issue on `Gitlab <https://dev.funkwhale.audio/funkwhale/funkwhale/issues>`_, providing as much detail as possible
- Start a new thread on `the forum <https://governance.funkwhale.audio/g/kQgxNq15/funkwhale>`_ with more details about your requests
- Ask somebody on our `chat room <https://riot.im/app/#/room/#funkwhale:matrix.org>`_
- Start a new thread on `the forum <https://forum.funkwhale.audio/>`_ with more details about your requests
- Ask somebody on our `chat room <https://matrix.to/#/#funkwhale:matrix.org>`_
......@@ -87,7 +87,7 @@ To work, the CLI needs to be pointed to a Funkwhale server. This can be done in
Env file
^^^^^^^^
The CLI will try to read configuration options from a ``.env`` file in the current directory, or from ``~/.config/funkwhale/env``.
The CLI will try to read configuration options from a ``.env`` file in the current directory. If this file is not present, it will read the configuration options from ``~/.config/funkwhale/env`` on Linux or ``~/Library/Application Support/funkwhale/env`` on macOS.
You can also give it a path to another env file via the ``-e /path/to/.envfile`` flag or the ``ENV_FILE`` environment variable.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment