From 41f944f811bd64f3b6933b0fe8168094bb589581 Mon Sep 17 00:00:00 2001 From: josedario87 Date: Fri, 17 Oct 2025 02:14:17 -0600 Subject: [PATCH] =?UTF-8?q?Implementar=20link=20handling=20y=20asociaci?= =?UTF-8?q?=C3=B3n=20con=20PWA=20hub?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Agregar capture_links en manifest para mejorar experiencia PWA - Crear archivo .well-known para asociación con inicio.nucleoriofrio.com - Configurar Traefik para servir .well-known sin autenticación --- docker-compose.yml | 3 ++- nuxt.config.ts | 2 ++ public/.well-known/web-app-origin-association | 10 ++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 public/.well-known/web-app-origin-association diff --git a/docker-compose.yml b/docker-compose.yml index 636b9ba..484ef1a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -20,8 +20,9 @@ services: # Router público para recursos PWA ESTÁTICOS (sin autenticación) # IMPORTANTE: Solo assets estáticos (JS, CSS, iconos, manifest, SW) # Las APIs (/api/*) NO están aquí - están protegidas abajo + # Incluye .well-known para scope extensions # ========================================== - - "traefik.http.routers.musica-nucleoriofrio-public.rule=Host(`musica.nucleoriofrio.com`) && (PathPrefix(`/_nuxt`) || PathPrefix(`/assets`) || Path(`/sw.js`) || PathPrefix(`/workbox-`) || Path(`/manifest.webmanifest`) || Path(`/manifest.json`) || Path(`/robots.txt`) || Path(`/favicon.ico`) || Path(`/logo.png`) || Path(`/logo-192.png`) || Path(`/logo-512.png`) || Path(`/logo-maskable-512.png`) || Path(`/icon.svg`)) && !PathPrefix(`/api/`)" + - "traefik.http.routers.musica-nucleoriofrio-public.rule=Host(`musica.nucleoriofrio.com`) && (PathPrefix(`/_nuxt`) || PathPrefix(`/assets`) || PathPrefix(`/.well-known`) || Path(`/sw.js`) || PathPrefix(`/workbox-`) || Path(`/manifest.webmanifest`) || Path(`/manifest.json`) || Path(`/robots.txt`) || Path(`/favicon.ico`) || Path(`/logo.png`) || Path(`/logo-192.png`) || Path(`/logo-512.png`) || Path(`/logo-maskable-512.png`) || Path(`/icon.svg`)) && !PathPrefix(`/api/`)" - "traefik.http.routers.musica-nucleoriofrio-public.entrypoints=websecure" - "traefik.http.routers.musica-nucleoriofrio-public.tls.certresolver=letsencrypt" - "traefik.http.routers.musica-nucleoriofrio-public.priority=100" diff --git a/nuxt.config.ts b/nuxt.config.ts index aa54ddb..f75e31f 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -195,6 +195,8 @@ export default defineNuxtConfig({ categories: ['music', 'entertainment'], lang: 'es', dir: 'ltr', + // Capturar enlaces dentro de la app + capture_links: 'existing-client-navigate', icons: [ { src: '/logo-192.png', diff --git a/public/.well-known/web-app-origin-association b/public/.well-known/web-app-origin-association new file mode 100644 index 0000000..2ff6292 --- /dev/null +++ b/public/.well-known/web-app-origin-association @@ -0,0 +1,10 @@ +{ + "web_apps": [ + { + "manifest": "https://inicio.nucleoriofrio.com/manifest.webmanifest", + "details": { + "paths": ["/*"] + } + } + ] +}