aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/canaries/+page.svelte
blob: 024980ff67bd8f14a072116eb30591a60a0dbae2 (plain) (blame)
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<svelte:options runes />

<script lang="ts">
  import { browser } from '$app/environment';
  import { canaries } from './canaries';
  import Canary from './Canary.svelte';
  import { initKeystore } from './keystore';
</script>

<svelte:head>
  <title>Warrant Canaries - estrogen.zone</title>
</svelte:head>

{#snippet rawCanaries()}
  <ul>
    {#each canaries as canary}
      <li class="list-disc ml-4">
        {canary.signer}'s canary for {canary.name} (<a
          href={canary.upstream ?? canary.url}
          target="_blank"
          download="{canary.signer}:{canary.name}.sig"
          class="opacity-90 hover:underline text-blue-400 hover:text-blue-300"
          >download</a
        >,
        <a
          href={canary.upstream ?? canary.url}
          target="_blank"
          class="opacity-90 hover:underline text-blue-400 hover:text-blue-300"
          >open in newtab</a
        >)
      </li>
    {/each}
  </ul>
{/snippet}
<div class="flex min-h-full min-w-full flex-col justify-between">
  <div>
    {#if !browser}
      <noscript class="text-white min-w-full min-h-full">
        You're using noscript; here are the raw canaries:<br />
        {@render rawCanaries()}
        {@html `<style>.hidden-if-noscript{display:none !important;}</style>`}
      </noscript>
    {/if}
    {#await initKeystore}
      <div class="hidden-if-noscript">
        {#if browser}
          Preparing...
        {:else}
          Awaiting Browser
        {/if}<br />
        For the impatient, the raw canaries may be found here:<br />
        {@render rawCanaries()}
      </div>
    {:then _}
      <div class="canaries flex gap-4 flex-wrap max-w-full">
        {#each canaries as canary}
          <Canary {canary} />
        {/each}
      </div>
    {:catch e}
      <div class="p-4 bg-red-700 text-white max-w-full overflow-x-auto">
        Encoutnered Error:
        <pre>{JSON.stringify(
            {
              raw: e,
              fileName: 'fileName' in e ? e.fileName : undefined,
              name: 'name' in e ? e.name : undefined,
              message: 'message' in e ? e.message : undefined,
              stack: 'stack' in e ? e.stack : undefined,
            },
            null,
            2,
          )}</pre>
      </div>
    {/await}
  </div>

  <div
    class="mt-3 sticky bottom-0 block bg-black/30 p-4 rounded-xl backdrop-blur-xl"
  >
    <p class="text-xs text-white">
      <span class="about opacity-60 hover:opacity-80 transition-all">
        This page contains various <a
          href="https://en.wikipedia.org/wiki/Warrant_canary"
          target="_blank"
          rel="noopener noreferrer"
          class="opacity-90 hover:underline text-blue-400 hover:text-blue-300"
          >liberty canaries</a
        >
        that I, or my friends, depend upon or are otherwise interested in.
      </span>
      <span
        class="validation-attempt opacity-60 hover:opacity-80 transition-all"
        class:hidden={!browser}
      >
        <br />
        It makes an attempt to validate their signatures, however it does not attempt
        to check if they've been updated in time for their next scheduled update.
        It is your responsibility to ensure that the canary's contents match your
        requirements.
      </span>
      <span
        class="trust-server opacity-60 hover:opacity-80 transition-all"
        class:hidden={!browser}
      >
        <br />
        The server at
        <code class="font-grub px-1 bg-white/5 rounded-md"
          >{#if typeof location !== 'undefined'}{location.host ??
              location.hostname}{:else}mem.estrogen.zone{/if}</code
        >
        serves the keys and the canaries. Make sure you trust it to serve correct
        keys and canaries, or validate the signatures of the
        <code class="font-grub px-1 bg-white/5 rounded-md">Signed</code> links with
        keys obtained externally.
      </span>
      <span
        class="legend opacity-60 hover:opacity-80 transition-all"
        class:hidden={!browser}
        ><br />If a signature check passes, the background of the respective
        canary turns
        <span class="bg-white text-black">white</span>. Whilst fetching, it's
        background turns <span class="bg-blue-500 text-white">blue</span>. If a
        signature check fails, it will turn
        <span class="bg-red-500 text-white">red</span>. If the canary cannot be
        found, it turns a different shade of
        <span class="bg-red-800 text-white">red</span>.</span
      >
      {#if canaries.find((v) => v.upstream)}
        <span
          class="upstream-btn opacity-60 hover:opacity-80 transition-all"
          class:hidden={!browser}
          ><br />
          If there is an upstream button, it indicates that we are mirroring the
          canary, rather than using the source canary, e.g. for CORS. You may want
          to check it in the event of something looking wrong.</span
        >
      {/if}
    </p>
  </div>
</div>