Use the plane emoji as the favicon; send cookies with the manifest

Behind an auth proxy (Authentik) the manifest fetch was redirected to the
login page, which blocked installing the PWA.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rickyandClaude Opus 5.5 committed 2026-11-06 09:58:32 -05:00
1 parent ef542ee2a5
commit 4b6329843d
5 files changed
+9 -8

No files matched your search

+2 -3
View File
@@ -9,12 +9,11 @@
<%= csrf_meta_tags %> <%= csrf_meta_tags %>
<%= csp_meta_tag %> <%= csp_meta_tag %>
<%= yield :head %> <%= yield :head %>
<link rel="manifest" href="/manifest.json"> <link rel="manifest" href="/manifest.json" crossorigin="use-credentials">
<meta name="theme-color" content="#0f172a"> <meta name="theme-color" content="#0f172a">
<meta name="apple-mobile-web-app-title" content="SAM"> <meta name="apple-mobile-web-app-title" content="SAM">
<meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="icon" href="/icon.png" type="image/png"> <link rel="icon" href="/favicon.svg" type="image/svg+xml">
<link rel="icon" href="/icon.svg" type="image/svg+xml">
<link rel="apple-touch-icon" href="/apple-touch-icon.png"> <link rel="apple-touch-icon" href="/apple-touch-icon.png">
<%= stylesheet_link_tag :app, "data-turbo-track": "reload" %> <%= stylesheet_link_tag :app, "data-turbo-track": "reload" %>
<%= javascript_importmap_tags %> <%= javascript_importmap_tags %>
+2 -3
View File
@@ -7,12 +7,11 @@
<meta name="robots" content="noindex, nofollow"> <meta name="robots" content="noindex, nofollow">
<%= csrf_meta_tags %> <%= csrf_meta_tags %>
<%= csp_meta_tag %> <%= csp_meta_tag %>
<link rel="manifest" href="/manifest.json"> <link rel="manifest" href="/manifest.json" crossorigin="use-credentials">
<meta name="theme-color" content="#0f172a"> <meta name="theme-color" content="#0f172a">
<meta name="apple-mobile-web-app-title" content="SAM"> <meta name="apple-mobile-web-app-title" content="SAM">
<meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="icon" href="/icon.png" type="image/png"> <link rel="icon" href="/favicon.svg" type="image/svg+xml">
<link rel="icon" href="/icon.svg" type="image/svg+xml">
<link rel="apple-touch-icon" href="/apple-touch-icon.png"> <link rel="apple-touch-icon" href="/apple-touch-icon.png">
<%= stylesheet_link_tag :app, "data-turbo-track": "reload" %> <%= stylesheet_link_tag :app, "data-turbo-track": "reload" %>
<%= javascript_importmap_tags %> <%= javascript_importmap_tags %>
+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text x="50" y="50" font-size="88" text-anchor="middle" dominant-baseline="central">✈️</text></svg>

After

Width:  |  Height:  |  Size: 166 B

+1 -1
View File
@@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="theme-color" content="#0f172a"> <meta name="theme-color" content="#0f172a">
<title>Offline · Simple Aircraft Manager</title> <title>Offline · Simple Aircraft Manager</title>
<link rel="icon" href="/icon.svg" type="image/svg+xml"> <link rel="icon" href="/favicon.svg" type="image/svg+xml">
<style> <style>
:root { --page: #f1f5f9; --surface: #fff; --text: #1e293b; --muted: #64748b; --accent: #0369a1; } :root { --page: #f1f5f9; --surface: #fff; --text: #1e293b; --muted: #64748b; --accent: #0369a1; }
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
+3 -1
View File
@@ -23,9 +23,11 @@ class PwaTest < ActionDispatch::IntegrationTest
test "signed-in and shared pages link the manifest and register the worker" do test "signed-in and shared pages link the manifest and register the worker" do
sign_in create_user sign_in create_user
get root_path get root_path
assert_select "link[rel=manifest][href='/manifest.json']" assert_select "link[rel=manifest][href='/manifest.json'][crossorigin=use-credentials]" # behind an auth proxy (Authentik) the manifest needs cookies
assert_select "meta[name=theme-color]" assert_select "meta[name=theme-color]"
assert_select "link[rel=apple-touch-icon][href='/apple-touch-icon.png']" assert_select "link[rel=apple-touch-icon][href='/apple-touch-icon.png']"
assert_select "link[rel=icon][href='/favicon.svg']"
assert_includes Rails.public_path.join("favicon.svg").read, "✈️"
token = create_aircraft(owner: create_user("o2@example.com")).share_tokens.create!(privilege: "status") token = create_aircraft(owner: create_user("o2@example.com")).share_tokens.create!(privilege: "status")
get shared_path(token.token) get shared_path(token.token)