|
| 1 | +#!/usr/bin/env bash |
| 2 | +# Writes the index pages of deb.cutefish.org to standard output: |
| 3 | +# |
| 4 | +# web/index.sh root # the repository's front page |
| 5 | +# web/index.sh iso NAME SIZE SHA256 # iso/nightly/, for NAME.iso |
| 6 | +set -Eeuo pipefail |
| 7 | + |
| 8 | +FINGERPRINT="5F52 7F0C B976 4BA0 AF99 BAE5 F4A4 30BC 9E10 91A7" |
| 9 | +BLOG="https://cutefish.org/blog/how-cutefish-is-built/" |
| 10 | + |
| 11 | +header() { |
| 12 | + cat << EOF |
| 13 | +<!doctype html> |
| 14 | +<html lang="en"> |
| 15 | +<head> |
| 16 | +<meta charset="utf-8"> |
| 17 | +<meta name="viewport" content="width=device-width, initial-scale=1"> |
| 18 | +<title>$1</title> |
| 19 | +<style> |
| 20 | +:root { |
| 21 | + color-scheme: light dark; |
| 22 | + --background: #ffffff; |
| 23 | + --alternate-background: #f2f4f5; |
| 24 | + --text: #323238; |
| 25 | + --secondary-text: #64646e; |
| 26 | + --highlight: #3385ff; |
| 27 | + --separator: rgba(100, 100, 110, 0.1); |
| 28 | + font-family: "Noto Sans", system-ui, sans-serif; |
| 29 | + line-height: 1.7; |
| 30 | +} |
| 31 | +@media (prefers-color-scheme: dark) { |
| 32 | + :root { |
| 33 | + --background: #1c1c1d; |
| 34 | + --alternate-background: #3c3c3d; |
| 35 | + --text: #ffffff; |
| 36 | + --secondary-text: #888888; |
| 37 | + --separator: rgba(136, 136, 136, 0.3); |
| 38 | + } |
| 39 | +} |
| 40 | +body { margin: 0; background: var(--background); color: var(--text); -webkit-font-smoothing: antialiased; } |
| 41 | +main { max-width: 640px; margin: 0 auto; padding: 48px 24px 64px; } |
| 42 | +h1, h2 { font-weight: 600; line-height: 1.25; letter-spacing: -0.015em; } |
| 43 | +h1 { font-size: 2rem; margin: 0 0 8px; } |
| 44 | +h2 { font-size: 1.25rem; margin: 40px 0 8px; } |
| 45 | +p { margin: 8px 0; } |
| 46 | +.lead { color: var(--secondary-text); } |
| 47 | +a { color: var(--highlight); text-decoration: none; } |
| 48 | +a:hover { text-decoration: underline; } |
| 49 | +pre { background: var(--alternate-background); border-radius: 10px; padding: 12px 16px; overflow-x: auto; font-size: 0.875rem; line-height: 1.6; } |
| 50 | +code { font-family: ui-monospace, "Noto Sans Mono", monospace; } |
| 51 | +.file { background: var(--alternate-background); border-radius: 10px; padding: 16px; margin: 16px 0; } |
| 52 | +.file .name { font-weight: 600; word-break: break-all; } |
| 53 | +.file .meta { color: var(--secondary-text); font-size: 0.875rem; } |
| 54 | +.file .digest { font-family: ui-monospace, "Noto Sans Mono", monospace; font-size: 0.8125rem; word-break: break-all; } |
| 55 | +footer { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--separator); color: var(--secondary-text); font-size: 0.875rem; } |
| 56 | +</style> |
| 57 | +</head> |
| 58 | +<body> |
| 59 | +<main> |
| 60 | +EOF |
| 61 | +} |
| 62 | + |
| 63 | +footer() { |
| 64 | + cat << EOF |
| 65 | +<footer> |
| 66 | +Built and published by |
| 67 | +<a href="https://github.com/cutefishos/packaging/actions">GitHub Actions</a> |
| 68 | +from <a href="https://github.com/cutefishos/packaging">cutefishos/packaging</a>. |
| 69 | +See <a href="$BLOG">how Cutefish packages are built</a> and |
| 70 | +<a href="https://cutefish.org/blog/official-sources/">the official sources of Cutefish</a>. |
| 71 | +</footer> |
| 72 | +</main> |
| 73 | +</body> |
| 74 | +</html> |
| 75 | +EOF |
| 76 | +} |
| 77 | + |
| 78 | +root() { |
| 79 | + header "Cutefish packages" |
| 80 | + cat << EOF |
| 81 | +<h1>Cutefish packages</h1> |
| 82 | +<p class="lead">The APT repository of Cutefish Desktop for Debian 13, and nightly |
| 83 | +ISOs for testing. Nothing here is an official release yet.</p> |
| 84 | +
|
| 85 | +<h2>Nightly ISO</h2> |
| 86 | +<p>The newest live ISO is in <a href="/iso/nightly/">iso/nightly</a>.</p> |
| 87 | +
|
| 88 | +<h2>Adding the repository</h2> |
| 89 | +<p>Download the key, check that its fingerprint is the one below, and add the |
| 90 | +repository:</p> |
| 91 | +<pre><code>sudo curl -fsSLo /etc/apt/keyrings/cutefish.asc https://deb.cutefish.org/cutefish.asc |
| 92 | +gpg --show-keys /etc/apt/keyrings/cutefish.asc |
| 93 | +echo "deb [signed-by=/etc/apt/keyrings/cutefish.asc] https://deb.cutefish.org trixie-nightly main" \\ |
| 94 | + | sudo tee /etc/apt/sources.list.d/cutefish.list |
| 95 | +sudo apt update |
| 96 | +sudo apt install cutefish-desktop</code></pre> |
| 97 | +
|
| 98 | +<h2>Signing key</h2> |
| 99 | +<pre><code>Cutefish Archive <reionwong@gmail.com> |
| 100 | +ed25519, fingerprint $FINGERPRINT</code></pre> |
| 101 | +<p>Only the build workflow can sign with it.</p> |
| 102 | +
|
| 103 | +<h2>What went into the packages</h2> |
| 104 | +<p><a href="/dists/trixie-nightly/commits">commits</a> lists the commit of every |
| 105 | +project the newest build used, and |
| 106 | +<a href="/dists/trixie-nightly/SHA256SUMS">SHA256SUMS</a> the checksum of every |
| 107 | +file it made. Each file also has a |
| 108 | +<a href="https://github.com/cutefishos/packaging/attestations">build provenance attestation</a>.</p> |
| 109 | +EOF |
| 110 | + footer |
| 111 | +} |
| 112 | + |
| 113 | +iso() { |
| 114 | + local name="$1" size="$2" digest="$3" built human |
| 115 | + built="$(date -u '+%B %-d, %Y, %H:%M UTC')" |
| 116 | + human="$(awk -v b="$size" 'BEGIN { printf "%.2f GB", b / 1e9 }')" |
| 117 | + |
| 118 | + header "Cutefish nightly ISO" |
| 119 | + cat << EOF |
| 120 | +<h1>Cutefish nightly ISO</h1> |
| 121 | +<p class="lead">The newest live ISO of Cutefish on Debian 13, built from the |
| 122 | +latest code. It is meant for testing; only the newest one is kept.</p> |
| 123 | +
|
| 124 | +<div class="file"> |
| 125 | +<div class="name"><a href="$name.iso">$name.iso</a></div> |
| 126 | +<div class="meta">$human · built $built · |
| 127 | +<a href="$name.iso.sha256">SHA-256</a> · |
| 128 | +<a href="$name.packages">package list</a></div> |
| 129 | +<div class="digest">$digest</div> |
| 130 | +</div> |
| 131 | +
|
| 132 | +<h2>Checking the download</h2> |
| 133 | +<p>Compare the checksum, then verify that the ISO was built by the Cutefish |
| 134 | +workflow and not changed since, with the |
| 135 | +<a href="https://cli.github.com/">GitHub CLI</a> 2.49 or later:</p> |
| 136 | +<pre><code>sha256sum -c $name.iso.sha256 |
| 137 | +gh attestation verify $name.iso --repo cutefishos/packaging</code></pre> |
| 138 | +<p><a href="LATEST">LATEST</a> always names the newest ISO, for scripts.</p> |
| 139 | +EOF |
| 140 | + footer |
| 141 | +} |
| 142 | + |
| 143 | +case "${1:-}" in |
| 144 | + root) root ;; |
| 145 | + iso) |
| 146 | + (( $# == 4 )) || { echo "Usage: web/index.sh iso NAME SIZE SHA256" >&2; exit 1; } |
| 147 | + iso "$2" "$3" "$4" |
| 148 | + ;; |
| 149 | + *) echo "Usage: web/index.sh root | iso NAME SIZE SHA256" >&2; exit 1 ;; |
| 150 | +esac |
0 commit comments