Skip to content
Snippets Groups Projects
Verified Commit 6bf73384 authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Merge branch 'release/0.6.1'

parents 37b6dd40 ec3e5a43
No related branches found
No related tags found
No related merge requests found
Showing
with 19452 additions and 18808 deletions
...@@ -20,7 +20,7 @@ services: ...@@ -20,7 +20,7 @@ services:
restart: unless-stopped restart: unless-stopped
image: funkwhale/funkwhale:${FUNKWHALE_VERSION:-latest} image: funkwhale/funkwhale:${FUNKWHALE_VERSION:-latest}
env_file: .env env_file: .env
command: python manage.py celery worker command: celery -A funkwhale_api.taskapp worker -l INFO
links: links:
- postgres - postgres
- redis - redis
......
...@@ -31,7 +31,7 @@ FUNKWHALE_API_PORT=5000 ...@@ -31,7 +31,7 @@ FUNKWHALE_API_PORT=5000
# Replace this by the definitive, public domain you will use for # Replace this by the definitive, public domain you will use for
# your instance # your instance
FUNKWHALE_URL=https.//yourdomain.funwhale FUNKWHALE_URL=https://yourdomain.funwhale
# API/Django configuration # API/Django configuration
......
...@@ -8,7 +8,7 @@ User=funkwhale ...@@ -8,7 +8,7 @@ User=funkwhale
# adapt this depending on the path of your funkwhale installation # adapt this depending on the path of your funkwhale installation
WorkingDirectory=/srv/funkwhale/api WorkingDirectory=/srv/funkwhale/api
EnvironmentFile=/srv/funkwhale/config/.env 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] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target
...@@ -8,7 +8,7 @@ User=funkwhale ...@@ -8,7 +8,7 @@ User=funkwhale
# adapt this depending on the path of your funkwhale installation # adapt this depending on the path of your funkwhale installation
WorkingDirectory=/srv/funkwhale/api WorkingDirectory=/srv/funkwhale/api
EnvironmentFile=/srv/funkwhale/config/.env 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] [Install]
WantedBy=multi-user.target 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 { ...@@ -48,20 +48,6 @@ server {
root /srv/funkwhale/front/dist; 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 / { location / {
try_files $uri $uri/ @rewrites; try_files $uri $uri/ @rewrites;
} }
...@@ -70,6 +56,7 @@ server { ...@@ -70,6 +56,7 @@ server {
rewrite ^(.+)$ /index.html last; rewrite ^(.+)$ /index.html last;
} }
location /api/ { location /api/ {
include /etc/nginx/funkwhale_proxy.conf;
# this is needed if you have file import via upload enabled # this is needed if you have file import via upload enabled
client_max_body_size 30M; client_max_body_size 30M;
proxy_pass http://funkwhale-api/api/; proxy_pass http://funkwhale-api/api/;
...@@ -89,6 +76,7 @@ server { ...@@ -89,6 +76,7 @@ server {
# Transcoding logic and caching # Transcoding logic and caching
location = /transcode-auth { location = /transcode-auth {
include /etc/nginx/funkwhale_proxy.conf;
# needed so we can authenticate transcode requests, but still # needed so we can authenticate transcode requests, but still
# cache the result # cache the result
internal; internal;
...@@ -97,14 +85,13 @@ server { ...@@ -97,14 +85,13 @@ server {
if ($request_uri ~* "[^\?]+\?(.*)$") { if ($request_uri ~* "[^\?]+\?(.*)$") {
set $query $1; 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 http://funkwhale-api/api/v1/trackfiles/viewable/?$query;
proxy_pass_request_body off; proxy_pass_request_body off;
proxy_set_header Content-Length ""; proxy_set_header Content-Length "";
} }
location /api/v1/trackfiles/transcode/ { location /api/v1/trackfiles/transcode/ {
include /etc/nginx/funkwhale_proxy.conf;
# this block deals with authenticating and caching transcoding # this block deals with authenticating and caching transcoding
# requests. Caching is heavily recommended as transcoding # requests. Caching is heavily recommended as transcoding
# is a CPU intensive process. # 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: ...@@ -25,6 +25,10 @@ to the ``/music`` directory on the container:
For the best results, we recommand tagging your music collection through For the best results, we recommand tagging your music collection through
`Picard <http://picard.musicbrainz.org/>`_ in order to have the best quality metadata. `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:: .. note::
......
...@@ -13,6 +13,7 @@ Funkwhale is a self-hosted, modern free and open-source music server, heavily in ...@@ -13,6 +13,7 @@ Funkwhale is a self-hosted, modern free and open-source music server, heavily in
features features
installation/index installation/index
configuration
importing-music importing-music
changelog changelog
......
...@@ -43,6 +43,15 @@ you should now be able to open a postgresql shell: ...@@ -43,6 +43,15 @@ you should now be able to open a postgresql shell:
sudo -u funkwhale -H psql 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) Cache setup (Redis)
------------------- -------------------
......
...@@ -59,10 +59,11 @@ Ensure you have a recent version of nginx on your server. On debian-like system, ...@@ -59,10 +59,11 @@ Ensure you have a recent version of nginx on your server. On debian-like system,
apt-get update apt-get update
apt-get install nginx apt-get install nginx
Then, download our sample virtualhost file: Then, download our sample virtualhost file and proxy conf:
.. parsed-literal:: .. 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" 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``. 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> <template>
<div class="ui pagination borderless menu"> <div class="ui pagination borderless menu">
<a
@click="selectPage(1)"
:class="[{'disabled': current === 1}, 'item']"><i class="angle double left icon"></i></a>
<a <a
@click="selectPage(current - 1)" @click="selectPage(current - 1)"
:class="[{'disabled': current - 1 < 1}, 'item']"><i class="angle left icon"></i></a> :class="[{'disabled': current - 1 < 1}, 'item']"><i class="angle left icon"></i></a>
<template>
<a <a
v-if="page !== 'skip'"
v-for="page in pages" v-for="page in pages"
@click="selectPage(page)" @click="selectPage(page)"
:class="[{'active': page === current}, 'item']"> :class="[{'active': page === current}, 'item']">
{{ page }} {{ page }}
</a> </a>
<a v-else class="disabled item">
...
</a>
</template>
<a <a
@click="selectPage(current + 1)" @click="selectPage(current + 1)"
:class="[{'disabled': current + 1 > maxPage}, 'item']"><i class="angle right icon"></i></a> :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> </div>
</template> </template>
...@@ -32,7 +32,38 @@ export default { ...@@ -32,7 +32,38 @@ export default {
}, },
computed: { computed: {
pages: function () { 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 () { maxPage: function () {
return Math.ceil(this.total / this.paginateBy) return Math.ceil(this.total / this.paginateBy)
......
<template> <template>
<div :class="['ui', {'tiny': discrete}, 'buttons']"> <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> <i class="ui play icon"></i>
<template v-if="!discrete"><slot>Play</slot></template> <template v-if="!discrete"><slot>Play</slot></template>
</button> </button>
...@@ -26,6 +29,11 @@ export default { ...@@ -26,6 +29,11 @@ export default {
track: {type: Object, required: false}, track: {type: Object, required: false},
discrete: {type: Boolean, default: false} discrete: {type: Boolean, default: false}
}, },
data () {
return {
isLoading: false
}
},
created () { created () {
if (!this.track & !this.tracks) { if (!this.track & !this.tracks) {
logger.default.error('You have to provide either a track or tracks property') logger.default.error('You have to provide either a track or tracks property')
...@@ -50,10 +58,19 @@ export default { ...@@ -50,10 +58,19 @@ export default {
} }
}, },
methods: { methods: {
triggerLoad () {
let self = this
this.isLoading = true
setTimeout(() => {
self.isLoading = false
}, 500)
},
add () { add () {
this.triggerLoad()
this.$store.dispatch('queue/appendMany', {tracks: this.playableTracks}) this.$store.dispatch('queue/appendMany', {tracks: this.playableTracks})
}, },
addNext (next) { addNext (next) {
this.triggerLoad()
this.$store.dispatch('queue/appendMany', {tracks: this.playableTracks, index: this.$store.state.queue.currentIndex + 1}) this.$store.dispatch('queue/appendMany', {tracks: this.playableTracks, index: this.$store.state.queue.currentIndex + 1})
if (next) { if (next) {
this.$store.dispatch('queue/next') this.$store.dispatch('queue/next')
......
This diff is collapsed.
No preview for this file type
This diff is collapsed.
No preview for this file type
No preview for this file type
No preview for this file type
File mode changed from 100755 to 100644
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment