Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
62 lines (60 loc) · 4.14 KB
/
Copy pathindex.html
File metadata and controls
62 lines (60 loc) · 4.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#101216" />
<!--
Content Security Policy. Set here rather than by a server so it applies identically in
development, from the nginx image on its own, and behind Caddy. The point is script-src:
the client renders user-authored Markdown (bios) into innerHTML after sanitising, and a
policy that permits no inline or third-party script turns any sanitiser gap from
code execution into a blocked request.
script-src this origin, the wasm crypto engine ('wasm-unsafe-eval' is what lets
WebAssembly instantiate; it does not enable eval()), and Turnstile.
connect-src any http(s)/ws(s) host. The API, gateway and CDN origins are chosen per
deployment and only known at runtime (config.js / VITE_*), and a dev
setup routinely points them at a LAN address so a phone can join in -
which no CSP host expression can describe. ipc: and http://ipc.localhost
are the desktop app's bridge to its native shell (src-tauri/), which a
browser never sees. Restricting this would only
break real setups while the sanitiser-bypass case it is meant to
contain still has img-src and every other route out; the protection
that matters here is script-src.
img/media this origin, data/blob (canvas previews, decrypted attachments), and
any http(s) host for the same reason as connect-src: the instance's own
CDN (which also serves the bundled emoji sets, so nothing external is
needed to render emoji) and federated instances' CDNs are chosen per
deployment and unknowable to a static host expression.
style/font this origin plus Google Fonts; 'unsafe-inline' for style because the
framework sets inline style attributes.
frame-src Turnstile, plus the allow-listed video providers we play inline
(YouTube/Vimeo/Dailymotion/Loom/Streamable/Twitch - see
src/lib/embeds/providers.ts). object-src none, base-uri self, form-action self.
-->
<meta
http-equiv="Content-Security-Policy"
content="default-src 'self'; script-src 'self' 'wasm-unsafe-eval' https://challenges.cloudflare.com; connect-src 'self' https: wss: http: ws: ipc: http://ipc.localhost; img-src 'self' data: blob: https: http:; media-src 'self' data: blob: https: http:; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' data: https://fonts.gstatic.com; frame-src https://challenges.cloudflare.com https://www.youtube-nocookie.com https://player.vimeo.com https://www.dailymotion.com https://geo.dailymotion.com https://www.loom.com https://streamable.com https://player.twitch.tv https://clips.twitch.tv; worker-src 'self' blob:; object-src 'none'; base-uri 'self'; form-action 'self';"
/>
<title>Strafe</title>
<link rel="manifest" href="/manifest.webmanifest" />
<link rel="icon" href="/icons/favicon-32.png" sizes="32x32" type="image/png" />
<link rel="apple-touch-icon" href="/icons/apple-touch-icon.png" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="apple-mobile-web-app-title" content="Strafe" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap"
rel="stylesheet"
/>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script src="/config.js"></script>
<script src="/src/index.tsx" type="module"></script>
</body>
</html>