diff --git a/setup.sh b/setup.sh index e78dd38..b1ec735 100644 --- a/setup.sh +++ b/setup.sh @@ -589,7 +589,7 @@ def export_pdf(): img = Paragraph('', styles['Normal']) elif game.url and 'gog.com' in game.url: try: - img_path = os.path.join(app.root_path, 'static', 'gog_logo.png') + img_path = os.path.join(app.root_path, 'static', 'gog_logo.webp') img = Image(img_path, width=3*cm, height=img_height) except Exception: img = Paragraph('', styles['Normal']) @@ -821,10 +821,11 @@ SHELL ["/bin/bash", "-c"] RUN apt-get update && apt-get install -y --no-install-recommends wget \ && mkdir -p /app/static \ - && wget -O /app/static/logo.png "https://git.nocci.it/nocci/GiftGamesDB/raw/branch/main/steam-gift-manager/static/logo.png" \ - && wget -O /app/static/logo_small.png "https://git.nocci.it/nocci/GiftGamesDB/raw/branch/main/steam-gift-manager/static/logo_small.png" \ - && wget -O /app/static/forgejo.svg "https://git.nocci.it/nocci/GiftGamesDB/raw/branch/main/steam-gift-manager/static/forgejo.svg" \ - && wget -O /app/static/gog_logo.png "https://git.nocci.it/nocci/GameKeyManager/raw/branch/dev/steam-gift-manager/static/gog_logo.png" \ + && wget -O /app/static/logo.webp "https://drop.nocadmin.net/logo.webp" \ + && wget -O /app/static/logo_small.webp "https://drop.nocadmin.net/logo_small.webp" \ + && wget -O /app/static/forgejo.webp "https://drop.nocadmin.net/forgejo.webp" \ + && wget -O /app/static/gog_logo.webp "https://drop.nocadmin.net/gog_logo.webp" \ + && wget -O /app/static/logo_small_maskable.webp "https://drop.nocadmin.net/logo_small_maskable.webp" \ && rm -rf /var/lib/apt/lists/* RUN mkdir -p /app/data && \ @@ -945,6 +946,7 @@ chmod +x ../upgrade.sh # Manifest for PWA cat < static/manifest.json { + "id": "/", "name": "Game Key Manager", "short_name": "GameKeys", "start_url": "/", @@ -952,31 +954,44 @@ cat < static/manifest.json "background_color": "#212529", "theme_color": "#212529", "description": "Manage Steam/GOG keys easily!", + "orientation": "any", + "launch_handler": { + "client_mode": "navigate-existing" + }, "icons": [ { - "src": "/static/logo_small.png", + "src": "/static/logo_small.webp", "sizes": "192x192", - "type": "image/png", - "purpose": "any maskable" + "type": "image/webp", + "purpose": "any" }, { - "src": "/static/logo.png", + "src": "/static/logo_small_maskable.webp", + "sizes": "192x192", + "type": "image/webp", + "purpose": "maskable" + }, + { + "src": "/static/logo.webp", "sizes": "512x512", - "type": "image/png" + "type": "image/webp", + "purpose": "any maskable" } ] } MANIFEST_END + # Service Worker cat < static/serviceworker.js const CACHE_NAME = 'game-key-manager-v1'; const ASSETS = [ '/', '/static/style.css', - '/static/logo.png', - '/static/logo_small.png', - '/static/gog_logo.png' + '/static/logo.webp', + '/static/logo_small.webp', + '/static/gog_logo.webp', + '/static/forgejo.webp' ]; self.addEventListener('install', (event) => { @@ -992,6 +1007,15 @@ self.addEventListener('fetch', (event) => { .then(cachedResponse => cachedResponse || fetch(event.request)) ); }); + +self.addEventListener('activate', (event) => { + event.waitUntil( + caches.keys().then(keys => Promise.all( + keys.filter(key => key !== CACHE_NAME) + .map(key => caches.delete(key)) + )) + ); +}); SW_END @@ -1001,41 +1025,47 @@ mkdir -p templates static # Base Template cat < templates/base.html - + - {{ _('Game Key Manager') }} - - - + + {{ _('Game Key Manager') }} + + + + + + +