Skip to content

Commit 315833f

Browse files
authored
fix(csp): resolves Content Security Policy violations + enables Worker observability (#23)
* fix(csp): resolves Content Security Policy violations * chore(worker): enables Cloudflare Worker observability logs
1 parent ed2e1fd commit 315833f

File tree

5 files changed

+16
-7
lines changed

5 files changed

+16
-7
lines changed

public/_headers

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Content-Security-Policy: default-src 'none'; script-src 'self' 'sha256-uEFqyYCMaNy1Su5VmWLZ1hOCRBjkhm4+ieHHxQW6d3Y='; style-src 'self'; img-src 'self' https://avatars.githubusercontent.com; connect-src 'self' https://api.github.com; font-src 'self'; worker-src 'self'; manifest-src 'self'; frame-ancestors 'none'; base-uri 'self'; form-action 'none'; upgrade-insecure-requests
2+
Content-Security-Policy: default-src 'none'; script-src 'self' 'sha256-uEFqyYCMaNy1Su5VmWLZ1hOCRBjkhm4+ieHHxQW6d3Y='; style-src-elem 'self'; style-src-attr 'unsafe-inline'; img-src 'self' data: https://avatars.githubusercontent.com; connect-src 'self' https://api.github.com; font-src 'self'; worker-src 'self'; manifest-src 'self'; frame-ancestors 'none'; base-uri 'self'; form-action 'none'; upgrade-insecure-requests
33
X-Content-Type-Options: nosniff
44
Referrer-Policy: strict-origin-when-cross-origin
55
Permissions-Policy: geolocation=(), microphone=(), camera=()

src/app/components/dashboard/ItemRow.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ export default function ItemRow(props: ItemRowProps) {
7575
const fg = isValidHex ? labelTextColor(label.color) : "#374151";
7676
return (
7777
<span
78-
class="inline-flex items-center rounded-full text-xs px-2 py-0.5 font-medium"
79-
style={{ "background-color": bg, color: fg }}
78+
class="inline-flex items-center rounded-full text-xs px-2 py-0.5 font-medium bg-[var(--lb)] text-[var(--lf)]"
79+
style={{ "--lb": bg, "--lf": fg }}
8080
>
8181
{label.name}
8282
</span>

src/app/components/shared/StatusDot.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ export default function StatusDot(props: StatusDotProps) {
4141

4242
const dot = () => (
4343
<span
44-
class={`relative inline-flex items-center justify-center${props.href ? " cursor-pointer" : ""}`}
45-
style={{ width: "12px", height: "12px" }}
44+
class={`relative inline-flex items-center justify-center w-3 h-3${props.href ? " cursor-pointer" : ""}`}
4645
title={cfg().label}
4746
aria-label={cfg().label}
4847
>
@@ -52,8 +51,7 @@ export default function StatusDot(props: StatusDotProps) {
5251
/>
5352
</Show>
5453
<span
55-
class={`relative inline-flex rounded-full ${cfg().bg}`}
56-
style={{ width: "8px", height: "8px" }}
54+
class={`relative inline-flex rounded-full w-2 h-2 ${cfg().bg}`}
5755
/>
5856
</span>
5957
);

src/app/index.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
@plugin "daisyui" {
44
themes: corporate --default, cupcake, light, nord, dim, dracula, dark, forest;
5+
exclude: chat, mask, mockup;
56
}
67

78

wrangler.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,13 @@ not_found_handling = "single-page-application"
1313
[[routes]]
1414
pattern = "gh.gordoncode.dev"
1515
custom_domain = true
16+
17+
[observability]
18+
enabled = true
19+
head_sampling_rate = 1
20+
21+
[observability.logs]
22+
enabled = true
23+
head_sampling_rate = 1
24+
persist = true
25+
invocation_logs = true

0 commit comments

Comments
 (0)