Verified Commit 6bf73384 authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Merge branch 'release/0.6.1'

parents 37b6dd40 ec3e5a43
......@@ -20,7 +20,7 @@ services:
restart: unless-stopped
image: funkwhale/funkwhale:${FUNKWHALE_VERSION:-latest}
env_file: .env
command: python manage.py celery worker
command: celery -A funkwhale_api.taskapp worker -l INFO
links:
- postgres
- redis
......
......@@ -31,7 +31,7 @@ FUNKWHALE_API_PORT=5000
# Replace this by the definitive, public domain you will use for
# your instance
FUNKWHALE_URL=https.//yourdomain.funwhale
FUNKWHALE_URL=https://yourdomain.funwhale
# API/Django configuration
......
......@@ -8,7 +8,7 @@ User=funkwhale
# adapt this depending on the path of your funkwhale installation
WorkingDirectory=/srv/funkwhale/api
EnvironmentFile=/srv/funkwhale/config/.env
ExecStart=/usr/local/bin/daphne -b ${FUNKWHALE_API_IP} -p ${FUNKWHALE_API_PORT} config.asgi:application
ExecStart=/srv/funkwhale/virtualenv/bin/daphne -b ${FUNKWHALE_API_IP} -p ${FUNKWHALE_API_PORT} config.asgi:application
[Install]
WantedBy=multi-user.target
......@@ -8,7 +8,7 @@ User=funkwhale
# adapt this depending on the path of your funkwhale installation
WorkingDirectory=/srv/funkwhale/api
EnvironmentFile=/srv/funkwhale/config/.env
ExecStart=/srv/funkwhale/virtualenv/bin/python manage.py celery worker
ExecStart=/srv/funkwhale/virtualenv/bin/celery -A funkwhale_api.taskapp worker -l INFO
[Install]
WantedBy=multi-user.target
# global proxy conf
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Port $server_port;
proxy_redirect off;
# websocket support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
......@@ -48,20 +48,6 @@ server {
root /srv/funkwhale/front/dist;
# global proxy conf
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Port $server_port;
proxy_redirect off;
# websocket support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
location / {
try_files $uri $uri/ @rewrites;
}
......@@ -70,6 +56,7 @@ server {
rewrite ^(.+)$ /index.html last;
}
location /api/ {
include /etc/nginx/funkwhale_proxy.conf;
# this is needed if you have file import via upload enabled
client_max_body_size 30M;
proxy_pass http://funkwhale-api/api/;
......@@ -89,6 +76,7 @@ server {
# Transcoding logic and caching
location = /transcode-auth {
include /etc/nginx/funkwhale_proxy.conf;
# needed so we can authenticate transcode requests, but still
# cache the result
internal;
......@@ -97,14 +85,13 @@ server {
if ($request_uri ~* "[^\?]+\?(.*)$") {
set $query $1;
}
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Port $server_port;
proxy_pass http://funkwhale-api/api/v1/trackfiles/viewable/?$query;
proxy_pass_request_body off;
proxy_set_header Content-Length "";
}
location /api/v1/trackfiles/transcode/ {
include /etc/nginx/funkwhale_proxy.conf;
# this block deals with authenticating and caching transcoding
# requests. Caching is heavily recommended as transcoding
# is a CPU intensive process.
......
Instance configuration
======================
General configuration is achieved using two type of settings.
Environment variables
---------------------
Those are located in your ``.env`` file, which you should have created
during installation.
Options from this file are heavily commented, and usually target lower level
and technical aspects of your instance, such as database credentials.
.. note::
You should restart all funwhale processes when you change the values
on environment variables.
Instance settings
-----------------
Those settings are stored in database and do not require a restart of your
instance after modification. They typically relate to higher level configuration,
such your instance description, signup policy and so on.
There is no polished interface for those settings, yet, but you can view update
them using the administration interface provided by Django (the framework funkwhale is built on).
The URL should be ``/api/admin/dynamic_preferences/globalpreferencemodel/`` (prepend your domain in front of it, of course).
If you plan to use acoustid and external imports
(e.g. with the youtube backends), you should edit the corresponding
settings in this interface.
......@@ -25,6 +25,10 @@ to the ``/music`` directory on the container:
For the best results, we recommand tagging your music collection through
`Picard <http://picard.musicbrainz.org/>`_ in order to have the best quality metadata.
.. note::
Autotagging using acoustid is experimental now and can yield unexpected
result. You can disable acoustid by passing the --no-acoustid flag.
.. note::
......
......@@ -13,6 +13,7 @@ Funkwhale is a self-hosted, modern free and open-source music server, heavily in
features
installation/index
configuration
importing-music
changelog
......
......@@ -43,6 +43,15 @@ you should now be able to open a postgresql shell:
sudo -u funkwhale -H psql
Unless you give a superuser access to the database user, you should also
enable some extensions on your database server, as those are required
for funkwhale to work properly:
.. code-block:: shell
sudo -u postgres psql -c 'CREATE EXTENSION "unaccent";''
Cache setup (Redis)
-------------------
......
......@@ -59,10 +59,11 @@ Ensure you have a recent version of nginx on your server. On debian-like system,
apt-get update
apt-get install nginx
Then, download our sample virtualhost file:
Then, download our sample virtualhost file and proxy conf:
.. parsed-literal::
curl -L -o /etc/nginx/funkwhale_proxy.conf "https://code.eliotberriot.com/funkwhale/funkwhale/raw/|version|/deploy/funkwhale_proxy.conf"
curl -L -o /etc/nginx/sites-enabled/funkwhale.conf "https://code.eliotberriot.com/funkwhale/funkwhale/raw/|version|/deploy/nginx.conf"
Ensure static assets and proxy pass match your configuration, and check the configuration is valid with ``nginx -t``. If everything is fine, you can restart your nginx server with ``service nginx restart``.
<template>
<div class="ui pagination borderless menu">
<a
@click="selectPage(1)"
:class="[{'disabled': current === 1}, 'item']"><i class="angle double left icon"></i></a>
<a
@click="selectPage(current - 1)"
:class="[{'disabled': current - 1 < 1}, 'item']"><i class="angle left icon"></i></a>
<a
v-for="page in pages"
@click="selectPage(page)"
:class="[{'active': page === current}, 'item']">
{{ page }}
</a>
<template>
<a
v-if="page !== 'skip'"
v-for="page in pages"
@click="selectPage(page)"
:class="[{'active': page === current}, 'item']">
{{ page }}
</a>
<a v-else class="disabled item">
...
</a>
</template>
<a
@click="selectPage(current + 1)"
:class="[{'disabled': current + 1 > maxPage}, 'item']"><i class="angle right icon"></i></a>
<a
@click="selectPage(maxPage)"
:class="[{'disabled': current === maxPage}, 'item']"><i class="angle double right icon"></i></a>
</div>
</template>
......@@ -32,7 +32,38 @@ export default {
},
computed: {
pages: function () {
return _.range(1, this.maxPage + 1)
let range = 2
let current = this.current
let beginning = _.range(1, Math.min(this.maxPage, 1 + range))
let middle = _.range(Math.max(1, current - range + 1), Math.min(this.maxPage, current + range))
let end = _.range(this.maxPage, Math.max(1, this.maxPage - range))
let allowed = beginning.concat(middle, end)
allowed = _.uniq(allowed)
allowed = _.sortBy(allowed, [(e) => { return e }])
let final = []
allowed.forEach(p => {
let last = final.slice(-1)[0]
let consecutive = true
if (last === 'skip') {
consecutive = false
} else {
if (!last) {
consecutive = true
} else {
consecutive = last + 1 === p
}
}
if (consecutive) {
final.push(p)
} else {
if (p !== 'skip') {
final.push('skip')
final.push(p)
}
}
})
console.log(final)
return final
},
maxPage: function () {
return Math.ceil(this.total / this.paginateBy)
......
<template>
<div :class="['ui', {'tiny': discrete}, 'buttons']">
<button title="Add to current queue" @click="add" :class="['ui', {'mini': discrete}, {disabled: playableTracks.length === 0}, 'button']">
<button
title="Add to current queue"
@click="add"
:class="['ui', {loading: isLoading}, {'mini': discrete}, {disabled: playableTracks.length === 0}, 'button']">
<i class="ui play icon"></i>
<template v-if="!discrete"><slot>Play</slot></template>
</button>
......@@ -26,6 +29,11 @@ export default {
track: {type: Object, required: false},
discrete: {type: Boolean, default: false}
},
data () {
return {
isLoading: false
}
},
created () {
if (!this.track & !this.tracks) {
logger.default.error('You have to provide either a track or tracks property')
......@@ -50,10 +58,19 @@ export default {
}
},
methods: {
triggerLoad () {
let self = this
this.isLoading = true
setTimeout(() => {
self.isLoading = false
}, 500)
},
add () {
this.triggerLoad()
this.$store.dispatch('queue/appendMany', {tracks: this.playableTracks})
},
addNext (next) {
this.triggerLoad()
this.$store.dispatch('queue/appendMany', {tracks: this.playableTracks, index: this.$store.state.queue.currentIndex + 1})
if (next) {
this.$store.dispatch('queue/next')
......
This diff is collapsed.
File mode changed from 100755 to 100644
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