fix: timeout on spa manifest requests

The previous behaviour had a loop of requests between the front
app and the api when querying the pwa manifest.

This reduce the coupling around the pwa manifest file between the api
and the front app, by uplicating the files so each "service" has a copy
of it, while keeping them in sync and having the front pwa manifest as
single source of truth.

Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2291>
This commit is contained in:
jo 2022-12-17 18:21:41 +01:00
commit b359bb6498
9 changed files with 152 additions and 81 deletions

View file

@ -5,6 +5,8 @@ import VueI18n from '@intlify/vite-plugin-vue-i18n'
import { VitePWA } from 'vite-plugin-pwa'
import { resolve } from 'path'
import manifest from './pwa-manifest.json'
const port = +(process.env.VUE_PORT ?? 8080)
// https://vitejs.dev/config/
@ -35,56 +37,7 @@ export default defineConfig(({ mode }) => ({
type: 'module',
navigateFallback: 'index.html'
},
manifest: {
name: 'Funkwhale',
categories: ['music', 'entertainment'],
start_url: undefined,
scope: undefined,
short_name: 'Funkwhale',
description: 'Your free and federated audio platform',
icons: [
{
src: 'android-chrome-192x192.png',
sizes: '192x192',
type: 'image/png'
},
{
src: 'android-chrome-512x512.png',
sizes: '512x512',
type: 'image/png'
}
],
prefer_related_applications: true,
related_applications: [
{
platform: 'play',
url: 'https://play.google.com/store/apps/details?id=audio.funkwhale.ffa',
id: 'audio.funkwhale.ffa'
},
{
platform: 'f-droid',
url: 'https://f-droid.org/en/packages/audio.funkwhale.ffa/',
id: 'audio.funkwhale.ffa'
}
],
shortcuts: [
{
name: 'Search',
url: '/search',
icons: []
},
{
name: 'Library',
url: '/library',
icons: []
},
{
name: 'Channels',
url: '/subscriptions',
icons: []
}
]
}
manifest
})
],
server: {