diff --git a/api/funkwhale_api/instance/views.py b/api/funkwhale_api/instance/views.py index 0c88bd455..7117d1a14 100644 --- a/api/funkwhale_api/instance/views.py +++ b/api/funkwhale_api/instance/views.py @@ -10,6 +10,7 @@ from rest_framework.response import Response from funkwhale_api.common import middleware 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 . import nodeinfo @@ -57,6 +58,7 @@ class SpaManifest(views.APIView): ) parsed_manifest = json.loads(existing_manifest) parsed_manifest["short_name"] = settings.APP_NAME + parsed_manifest["start_url"] = federation_utils.full_url("/") instance_name = preferences.get("instance__name") if instance_name: parsed_manifest["short_name"] = instance_name diff --git a/api/tests/instance/test_views.py b/api/tests/instance/test_views.py index 1ef122ea6..4bc9c296a 100644 --- a/api/tests/instance/test_views.py +++ b/api/tests/instance/test_views.py @@ -2,6 +2,8 @@ import json from django.urls import reverse +from funkwhale_api.federation import utils as federation_utils + def test_nodeinfo_endpoint(db, api_client, mocker): payload = {"test": "test"} @@ -54,6 +56,7 @@ def test_manifest_endpoint(api_client, mocker, preferences, tmp_path, settings): "name": "Test pod", "short_name": "Test pod", "description": "Test description", + "start_url": federation_utils.full_url("/"), } manifest.write_bytes(json.dumps(base_payload).encode()) diff --git a/front/vue.config.js b/front/vue.config.js index 8ee1b27e8..9fcae743c 100644 --- a/front/vue.config.js +++ b/front/vue.config.js @@ -1,3 +1,4 @@ +const baseUrl = process.env.BASE_URL || '/front/' const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; const webpack = require('webpack'); @@ -30,7 +31,7 @@ plugins.push( }), ) module.exports = { - baseUrl: process.env.BASE_URL || '/front/', + baseUrl: baseUrl, productionSourceMap: false, // Add settings for manifest file pwa: { @@ -48,11 +49,11 @@ module.exports = { categories: ["music"], icons: [ { - 'src': 'favicon.png', + 'src': baseUrl + 'favicon.png', 'sizes': '192x192', 'type': 'image/png' }, { - 'src': 'favicon.png', + 'src': baseUrl + 'favicon.png', 'sizes': '512x512', 'type': 'image/png' },