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

Fixed broken urls in manifest.json

parent ef6219e8
No related branches found
No related tags found
No related merge requests found
...@@ -10,6 +10,7 @@ from rest_framework.response import Response ...@@ -10,6 +10,7 @@ from rest_framework.response import Response
from funkwhale_api.common import middleware from funkwhale_api.common import middleware
from funkwhale_api.common import preferences from funkwhale_api.common import preferences
from funkwhale_api.federation import utils as federation_utils
from funkwhale_api.users.oauth import permissions as oauth_permissions from funkwhale_api.users.oauth import permissions as oauth_permissions
from . import nodeinfo from . import nodeinfo
...@@ -57,6 +58,7 @@ class SpaManifest(views.APIView): ...@@ -57,6 +58,7 @@ class SpaManifest(views.APIView):
) )
parsed_manifest = json.loads(existing_manifest) parsed_manifest = json.loads(existing_manifest)
parsed_manifest["short_name"] = settings.APP_NAME parsed_manifest["short_name"] = settings.APP_NAME
parsed_manifest["start_url"] = federation_utils.full_url("/")
instance_name = preferences.get("instance__name") instance_name = preferences.get("instance__name")
if instance_name: if instance_name:
parsed_manifest["short_name"] = instance_name parsed_manifest["short_name"] = instance_name
......
...@@ -2,6 +2,8 @@ import json ...@@ -2,6 +2,8 @@ import json
from django.urls import reverse from django.urls import reverse
from funkwhale_api.federation import utils as federation_utils
def test_nodeinfo_endpoint(db, api_client, mocker): def test_nodeinfo_endpoint(db, api_client, mocker):
payload = {"test": "test"} payload = {"test": "test"}
...@@ -54,6 +56,7 @@ def test_manifest_endpoint(api_client, mocker, preferences, tmp_path, settings): ...@@ -54,6 +56,7 @@ def test_manifest_endpoint(api_client, mocker, preferences, tmp_path, settings):
"name": "Test pod", "name": "Test pod",
"short_name": "Test pod", "short_name": "Test pod",
"description": "Test description", "description": "Test description",
"start_url": federation_utils.full_url("/"),
} }
manifest.write_bytes(json.dumps(base_payload).encode()) manifest.write_bytes(json.dumps(base_payload).encode())
......
const baseUrl = process.env.BASE_URL || '/front/'
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const webpack = require('webpack'); const webpack = require('webpack');
...@@ -30,7 +31,7 @@ plugins.push( ...@@ -30,7 +31,7 @@ plugins.push(
}), }),
) )
module.exports = { module.exports = {
baseUrl: process.env.BASE_URL || '/front/', baseUrl: baseUrl,
productionSourceMap: false, productionSourceMap: false,
// Add settings for manifest file // Add settings for manifest file
pwa: { pwa: {
...@@ -48,11 +49,11 @@ module.exports = { ...@@ -48,11 +49,11 @@ module.exports = {
categories: ["music"], categories: ["music"],
icons: [ icons: [
{ {
'src': 'favicon.png', 'src': baseUrl + 'favicon.png',
'sizes': '192x192', 'sizes': '192x192',
'type': 'image/png' 'type': 'image/png'
}, { }, {
'src': 'favicon.png', 'src': baseUrl + 'favicon.png',
'sizes': '512x512', 'sizes': '512x512',
'type': 'image/png' 'type': 'image/png'
}, },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment