Decisions #
Choices made while building, where the spec was silent or had to bend. Newest last.
Heatmap comes from git, not the Gitea heatmap API #
The heatmap API leaked private activity before Gitea 28.3.0, and the server runs 28.2.x. The builder counts commits on the default branch of the allowlisted repos from the local mirrors instead. Private activity can't leak whatever Gitea version runs, but only commits are counted (no PRs, issues and so on). All authors are counted, since the anonymous API hides the user's email, so merged commits from others show up too.
Packages are filtered by the allowlist #
Gitea package visibility follows the owner, not the linked repo, so a package linked to a private repo is public. Only packages linked to an allowlisted repo are listed.
Change detection: reuse git pages when nothing they show changed #
Repo updated_at doesn't reliably change when PRs or releases change, so it
isn't used. Every build re-fetches the API and re-renders the profile, each
repo's root page, the log page and the releases, pulls and packages pages.
File, folder, raw and commit pages are hard-linked from the previous build
when the reuse key is unchanged. The key is HEAD plus the repo header data
(description, website, topics, archived, default branch, latest tag), because
every page shows that header. Keys live in memory, so a restart (which is
also how config or template changes ship) re-renders everything.
Builds are written to site/.tmp-<ts>, renamed to site/<ts>, and published
by renaming a fresh current.new symlink over current. The newest and the
previous build are kept, and anything else (including temp dirs left by a
crash) is removed after each swap.
Tailnet URLs never reach the page #
Gitea builds URLs from its ROOT_URL, a tailnet address. The avatar is
downloaded into the build. Release assets go through one more allowlisted
proxy route, /<repo>/releases/download/<tag>/<file>. The registry proxy
refuses upstream redirects so a storage backend URL is never handed out.
Raw files: images keep their type, everything else is text #
README images resolve to /<repo>/raw/..., so png, jpg, gif and webp are
served with their real types. SVG and everything else is served as
text/plain or as an attachment. nosniff and the CSP stay on.
Smaller choices #
go geton subpackages: any/<repo>/...?go-get=1gets the go-import meta.- The git proxy forwards
Git-Protocolso protocol v2 works. - Git runs with
GIT_TERMINAL_PROMPT=0and an empty credential helper, so a private repo in config fails fast instead of hanging on a prompt. - Config rejects repo names that clash with routes (
static,v2,healthz,api,user). - Dates are bucketed in UTC.
- README links resolve to
blob/pages, or totree/pages when they end in/. Images that aren't relative or https are dropped and their alt text kept. Goldmark blanks dangerous link schemes such asjavascript:. - The go-import meta is added when the repo root has a
go.mod. - The clone box shows only the HTTPS URL for now. Tangled and GitHub links need per-repo config, because not every repo is mirrored there.
- Tooling: Go is pinned in
mise.toml, and commands live in thejustfile.
Theme follows danieldaum.net (saturn) #
The site's look matches saturn instead of a generic Flexoki light/dark theme.
It is dark only and uses saturn's tokens, palettes, fonts and components. The
details are in docs/theme.md. This replaces the spec's original
"light and dark via prefers-color-scheme".
File pages #
- A blob page for
<path>is stored as<repo>/blob/<path>.html, and the server maps/blob/<path>to it. Raw bytes are stored at<repo>/raw/<path>. - Files over 50 MB get no raw copy, only a note to clone. Files over 512 KB, or binary ones (a NUL byte in the first 8 KB, or not valid UTF-8), get no highlighted view. png, jpg, gif and webp are shown as images.
- The last commit per entry comes from one
git log --name-onlypass over history, not onegit logper path. - Folder pages show their own README, if they have one.
- Highlighting: chroma tokens map to saturn's
hl-*roles ininternal/render/highlight.go. README code blocks use the same mapping.
Log and commit pages #
- Only the commits on the log page (the last
max_commitson the default branch) get commit pages. Parent links show only when the parent has a page. - Diffs are against the first parent (
--diff-merges=first-parent), with rename detection. At most 5,000 diff lines are kept per commit. The rest are counted in the stats but not shown.
Releases, pulls and packages #
- If Gitea returns 404 for releases, pulls or packages (for example, the feature is turned off for that repo), the page is empty. Any other API error fails the build.
- Draft releases are never shown. The repo header shows the newest non-prerelease tag.
- Release assets link to
/<repo>/releases/download/<tag>/<file>, which the proxy (step 8) forwards. - PR bodies sit in
<details>, so they open without JS. - Packages: container images are listed only when the image is in
images(so everydocker pullshown actually works), and untaggedsha256:versions are hidden. Other package types are listed with no install command, because their registries aren't proxied.
Server #
- Routes:
/,/healthz,/static/…and/<repo>/…for allowlisted repos. Inside a repo,raw/serves files,blob/<p>serves<p>.html, paths ending in/serveindex.html, and a folder without the slash redirects. Everything else, including any path with dot segments,//,\or NUL, is a 404 using the built404.html./index.htmlitself is a 404 too. - Methods other than GET and HEAD get a 404, and a GET or HEAD with a body
gets a 400. Step 8 adds the git
POSTroute. - Raw files: png, jpg, gif and webp keep their image types. Files with a NUL
in the first 512 bytes are
application/octet-streamwithContent-Disposition: attachment. Everything else, SVG and HTML included, istext/plain. - Page responses get a 30s write deadline through
http.ResponseController. The server itself has noWriteTimeout, so proxied clones can stream. - Logs: for peers in
trusted_proxies, the client IP comes fromCF-Connecting-IP, or else the lastX-Forwarded-Forentry. Otherwise it's the TCP peer. -serve-dir DIR(dev only) serves a finished build without building;just serveandjust demouse it.
Git and registry proxy #
- Proxy routes are matched before anything else and work before the first
build. Within the
.git,/v2andreleases/downloadprefixes anything not explicitly allowed is a 404. Any path or query containinggit-receive-packis a 403. - Requests to Gitea never carry
CookieorX-Forwarded-*.Authorizationpasses only when it is aBearertoken on a registry manifest or blob route, which is the anonymous token Gitea just issued. Basic credentials are never forwarded. /v2/tokenis forwarded only when everyscopeis a pull of an allowlisted image._catalogandtags/listare 404.- Any 3xx from Gitea becomes a 502, so storage or tailnet URLs never reach clients. With Gitea's local storage, blobs and assets are served directly, so this doesn't happen in practice.
- Release assets are always
application/octet-streamwithContent-Disposition: attachment. - The
git-upload-packbody is capped at 10 MB and must have the git request content type. - Gitea must allow anonymous HTTP git and registry reads
(
REQUIRE_SIGNIN_VIEW = false, HTTP git not disabled), or public clones and pulls fail.
Image #
- Base images are
golang:1.27.4-alpine3.24andalpine:3.24.4, pinned by digest.just digestsprints the current upstream digests for bumping. Go is the same version asmise.toml. - apk packages (
git,ca-certificates) aren't version-pinned, since Alpine drops old package versions. The base image digest bounds them. HOME=/data, so nothing tries to write elsewhere on the read-only root. Builds only write under/data..dockerignoreis an allowlist: onlygo.mod,go.sum,cmd/,internal/andweb/enter the build context, and tests are excluded.craneandhadolintare project tools inmise.toml.
Reaching Gitea #
- Today Gitea's HTTPS is public at
git.danieldaum.net, and only SSH is tailnet-only.gitea_urlishttps://git.danieldaum.netfor now. SSH isn't an option, because it needs a key and the builder must stay anonymous. - Once Gitea goes private, the best option is a shared Docker network on the
same host (
gitea_url: http://gitea:3000), so no tailnet hop is needed. Otherwise expose Gitea's HTTP port on the tailnet only. - Gitea 28's packages API requires a token even for public packages, so it answers anonymous calls with 401. 401 and 403 now count as "not publicly visible", the same as 404. The build logs a warning, and the packages page stays empty.
Polish pass: design, icons, one small script #
- Design: saturn's palettes and tokens stay, but daum.dev has its own type and component system, because saturn's all-pixel, all-caps style reads poorly in dense listings. Text is Geist, code and hashes are Geist Mono, and headings and the brand are Geist Pixel. Labels are sentence case. Everything sits in one bordered "box" component. Repo pages are up to 68rem wide.
- File icons: replaced in polish pass 3 (Phase 3) by Phosphor icons.
- Copy buttons need JS, which departs from the spec's "No JavaScript".
/static/copy.jsis about 15 lines, same-origin and progressive: without it, the buttons stay hidden and the read-only fields can still be copied by hand. The CSP gainsscript-src 'self', and nothing inline is allowed. To drop it, deletecopy.js, its<script>tag and the CSP entry. - Branches and tags pages (
/<repo>/branches/,/<repo>/tags/) list refs with their last commit. Only the default branch is browsable. Tags link to their release. - CI checks: the status of HEAD comes from Gitea's commit status API. The
check badge links to the commit page's
#checkslist. Gitea's own run pages aren't linked, since the Gitea UI is never exposed. - Freshness: ages within a day, week or month get warmer colours.
- Stylesheet cache-busting: the CSS (and
copy.js) URLs carry a hash ofstyle.css, so caches never serve a stale stylesheet.
Polish pass 3 #
Phase 1: contrast and type #
All changes are in part 2 of style.css. Saturn's tokens in part 1 are
untouched, and every new value is a color-mix() of them, so ink, wine,
plum, teal and flexoki get the same steps as moss.
-
Layers follow the Paint themes for Gitea (
gitea/theme/css/). The first try mixed saturn's--surfaceand--bordersinto boxes. They are strongly saturated (moss surface is an olive at chroma 0.056), so boxes looked off-colour against a near-black page. Paint uses one lightness ladder in every palette, tinted only slightly toward the palette's hue: in OKLab, page L 0.205, box 0.222, box header 0.245, hover 0.267, border 0.36, all at chroma ~0.015. Here each layer iscolor-mix(in oklab, var(--background-dark) 55%, <neutral grey>), which lands within 1–2 RGB units of every Paint theme and extends to flexoki, which has no Paint theme:token grey moss result Paint moss --page#141414#171a10#16180e--box#1c1c1c#1b1d14#1a1c12--box-head#282828#202319#1f2217--hover#343434#25281e#25271d--rule#4e4e4edividers inside boxes --edge#6d6d6d#3d4035#3c3f33--line#808080controls Nothing in part 2 uses
--surface,--bordersor--accent-mutedany more. Chips, buttons, the clone menu, code areas, inline code,hr, the count pills and topic pills now sit on the ladder or on a light mix of the accent. Hover borders use--accent-edge(the accent mixed into--edge). -
Text:
--body-text(45% body, 55% headings) for body copy, descriptions and the tree's commit column. File names, repo names, commit subjects and counts use--text-headingsat weight 500–600, and--text-secondaryis kept for metadata. Ages, sizes, counts and stats use tabular figures. "No description." on repo cards stays dim (repo-card-desc--none). -
Accent:
--accent-bright(accent 82%, white 18%) is used for hovers, active tabs, breadcrumb links, the profile name, the 404 and one shared:focus-visiblering (a,button,summary,input).--accentstays for fills: the primary button, the language bar, the top heatmap step and the:targetline edge. Heatmap steps--heat-1..3mix the accent into--box(30/52/76%), like Paint's primary ramp, instead of starting from the saturated--accent-muted. -
Depth: Paint's card shadow (
0 1px 1pxat 25% black) plus a very faint top highlight, on boxes, repo cards and box heads. An accent glow behind the avatar was tried and dropped: the avatar has a plain 1px ring. -
Contrast:
web/contrast_test.goreads the tokens fromstyle.css, evaluates thecolor-mix()chains in OKLab and fails below 4.5:1. Rungo test -v -run Contrast ./webto see the ratios. At the time of writing:text on moss ink wine plum teal flexoki headings / page 15.46 15.71 15.78 15.80 15.46 16.47 headings / box-head 14.01 14.30 14.38 14.40 14.01 15.23 body / box 13.49 13.74 13.80 13.82 13.49 14.49 body / hover 11.89 12.17 12.24 12.26 11.89 13.06 secondary / page 6.51 6.62 6.65 6.65 6.51 6.94 secondary / box 6.27 6.39 6.42 6.42 6.27 6.74 secondary / box-head 5.90 6.02 6.06 6.07 5.90 6.41 secondary / hover 5.53 5.66 5.69 5.70 5.53 6.07 accent-bright / box 8.45 7.57 7.89 8.13 8.86 7.55 Line numbers keep saturn's dimmed look (opacity 0.55) and are exempt, as decoration next to the code.
Phase 2: language bar above the file tree #
- The language legend (dot, name, percent) is a compact row between the tabs
and the code box. The bar is a 4px SVG strip, the first child of the code
box. The box's
overflow: hiddenclips it to the rounded top corners and keeps it inside the border. The segments are the same as before: adjacent rects with no extra gap, the six largest languages plus "other". The old.langssection under the box is gone. - Empty repos show neither, as before: there's no code box and Gitea reports no languages.
Phase 3: Phosphor icons #
Replaced by Gitea's icons, see "Gitea's icons again" at the end. The per-page sprite described here stays.
- One icon family. File icons come from the Phosphor Colored set in
Daniel's dotfiles (
.config/zed/phosphor-colored-icons). UI icons (tabs, stats, clone, copy, CI, people) are Phosphor Regular from@phosphor-icons/core2.1.1. Both are MIT. The 47 file glyphs and the set'sLICENSElive inweb/static/icons/phosphor/, and the 17 UI glyphs in use plus core'sLICENSElive inui/beneath it. The material icons and their licence are gone. - Mapping:
scripts/icons.py(just icons <colored> <core>) reads theICONStable from the set'sscripts/build.pywithast.literal_eval, without running it, and generatesinternal/render/icons_gen.go: exact names (iconStems) and suffixes (iconSuffixes) mapped to (glyph, role). When two keys claim the same suffix, the later one wins, as in build.py. The UI name map (book→book-bookmarkand so on) is in the script. Zed's built-in mappings (BUILTIN) have no suffixes of their own in build.py, so they aren't used. - Lookup order is Zed's, which build.py follows: the whole file name as
a stem, then as a suffix, then each part after a dot from the left
(
a.tar.gztriestar.gz, thengz), thendefault(the neutral document). One addition: if nothing matches, the same lookup runs again on the lowercased name, soREADME.MDstill gets the markdown icon. Folders and submodules usefolder-closed, and the current folder in tree-page breadcrumbs usesfolder-open. Some common names fall through to the default icon, because the table doesn't cover them:go.mod,justfileand.github. - Colour by role, not hex.
.r-<role>classes map roles to saturn's syntax tokens, the same pairs aspalettes.json: red →--syn-variable, orange →--syn-constant, yellow →--syn-type, green →--syn-string, cyan →--syn-builtin, blue →--syn-function, purple →--syn-keyword, magenta → a mix of variable and keyword, neutral and folder →--text-secondary. Icons followdata-theme. - Per-page sprite. Every icon is
<svg class="ficon r-ROLE"><use href="#f-GLYPH">or<svg class="icon"><use href="#i-NAME">.base.htmlemits an empty sprite.render.Writescans the finished page for#f-and#i-references and fills in only those<symbol>s, built once from the embedded SVGs. Pages carry just their own icons. Nothing is fetched, there are nodata:URLs, and the CSP is unchanged. Phosphor paths are longer than the old hand-drawn strokes, so the repo home went from 16.7 KB to 21.4 KB before compression, while the profile shrank.static/icons/isn't copied into the output, since nothing fetches it. The safety test fails if a page uses an icon its sprite lacks. - UI icons are filled paths now, so
.iconusesfill: currentColorand the stroke rules are gone. CI pending isdot-outline.
Extra: document tabs in the README box #
- On the repo root, the README box gets a tab bar when the repo has more than
the README. In tab order: README, License (named when recognised, such as
"MIT license"), Security, Contributing, Code of conduct, Support,
Governance, Funding, Citation, Authors (also
CONTRIBUTORS,MAINTAINERS), Notice and Changelog (alsoCHANGES,HISTORY,NEWS,RELEASES). Only the ones the repo has are shown. Each is the first file matching the stem, in any case (LICENSE/LICENCE/COPYINGby prefix), with no extension or one of md, markdown, txt, rst, adoc, yml, yaml, cff or bib, in the root, then.github/, thendocs/. The table isdocKindsininternal/build/repo.go, and the CSS has panel rules for up to 13 tabs. Files over 512 KB are skipped. Markdown renders like the README, with relative links resolved from the file's own folder. Plain text, such as most LICENSE files, is a wrapping monospace block. Folder pages keep their single README box. - No JS: the tabs are radio inputs (visually hidden) with labels. CSS
shows the panel whose radio is checked, using
:has()inside@supports selector(:has(a)). Without:hasonly the first document shows, which is the old README box. Radios also give keyboard switching (arrow keys) and a focus ring for free. The CSP is unchanged. - Known limits: heading anchors inside a hidden tab don't scroll there, and two documents may produce the same heading id.
- New UI icons:
shield(shield-check),users,heart,lifebuoy,bank,coins,quotesandinfo. - The repo-a fixture gains
SECURITY.md,CONTRIBUTING.md,.github/CODE_OF_CONDUCT.mdand.github/FUNDING.yml(plain text).
Extra: container images read from the registry #
- Gitea 28's packages API wants a token, so anonymously the packages page
was empty. Container images now come from Gitea's registry itself, which
serves public images anonymously:
/v2/answers with a bearer challenge, and/v2/tokenhands out a pull token without credentials. That token can only do what anydocker pullcan, so the builder stays anonymous (rule 1). The token is requested from the configuredgitea_url, never from the challenge's realm, kept in memory and never rendered. The test fake Gitea allows exactly that oneAuthorizationheader. - Which images: allowlisted images (
imagesin config) named like the repo, plus container packages the API links to the repo, when the API answers. Images outsideimagesnever appear. Other package types (npm and so on) still come from the API, listed under "Other packages". - What's shown: per image, the
docker pullof the newest tag. Then up to 8 versions, newest first, one per distinct manifest digest, with every tag that points at it (the first 30 tags are read). Each version is a<details>, and the newest is open. It shows the full digest, a pull-by-digest command, the created time, the manifest type, and each platform (attestation manifests skipped) with its full digest, compressed size, layer count and distro. - Distro: read from
etc/os-release(orusr/lib/os-release, which is where Alpine's symlink points) in the first three layers. Only gzip or plain tar layers up to 64 MB are read, and the stream stops as soon as the file is found. Otherwise the page says "No os-release (scratch or distroless)". - Metadata: OCI labels for version, revision (linked to its commit page
when it has one), base image, licenses, authors, vendor, description,
source, URL and documentation, plus entrypoint, command, ports and user.
The environment is never even parsed, since it can hold secrets. Gitea's
hosts are private: the configured host and the challenge realm's host,
which is
ROOT_URLand may be a tailnet name. A source or URL on those hosts that points at an allowlisted repo becomes a link to its page here. Any other value naming them, or a.ts.netname, is dropped. Only https URLs are linked. - Integrity and cost: manifests fetched by digest and config blobs must hash to their digest. Per-platform results are cached in memory by digest, since they're content-addressed, so a rebuild only refetches the tag list and the tag manifests.
- Failure: registry trouble never fails the build. The image is still listed with its pull command and a note that details aren't available. This differs from the API rule, because a stale packages page is worse than a short one.
Phase 4: activity on the profile page #
All of it is server-side HTML and SVG, built from data the build already
has: the last year's commits from the mirrors of the allowlisted repos, plus
releases, pulls and repo metadata from API calls already made. The one new
field read is the repo's created_at (and merged_at on pulls), from the
same responses. No new endpoints are called. Only repos in config.json
are in the data, so nothing else can appear.
- Weekly bars (replaced by the activity bar chart, see below) sit in the heatmap box, above the heatmap. The box head shows "active in N of the last 52 weeks" and the current streak: consecutive weeks with commits, ending this week, or last week while this week is still empty.
- Layout (revised after review): activity graph at the top, then the featured repos, then the activity feed. The separate "Recently active" row is gone.
- Featured repos: up to six cards in the middle, from
featuredin config (in order, each must be inrepos), or the six most recently updated. "All N repositories →" links to/repos/, a new top-level page that lists every allowlisted repo. The server has one extra route for it, andreposis now a reserved repo name. A repo with commits in the last week gets a "N commits this week" pill and an accent edge (see Phase 5). Cards also carry the 12-week sparkline and the latest release tag. - Activity feed: a text timeline, modelled on Tangled's and styled
after the comment threads on danieldaum.net: no boxes, a dashed rule
above, and a time column (UTC) that shows the time for today's events and
the date ("Nov 19") otherwise, with the full time on hover. Day headers
were tried and dropped to keep it short. Each event has an avatar (yours for your own events, a person icon
for others) with a small badge icon, a one-line sentence, and nested
lines on a 1px left rule, like saturn's comment replies. The feed covers
the last 90 days, at most 6 events, in a compact type size (shortened twice after review):
- "pushed N commits to
mainon repo": git doesn't record pushes, so commits are grouped per repo, author and day. Each shows the newest two as short hash (linked when it has a page) plus subject, then a "+N more" chip and "Commits →" to the log. - "created repository X", "published release
vXon repo", and "opened" or "merged pull on repo", one line each. The year's commits come from one <code>git log</code> pass per repo (hash, author, time, subject), which also feeds the heatmap and the bars. On phones the time moves above the sentence.</li> </ul> </li> <li><strong>Counting rules match the heatmap's:</strong> every commit on the default branch counts, whoever authored it, because the anonymous API hides emails. Pushes are approximated by commits, since Gitea's activity feed isn't used: it would need a new endpoint and covers private repos.</li> <li>The repo-a fixture gains 25 dated commits across five months (on <code>docs/notes.md</code>, four of them on one day), repo <code>created_at</code> dates, and a merged pull (#5), so the goldens and <code>just demo</code> show a real shape.</li> </ul> <h3 id="phase-5-more-life-on-every-page" tabindex="-1">Phase 5: more life on every page <a class="anchor" href="#phase-5-more-life-on-every-page">#</a></h3> <p>No JS was added for any of it.</p> <ul> <li><strong>Freshness:</strong> a still green dot marks a commit in the last 24 hours: on the "updated" pill in the repo header and on tree rows. A pulsing version was tried and dropped, since motion doesn't fit the static look. Repo cards with commits in the last 7 days show a plain "N commits this week" pill and an accent edge. An earlier "active"/"live" label said too little. Releases and commits under 7 days old get an accent "new" badge. The warm age colours stay, and they are mixes of <code>--syn-constant</code> and <code>--text-secondary</code>, both well over 4.5:1 on boxes and hovers.</li> <li><strong>Repo header:</strong> stats are compact pills on every repo page: the latest release (an accent badge), commits, branches, tags, "updated … ago" in its freshness colour (or the live dot), and the CI result of HEAD linked to its checks. The code box no longer repeats branches, tags and commits. Its top bar keeps the branch chip and the clone menu. Website, licence and packages stay on the meta line, which is left out when empty.</li> <li><strong>Reuse key:</strong> pages reused across builds (tree, blob, commit) show the header too, so the reuse key now includes the CI status and the newest commit's age bucket (days for the first week, then weeks, months, years). Those pages are rebuilt when the pill's text or the live dot would change. Within the first day the hours can lag on reused pages; the repo home and log are rebuilt every time.</li> <li><strong>Commit log:</strong> commits are grouped by day (UTC) under sticky headers ("Today", "Yesterday", "Nov 14", with the year when it differs), one box per day. Each row has a coloured <code>+N −M</code> from one <code>git log --shortstat --diff-merges=first-parent</code> pass, matching the commit pages.</li> <li><strong>Hover and focus:</strong> cards lift onto a lighter background with an accent edge, and asset rows highlight like other rows. Focus rings inside boxes sit inside the edge so they aren't clipped. The ring itself is the shared <code>--accent-bright</code> one from Phase 1.</li> <li><strong>Empty states</strong> (no releases, pulls, packages or commits, an empty repo, no branches or tags) have a round icon, one line and a muted hint.</li> <li><strong>Motion:</strong> hover transitions are 120–180 ms, and the clone menu chevron rotates. Saturn's reduced-motion rule turns all of it off.</li> <li><strong>404:</strong> the pixel "404" in <code>--accent-bright</code>, links to the featured repos, and buttons back home and to all repositories.</li> <li><strong>Clone menu:</strong> the code box no longer clips the menu (<code>overflow: visible</code>). Its first child and last file row take the rounded corners instead.</li> <li>The fixture's newest commit moves to the morning of the fixed build day, so the goldens and <code>just demo</code> show live dots, "Today" and "new".</li> </ul> <h2 id="activity-bar-chart" tabindex="-1">Activity bar chart <a class="anchor" href="#activity-bar-chart">#</a></h2> <p><code>render.ActivityBars</code> replaces the plain weekly bars above the heatmap. It is one inline SVG (<code>class="bars"</code>, <code>role="img"</code>), with no JS and no inline styles: every part has its own class and its colour comes from tokens.</p> <ul> <li><strong>Shared x axis.</strong> The chart uses the heatmap's grid from <code>heatmap.go</code> (<code>left</code>, <code>cell</code>, <code>gap</code>, 53 columns, <code>colX</code>, <code>monthCols</code>) and the same first week, <code>WeekStart(end, 52)</code>. Both viewBoxes are <code>left + n*(cell+gap)</code> wide and drawn at <code>width: 100%; height: auto</code>, so each bar sits over its week at any width and the text isn't stretched. The bars are bucketed with <code>Weeks(times, now, 53)</code>. "Active in N of the last 52 weeks" and the streak still use the last 52.</li> <li><strong>Y axis.</strong> The step is the smallest of 1, 2, 5, 10, 20, 50 … that gives 2–3 lines (0 included) with the top line at or above the busiest week, for example 0/5/10 for a max of 6 and 0/10/20 for 15. Bars are linear on that scale, at least 4 units tall. Empty weeks are a 2-unit stub. Colour uses the heatmap's <code>level()</code> steps.</li> <li><strong>Markers, kept few:</strong> this week (an <code>--accent-bright</code> outline and "this week" under the right end of the baseline) and the streak (a bracket in <code>--syn-constant</code> under exactly the weeks <code>Streak</code> counts, so it ends last week while this week is still empty). Month rules sit in the gap before each heatmap month label. The streak has no label of its own, because the box head already says "6-week streak". A "busiest · Oct 18 · 15" dot and label were dropped after review for the same reason (busy). The busiest week stays in the aria-label.</li> <li><strong>Releases are not marked.</strong> A first version drew a dashed line, a diamond and the tag for each release, with labels staggered over two rows. It was dropped after review: the tags were detail nobody needed, and the label placement cost code. With one label left under the baseline, the chart is 118 units high.</li> <li><strong>Hover</strong> detail is SVG <code><title></code>s: a full-height hit rect per column holds "12 commits · week of Oct 18 – Oct 24", and the bar after it has <code>pointer-events: none</code>, so <code>.bars-hit:hover + .bars-bar</code> brightens it and the column gets a faint background. 120ms fill transitions, none under reduced motion.</li> <li><strong>Empty year:</strong> grid, month rules and stubs only, with "No commits in the last year" in the middle and no markers.</li> <li><strong>Small screens: two renders, toggled by CSS.</strong> Below 600px the profile shows a second chart and heatmap drawn for the last 26 weeks with the same column logic, and hides the full-year pair (<code>.heat-year</code> / <code>.heat-half</code>). The aria-labels keep the full-year summary. A sideways scroller that starts at the right (an <code>rtl</code> container) was the other option. It keeps one copy, but scrolls the y-axis labels and weekday labels out of view, which is the part that makes the chart readable. Each pair sits in one container with equal viewBox widths, so the chart and heatmap can't fall out of line. The cost is HTML: the profile went from 58.9 KB to 92.1 KB (7.1 KB to 10.1 KB gzipped), most of it the second heatmap.</li> </ul> <h2 id="served-at-codedanieldaumnet" tabindex="-1">Served at <a href="http://code.danieldaum.net">code.danieldaum.net</a> <a class="anchor" href="#served-at-codedanieldaumnet">#</a></h2> <p>The site moves from <code>daum.dev</code> to <code>code.danieldaum.net</code>. Everything host-specific already came from <code>site_url</code> (clone URLs, <code>go get</code> paths, image refs, the registry token realm) except the brand in the header, which now shows the host of <code>site_url</code> too. Go module paths follow the host: <code>go get code.danieldaum.net/<repo></code>. The fixtures and tests use the new host. The spec still says <code>daum.dev</code> throughout; read it as <code>site_url</code>.</p> <h2 id="palettes-shared-with-danieldaumnet-and-a-font-review-toggle" tabindex="-1">Palettes shared with <a href="http://danieldaum.net">danieldaum.net</a>, and a font review toggle <a class="anchor" href="#palettes-shared-with-danieldaumnet-and-a-font-review-toggle">#</a></h2> <ul> <li><strong>Why a cookie:</strong> <a href="http://danieldaum.net">danieldaum.net</a> keeps the palette in <code>sessionStorage</code> and <code>localStorage</code> under <code>theme</code>. Those are per origin, so <code>code.danieldaum.net</code> can't read them. A cookie set for <code>Domain=danieldaum.net</code> is visible to both. <code>/static/theme.js</code> reads a <code>theme</code> cookie first, then this site's own <code>sessionStorage</code>, and otherwise moves to the next palette after the last visit, like saturn's <code>theme.js</code>. It writes all three whenever it picks one. The cookie is a session cookie with <code>SameSite=Lax</code>, and <code>Secure</code> on https. On an IP or <code>localhost</code> it's host-only. The server never reads it.</li> <li><strong>Saturn's side</strong> needs the same cookie read and write (about 10 lines in its <code>theme.js</code>). Until that ships, each site rotates palettes on its own.</li> <li><strong>Footer:</strong> a <code>theme</code> button cycles moss → ink → wine → plum → teal, as on <a href="http://danieldaum.net">danieldaum.net</a> (flexoki stays out of the cycle there too). The buttons have <code>hidden</code> and <code>theme.js</code> reveals them, since <code>[data-theme]</code> is always set here from config. Saturn shows its button on that attribute instead.</li> <li><strong>No flash:</strong> <code>theme.js</code> loads in <code><head></code> without <code>defer</code>, so the palette is set before the first paint. It's same-origin, so the CSP is unchanged (<code>script-src 'self'</code>, nothing inline). Without JS, the page keeps the palette from config. The cache-busting <code>?v=</code> hash now covers <code>style.css</code>, <code>theme.js</code> and <code>copy.js</code>.</li> <li><strong>Font: Geist Pixel for all text,</strong> as on <a href="http://danieldaum.net">danieldaum.net</a>, chosen after a short review with a footer toggle (since removed). Code and hashes stay Geist Mono, because pixel type is proportional and code columns would drift. Geist Pixel is declared for every weight, as in saturn, so bold text isn't faked and emphasis comes from colour. The Geist font is gone. This reverses "Text is Geist" from the polish pass.</li> <li><strong>Width:</strong> repo pages (<code>page--code</code>) are up to 60rem wide, down from 68rem, and every other page (profile, repos, 404) is up to 50rem. Saturn's 78ch is gone here: <code>ch</code> follows the font, and with Geist Pixel it grew to about 73rem.</li> </ul> <h2 id="giteas-icons-again" tabindex="-1">Gitea's icons again <a class="anchor" href="#giteas-icons-again">#</a></h2> <p>Phosphor read worse than the Material icons the site had before, so the icons are Gitea's own again: material-icon-theme for files and folders, Octicons for the UI.</p> <ul> <li><strong>Files:</strong> the same 153-icon subset of material-icon-theme as before Phase 3, plus <code>folder-open</code> for the current folder in breadcrumbs. It is npm <code>material-icon-theme@5.40.0</code>, which reproduces the old files and tables byte for byte. Lookup is the old one: the lowercased name, then extensions longest first (<code>a.test.ts</code> tries <code>test.ts</code>, then <code>ts</code>), and folders by name (<code>docs</code>, <code>cmd</code>, <code>.github</code> get their own folder icons). The icons keep their own colours, as on Gitea, so they don't follow <code>data-theme</code>. The <code>.r-*</code> colour roles are gone.</li> <li><strong>UI:</strong> Octicons 16px from <code>@primer/octicons@19.15.0</code>, GitHub's set, which Gitea uses too. Templates keep their own names (<code>pull</code>, <code>fire</code>, <code>user</code>…), and <code>scripts/icons.py</code> maps them to Octicons (<code>git-pull-request</code>, <code>flame</code>, <code>person</code>…). Document tabs use GitHub's glyphs where it has one: Code of conduct <code>code-of-conduct</code>, Funding <code>heart</code>, Governance <code>organization</code>, Support <code>comment-discussion</code>, Citation <code>quote</code>. CI pending is <code>dot-fill</code>.</li> <li><strong>Still a per-page sprite</strong>, not <code><img></code> as before Phase 3: icons are <code><symbol></code>s inlined into the pages that use them, so nothing is fetched and the CSP is unchanged. Material icons reuse ids (<code>a</code>, <code>folder</code>, <code>motive</code>) and refer to them (<code>url(#a)</code>, <code>xlink:href="#a"</code>). The loader prefixes every id inside an icon with its symbol id (<code>xf-kotlin-a</code>), so they can't clash on one page. A test checks there are no bare ids and no inline styles.</li> <li><strong>Root attributes:</strong> six icons (document, readme, changelog, log, settings, just) set <code>fill="none"</code> on their <code><svg></code> to hide a 24×24 background path, and editorconfig sets <code>clip-rule</code> there. The loader copies the root's presentation attributes onto the <code><symbol></code>. Without that, the background drew as a black square. The editorconfig logo itself is black, as on Gitea.</li> <li><code>just icons <material-icon-theme dir> <octicons dir></code> regenerates both sets from extracted npm packages. The repo home grew from 29.0 KB to 35.1 KB before compression, since Material paths are longer.</li> </ul> <h2 id="user-name-case-and-avatar-caching" tabindex="-1">User name case and avatar caching <a class="anchor" href="#user-name-case-and-avatar-caching">#</a></h2> <ul> <li>Gitea user names keep their case for display ("Daniel") but match in any case, in the API and in git URLs. Image refs must be lowercase, so <code>user</code> from config is lowercased when it loads. Clone paths, registry routes and <code>docker pull</code> refs use the lowercase name. The profile shows the login and full name as Gitea returns them.</li> <li>The avatar is downloaded on every build and saved as <code>/static/avatar-<hash>.<ext></code>, a hash of its bytes. <code>/static/</code> is cached for a day, so a fixed name would keep showing the old avatar after a change.</li> </ul> <h2 id="responsive-pass-after-geist-pixel" tabindex="-1">Responsive pass after Geist Pixel <a class="anchor" href="#responsive-pass-after-geist-pixel">#</a></h2> <p>Checked in headless Chromium at 1280px and 390px on the profile, repos, repo home, file, log, commit, releases and packages pages. No page scrolls sideways at either width.</p> <ul> <li><strong>Repo cards:</strong> the name keeps its width and the "N commits this week" pill and release badge wrap under it, instead of the name shrinking to "repo…". The pill doesn't wrap inside itself.</li> <li><strong>Tabs:</strong> saturn's <code>nav { flex-wrap: wrap }</code> made the repo tabs wrap into ragged rows on phones. They now scroll sideways, like Gitea's and GitHub's on mobile. Below 600px the repo tabs and the README box's document tabs fade out at the right edge to show there's more, with room to scroll the last tab clear of the fade.</li> <li><strong>Clone menu:</strong> stays anchored to the right of the Clone button at every width, so it opens leftward and fits. The old small-screen rule anchored it left and pushed it off screen.</li> <li><strong>Commit rows:</strong> below 600px the <code>+N −M</code>, CI and hash move to a second line under the subject, so subjects aren't cut to a few letters.</li> <li><strong>Avatar:</strong> 160px, a rounded square (<code>--radius</code>) as on Gitea instead of a circle. Small avatars stay round.</li> <li><code>just demo</code> used to 404 on the newest commit page: the golden test moved that page to <code>commit-latest.html</code>. It copies it now.</li> </ul> <h2 id="the-chrome-is-danieldaumnets" tabindex="-1">The chrome is <a href="http://danieldaum.net">danieldaum.net</a>'s <a class="anchor" href="#the-chrome-is-danieldaumnets">#</a></h2> <p>The site is served at <a href="http://code.danieldaum.net">code.danieldaum.net</a> and will move to <a href="http://danieldaum.net/projects">danieldaum.net/projects</a>, so it must read as part of that site. The header, footer and favicon are now exactly saturn's, hard-coded in <code>base.html</code>:</p> <ul> <li><strong>Header:</strong> the name is "Daniel Daum", linking to <a href="http://danieldaum.net">danieldaum.net</a>, and the nav is about, blog, projects, garden. The three main-site links are absolute (a relative <code>/about/</code> would 404 on <a href="http://code.danieldaum.net">code.danieldaum.net</a>); the "projects" link points at <code>/</code> (this site's home) and carries <code>aria-current="page"</code>. When the site moves under <a href="http://danieldaum.net/projects">danieldaum.net/projects</a>, the absolute links stay right, but the internal ones need a base path.</li> <li><strong>Footer:</strong> saturn's, verbatim: email, git (Tangled, new tab), PGP, changelog, privacy, feed, theme button. All absolute, since the pages live on <a href="http://danieldaum.net">danieldaum.net</a>. The mobile hide-rules match the path (<code>a[href$="/pgp.asc"]</code>) because the urls aren't bare paths, as in saturn.</li> <li><strong>Profile page:</strong> the profile card (avatar, name, bio) is gone. The home page opens with saturn's /projects page header (<code>/projects</code> and "Things I've built or projects in development"), the same meta description and the title "daniel daum - projects". The avatar is still downloaded: the activity feed uses it for own events.</li> <li><strong>Favicon:</strong> saturn's favicon pngs and webmanifest (icon paths rewritten to <code>/static/favicon/</code>) live in <code>web/static/favicon/</code>. The server serves <code>.webmanifest</code> as <code>application/manifest</code>.</li> <li><strong>Config:</strong> the <code>links</code> map is gone. The chrome is fixed, not configured. <code>site_url</code> still drives clone urls, <code>go get</code> paths and image refs.</li> <li><strong>Width and background:</strong> <code>body</code> is saturn's again: <code>78ch</code> wide (about 73rem in Geist Pixel at 16px), 16px, <code>--background-dark</code>. With the old 50rem and 60rem widths the header nav and footer jumped sideways when coming from <a href="http://danieldaum.net">danieldaum.net</a>, and the darker grey page background showed too. The code browser's own 15px type now starts at <code>main</code>. Every page is the same width, so <code>Page.Wide</code> and <code>page--code</code> are gone. This replaces the "Width" bullet under "Palettes shared with <a href="http://danieldaum.net">danieldaum.net</a>".</li> <li><strong>Layers:</strong> <code>--page</code> is <code>--background-dark</code>. The other layers mix it with white (box 2%, box head 5%, hover 8%, rule 14%, edge 20%, line 24%), close to the old Paint lightness steps above the page, keeping the palette's hue. The contrast test passes in every palette (lowest: secondary text on hover, 5.21:1).</li> <li><strong>Titles and head:</strong> every title is <code>daniel daum - <page></code>, as on saturn ("daniel daum - repo-a", "daniel daum - <a href="http://README.md">README.md</a> · repo-a"). Every page links saturn's Atom feed, and pages with a description (the home page) carry saturn's Open Graph and Twitter card tags.</li> <li><strong>Breadcrumbs:</strong> repo pages and <code>/repos/</code> open with saturn's breadcrumb (<code>projects -> repo-a</code>), like saturn's project and tracker pages. It keeps saturn's capitals. The repo title is just the name: the owner, avatar and slash are gone. <code>/repos/</code> uses saturn's page header (<code>/repositories</code>). The in-repo path crumbs stay as they were.</li> <li><strong>404:</strong> saturn's wording, "this page doesn't exist", and its title.</li> <li><strong>Activity feed:</strong> one rule only. The line through the avatars and the commit list's left rule drew two parallel lines. The commit rule stays, as on saturn's comment replies.</li> <li><strong>Palette:</strong> saturn's <code>theme.js</code> still needs the cookie (see "Palettes shared with <a href="http://danieldaum.net">danieldaum.net</a>"). Until then the two sites can show different palettes, which is the most visible seam left.</li> </ul> <h2 id="readme-html-an-allowlist" tabindex="-1">README HTML: an allowlist <a class="anchor" href="#readme-html-an-allowlist">#</a></h2> <p>GitHub-style READMEs open with raw HTML (<code><p align="center"><img …></p></code>, <code><h1 align="center"></code>). With goldmark's raw HTML switched off, rhea's screenshot, title and tagline were dropped. This bends spec rule 5: raw HTML is still never passed through, but <code>internal/render/rawhtml.go</code> rebuilds an allowlist of it.</p> <ul> <li><strong>Tags:</strong> p, div, h1–h6, img, a, br, hr, b, i, em, strong, code, kbd, sub, sup, s, del, pre, blockquote, ul, ol, li, details, summary. Others are dropped and their text kept, except script-like tags (script, style, iframe, svg, textarea …), whose contents go too. Comments are dropped.</li> <li><strong>Attributes:</strong> <code>align</code> (left, center, right) on blocks and img; img <code>src</code>, <code>alt</code>, <code>title</code>, <code>width</code>, <code>height</code> (digits, optional <code>%</code>); a <code>href</code>, <code>title</code>; details <code>open</code>. Everything else goes, so no <code>style</code>, <code>class</code>, <code>id</code> or <code>on*</code>, and the CSP is unchanged.</li> <li><strong>URLs:</strong> <code>src</code> and <code>href</code> go through the same resolver as Markdown images and links (relative paths to <code>raw/</code> and <code>blob/</code>, images relative or https only). An href must be relative, http(s) or mailto. An image without a usable src becomes its alt text, like a dropped Markdown image.</li> <li><strong>Text</strong> is unescaped and re-escaped, so nothing in it can form a tag.</li> <li><strong>Balance:</strong> open tags are tracked over the whole README, so a <code><div align="center"></code> … <code></div></code> around Markdown works. A close tag that was never opened is ignored, so README HTML can't end the page's own elements, and whatever is still open is closed at the end.</li> <li>No new dependency: the tags are read with two regular expressions, which is enough because the output is built from scratch, never copied.</li> </ul> <h2 id="release-010-name-deploy-folder-base-path" tabindex="-1">Release 0.1.0: name, deploy folder, base path <a class="anchor" href="#release-010-name-deploy-folder-base-path">#</a></h2> <ul> <li><strong>Name:</strong> the project is "showcase". The binary, <code>cmd/showcase</code>, the compose service and the image (<code>git.danieldaum.net/daniel/showcase</code>) use it. The Go module path stays <code>daum.dev/showcase</code>, since nothing imports it from outside.</li> <li><strong>Deploy folder:</strong> <code>deploy/</code> holds the production <code>config.json</code> (no secrets: the builder is anonymous), <code>compose.yaml</code>, the saturn patch and the runbook. The root <code>config.json</code> stays gitignored, for <code>just run</code>.</li> <li><strong>Images:</strong> <code>just release <version></code> builds linux/amd64 and linux/arm64 with buildx and pushes <code><version></code> and <code>latest</code>. It refuses a dirty tree or a HEAD not tagged <code>v<version></code>. The Dockerfile's build stage runs on <code>$BUILDPLATFORM</code> and cross-compiles, so only the small runtime stage is emulated. Both base digests are multi-arch indexes.</li> <li><strong>Mirrors follow <code>gitea_url</code>:</strong> <code>gitx.Mirror</code> resets <code>origin</code> to the configured URL before each fetch. Before, a mirror kept fetching the address it was cloned from, so moving Gitea to the tailnet would have broken every repo until the volume was wiped.</li> <li><strong><code>base_path</code></strong> (<code>/projects</code>, or empty for the root) serves the pages under one path segment, for <a href="http://danieldaum.net/projects">danieldaum.net/projects</a> through saturn's Pages Function. <ul> <li>Links: templates and the builder still write root-relative links. One pass in <code>render.Write</code> prefixes every root-relative <code>href</code> and <code>src</code> (<code>/repo-a/</code> → <code>/projects/repo-a/</code>), README links included, so no link can be missed. html/template always quotes attributes with <code>"</code> and escapes quotes in text and values, so only real attributes match. <code>//host</code> links are left alone. <code>TestBasePathLinks</code> fails if any page links outside the base.</li> <li>Server: paths under the base are served with it stripped. Anything else redirects into the base (<code>/repo-a/</code> → <code>/projects/repo-a/</code>), so old links keep working. Clone, <code>docker pull</code>, release downloads, <code>go get</code> (<code>?go-get=1</code>) and <code>/healthz</code> stay at the root: module paths and image refs can't move, and Pages Functions only forward GET and HEAD.</li> <li>Release downloads link to <code>site_url</code> when a base is set, since <a href="http://danieldaum.net">danieldaum.net</a> doesn't forward them.</li> <li>The webmanifest's paths are relative, so they work under either.</li> <li>Validation: one lowercase segment, not a reserved name or a repo name.</li> </ul> </li> <li><strong>Saturn side</strong> (<code>deploy/saturn/saturn.patch</code>): <code>theme.js</code> shares the palette through the <code>theme</code> cookie, <code>social/functions/projects/</code> redirects <code>/projects/*</code> to <a href="http://code.danieldaum.net">code.danieldaum.net</a> (<code>MODE = "redirect"</code>) or proxies it (<code>"proxy"</code>), <code>_routes.json</code> adds <code>/projects</code>, and <code>isLikeable</code> drops <code>/projects/</code>. The proxy forwards GET and HEAD only, to a fixed origin, without cookies, and returns upstream redirects as they are. Showcase's security headers pass through; saturn's <code>_headers</code> don't apply to Function responses. Tested with Node in front of a <code>base_path</code> build: all 66 pages and their links work through it.</li> </ul> <h2 id="language-bar-tree-rules-and-env-pages" tabindex="-1">Language bar, tree rules and <code>.env</code> pages <a class="anchor" href="#language-bar-tree-rules-and-env-pages">#</a></h2> <ul> <li><strong>Language bar:</strong> the bar shows Gitea's numbers as they are. Gitea reads linguist attributes, so wrong stats get fixed in the repo being shown, not in showcase. This repo's <code>.gitattributes</code> marks <code>gitea/</code> (copied Gitea themes) and <code>testdata/</code> (goldens) as vendored and <code>icons_gen.go</code> as generated. Before that, the themes made showcase read as mostly CSS. Gitea recounts on the next push.</li> <li><strong>File tree rules:</strong> the commit message fade (<code>mask-image</code>) sits on the link inside <code>.f-msg</code>, not on the cell. A mask on the cell faded its top border too, so each row's rule broke off under the message column.</li> <li><strong><code>.env</code> pages:</strong> <code>/<repo>/blob/.env</code> renders and is served like any other file. In production, the reverse proxy in front of the container answers every path ending in <code>/.env</code> with an empty 403 (no showcase headers, missing files too), and browsers show that as a blank page. It looks like a WAF rule against <code>.env</code> leaks (for example CrowdSec's <code>vpatch-env-access</code>). Fix it there with an exception for this host, not by renaming routes in showcase.</li> </ul> <h2 id="issues-and-comments" tabindex="-1">Issues and comments <a class="anchor" href="#issues-and-comments">#</a></h2> <p>The spec lists issues and comments as non-goals. Daniel asked for both, so they're in, read-only like pulls.</p> <ul> <li><strong>Issues tab</strong> (<code>/<repo>/issues/</code>), between Releases and Pulls: the 50 newest issues (<code>/issues?state=all&type=issues</code>; the issues API has no sort option). Gitea's issues API returns pulls too, so anything with <code>pull_request</code> set is dropped. The heading counts open and closed issues; labels are plain pills, since the CSP allows no inline colors.</li> <li><strong>Comments</strong> on issues and pulls, oldest first, from <code>/issues/{n}/comments</code>, fetched only when the item's <code>comments</code> count is above zero. That endpoint only returns real comments, not timeline events. Bodies come from anyone, so they go through the same Markdown allowlist as READMEs; the fixture's comment carries a <code><script></code> and a <code>javascript:</code> link to prove it.</li> <li><strong>Public only:</strong> the calls are anonymous, so only issues of public repos are seen. Gitea has no confidential issues within a public repo.</li> <li><strong>Read-only:</strong> the page says issues can't be opened or answered here.</li> <li><strong>Activity:</strong> opened issues join the profile feed.</li> <li>Icons: Octicons <code>issue-opened</code>, <code>issue-closed</code> and <code>comment</code> (19.15.0), added to <code>scripts/icons.py</code>.</li> </ul> <h2 id="a-gitea-token-for-the-packages-api-only" tabindex="-1">A Gitea token, for the packages API only <a class="anchor" href="#a-gitea-token-for-the-packages-api-only">#</a></h2> <p>Security rule 1 says the generator uses no token. Gitea 28 wants one to list packages, and non-container packages are coming, so there's now one narrow exception. Nothing uses it until <code>gitea_token_file</code> is set.</p> <ul> <li><strong>Config:</strong> <code>gitea_token_file</code> names a file holding the token (a Docker secret or a read-only mount), so config.json stays free of secrets. The token can't be set in config.json itself, and it's never marshalled.</li> <li><strong>One endpoint:</strong> <code>gitea.Client</code> sends the token only when a call asks for it (only <code>Packages</code> does) and the path is the user's package listing (<code>/api/v1/packages/<user>?…</code>). Any other path asking for it is refused before a request goes out. Repos, issues, pulls, comments, avatars, mirrors and the git and registry proxies stay anonymous: they never see the token. Add more endpoints to <code>tokenPath</code> one at a time.</li> <li><strong>No redirects:</strong> the client already refuses them, so the token is never replayed elsewhere.</li> <li><strong>Filter:</strong> with a token, the listing can include private packages. Only packages linked to a repo that loaded anonymously, and not private, are kept. The builder passes those repo names, not the config list, so a private repo in config never lets its packages through.</li> <li><strong>Not yet:</strong> packages linked to no repo are still dropped, and downloads still need a route. Both come with the packages work.</li> <li>Tests: <code>internal/gitea</code> proves the header only reaches the package listing, never follows a redirect, and is absent without a token; <code>internal/config</code> covers the file handling.</li> </ul> <h2 id="tab-bars-that-fit" tabindex="-1">Tab bars that fit <a class="anchor" href="#tab-bars-that-fit">#</a></h2> <p>With issues added, a repo using everything overflowed both tab rows on desktop. The content column is 631px (78ch of Geist Pixel at 16px, less padding). Measured from the font's glyph advances: the repo tabs needed 772px (808px with four-digit counts), the README box's tabs 716px for repo-a's six documents and 1,202px for all eleven kinds.</p> <ul> <li><strong>Commits tab, without its count.</strong> The header's "N commits" pill already shows the number. Tabs are a little tighter (0.85rem, 0.45rem side padding, no gap, smaller count pills): 592px for repo-a, 610px with large counts (issues and pulls are capped at 50). Only the current tab is bold, which adds a few pixels at most.</li> <li><strong>Compact document tabs.</strong> Up to four documents keep their labels (the four longest take 516px). From five on, only the open tab shows its label; the others are icons with a <code>title</code>, and the label stays in the page for screen readers. All eleven take 496px, so they never scroll on desktop. On hover a tab's icon lights up and a faint underline shows, so icon-only tabs read as clickable. Phones still scroll both rows with the edge fade.</li> </ul> <h2 id="second-security-review" tabindex="-1">Second security review <a class="anchor" href="#second-security-review">#</a></h2> <p>Details in <code>docs/security.md</code>. The decisions: the proxy forwards an allowlist of request headers instead of stripping a denylist; git proxying is capped at 8 concurrent requests (503 beyond); registry blobs are always downloads; issue, pull and comment bodies are cut at 32 KB and threads show their newest 100 comments.</p> <h2 id="a-quieter-code-bar" tabindex="-1">A quieter code bar <a class="anchor" href="#a-quieter-code-bar">#</a></h2> <p>On an iPhone the repo tabs overlapped: Safari shrank the scrolling tabs below their content, so each icon sat on the previous word. Even where they fit, six icons, six labels and four count pills under a wrapping language legend made the top of the code box busy. This replaces "Tab bars that fit" for the repo tabs; the README box's document tabs are unchanged.</p> <ul> <li><strong>Plain words.</strong> The repo tabs drop their icons and read like the site nav above them: secondary text, the open tab in <code>--accent-bright</code> with an underline as wide as the word, 1.5rem apart (1.25rem on phones). Counts are small secondary numerals, not pills. <code>flex: none</code> on each tab stops Safari's squeeze.</li> <li><strong>Only tabs with something in them.</strong> Code and Commits always show. Releases, Issues, Pulls and Packages show when they have at least one item, or when they're the open page (an old link to an empty page still says where you are). The pages themselves still exist.</li> <li><strong>Three languages and "other".</strong> <code>langBar</code> keeps the three largest languages instead of six; the rest join "other", in the legend and the strip. On phones the legend is 0.75rem with 0.75rem gaps.</li> <li><strong>Widths</strong> (Geist Pixel advances, as before): all six tabs with counts take 448px of the 631px column. On a 390px phone (358px of content) the showcase repo's three tabs take 202px; all six take 428px and scroll with the edge fade. The legend for Go, CSS, HTML and other takes 335px on a phone, so it stays on one line down to 375px screens.</li> <li>Not checked in a real browser in this pass: the numbers come from the font's metrics, not a render.</li> </ul> <h2 id="images-built-by-gitea-actions" tabindex="-1">Images built by Gitea Actions <a class="anchor" href="#images-built-by-gitea-actions">#</a></h2> <p><code>.gitea/workflows/release.yml</code> builds and pushes the image when a tag <code>v*.*.*</code> is pushed, then creates the Gitea release. Tagging and deploying stay manual: the server runs the digest pinned in <code>deploy/compose.yaml</code>, never <code>latest</code>, so nothing reaches it that Daniel didn't pin.</p> <ul> <li><strong>amd64 only.</strong> The server is amd64. The image used to be built for arm64 too, because <code>just release</code> ran on the Mac (Apple silicon). That needed QEMU: Go cross-compiles natively, but the runtime stage's <code>apk add</code> runs as the target arch. Nothing runs the arm64 image, so it and QEMU are gone, here and in <code>just release</code>. Locally there's <code>just image</code> and <code>just demo</code>.</li> <li><strong>Plain docker commands</strong>, no actions beyond checkout (pinned to a commit). The newest Docker actions need Node 24, and the runner was only shown to run Node 20 (<code>actions/checkout@v4</code>). The digest comes from <code>docker push</code>'s output, which every image store prints, rather than <code>docker inspect</code>.</li> <li><strong>Tokens:</strong> only <code>REGISTRY_TOKEN</code> is made by hand (a Gitea token with <code>write:package</code>), since Gitea's run token isn't known to push packages. The release is written with the run token, <code>GITEA_TOKEN</code>. Both reach the scripts as environment variables, and the tag name is read from <code>$GITHUB_REF_NAME</code>, so nothing is interpolated into a script.</li> <li><strong>Registry host:</strong> Gitea moved to the tailnet (<code>code.aardvark-halibut.ts.net</code>), and <code>git.danieldaum.net/v2/</code> now answers 404. The workflow, the justfile, compose.yaml and the docs name the tailnet host. The pinned 0.1.0 digest is the same there (checked with crane). <ul> <li>Not <code>$GITHUB_SERVER_URL</code>: that's the runner's address for Gitea, <code>http://gitea:3000</code> (a Docker network name), which works inside the job container but not for the push. <code>docker push</code> is done by the Docker daemon on the runner's host, which resolves names like the host does. So that host must resolve and reach the tailnet name. The Gitea API call (the release) does run in the job container and keeps using <code>$GITHUB_SERVER_URL</code>.</li> </ul> </li> <li><strong>Manual runs:</strong> <code>workflow_dispatch</code> takes an existing tag. The workflow comes from the branch it runs on and checks out <code>refs/tags/<tag></code>, so a fixed workflow can release a tag whose own run failed. The tag must look like <code>v1.2.3</code>; anything else stops the run.</li> <li><strong>Release notes:</strong> the image with its digest (to pin in compose.yaml) and the commit subjects since the previous tag. A rerun rebuilds the image with a new digest, so an existing release is updated (PATCH) instead of created.</li> <li><strong>Not covered:</strong> tests (<code>just test</code> runs before committing) and the tag's signature. A signature check was tried and dropped: the workflow comes from the tagged commit, so it only stops tags made in Gitea's UI, and the digest pin already guards the server.</li> </ul> <h2 id="signed-commits" tabindex="-1">Signed commits <a class="anchor" href="#signed-commits">#</a></h2> <p>Signed commits get Gitea's lock badge: the short hash gets a green edge and a segment with a lock and the signer's avatar when Gitea verified the signature, or an open lock when it's signed but not verified. Unsigned commits look as before.</p> <ul> <li><strong>Gitea's verdict, not git's.</strong> One more anonymous call per repo, <code>/commits?sha=<HEAD>&limit=50&stat=false&files=false&verification=true</code>, paged up to <code>max_commits</code>. Gitea checks the signature against the keys of the user whose verified email committed it, so the badge matches Gitea's own. Checking locally would need the keys in an allowed-signers file, <code>ssh-keygen</code> and <code>gpg</code> in the image, and Gitea's email matching rules again.</li> <li><strong>What's kept:</strong> verified or not, the signer's Gitea name and the key (SSH fingerprint or GPG key ID, read from the <code>reason</code>, and only when it has that exact form). The signer's email, the signature and the payload are never decoded. The avatar shows only when the signer is the profile's user; other signers get the lock alone. The API has no trust status, so Gitea's yellow "untrusted" and red "warning" states aren't shown.</li> <li><strong>Where:</strong> every short hash of a commit on the log page (log rows, the repo's latest commit bar, the commit page, branches and tags). The commit page adds Gitea's signature bar: "Verified · signed by daniel with SSH key <code>SHA256:…</code>", or "Signed · Gitea couldn't verify the signature". The activity feed shows a small lock after verified hashes. Parent hashes stay plain, as on Gitea. Branches and tags pointing at older commits show no badge, since only the log page's commits are looked up.</li> <li><strong>Colour:</strong> <code>--add</code>, the CI pass green. <code>--sig</code> (12% of it over <code>--box</code>) is the badge segment and the bar; <code>--sig-edge</code> the border. The contrast test covers text on <code>--sig</code> (lowest: secondary text, 4.94:1).</li> <li><strong>Failure:</strong> 404/401/403 means no badges. Any other error fails the build, like the CI status call. Empty repos skip the call (Gitea answers 409).</li> <li><strong>Reuse key:</strong> includes the verdicts, so commit pages are rebuilt when a key is added in Gitea and old commits turn verified.</li> <li>Icons: Octicons <code>lock</code> and <code>unlock</code> (19.15.0), added to <code>scripts/icons.py</code>.</li> </ul> <h2 id="copy-a-file" tabindex="-1">Copy a file <a class="anchor" href="#copy-a-file">#</a></h2> <p>File pages get a copy button joined to Raw (<code>[Raw | ⧉]</code>), like GitHub's.</p> <ul> <li><strong>It copies the raw file.</strong> <code>copy.js</code> fetches the Raw link's URL and puts the bytes on the clipboard, so CRLF, mixed line endings and files too big to show (over 512 KB) all copy exactly. That needs <code>connect-src 'self'</code> in the CSP: the third change to spec rule 6, after <code>script-src 'self'</code>. It only lets this site's own scripts (<code>theme.js</code>, <code>copy.js</code>) request this origin. It adds no way out: an injected script could already send data anywhere through <code>img-src https:</code>, and the site holds nothing private. Under <code>base_path</code> the origin is <a href="http://danieldaum.net">danieldaum.net</a> and the Raw link is already rebased, so it works there too.</li> <li><strong>Safari</strong> only allows clipboard writes during the click, so the download is handed to <code>ClipboardItem</code> as a promise. Browsers without <code>ClipboardItem</code> get <code>writeText</code> after the download.</li> <li><strong>Which files:</strong> text with a raw copy, up to 5 MB (<code>maxCopy</code>). Images, binary files and files over 5 MB keep Raw alone.</li> <li><strong>Trailing blank lines:</strong> chroma drops the empty line after a final newline, so a file ending in blank lines showed one line too few. <code>Highlight</code> adds it back, and <code>TestHighlightKeepsText</code> checks the lines give back the source.</li> <li><strong>Hidden without JS, for real now.</strong> <code>.copy</code> and <code>.button</code> set <code>display</code>, which beat the <code>hidden</code> attribute, so the clone box's copy button showed without JS too, contrary to "Copy buttons need JS". <code>[hidden]</code> rules for both fix it.</li> </ul> <h2 id="this-week-on-the-bar-chart-clearer" tabindex="-1">This week on the bar chart, clearer <a class="anchor" href="#this-week-on-the-bar-chart-clearer">#</a></h2> <p>Production showed "1-week streak" with no bracket under the bars, and this week's bar looked like any other busy week. Both replace parts of "Markers, kept few" under "Activity bar chart".</p> <ul> <li><strong>The streak bracket is drawn from one week,</strong> not two, so it always matches the streak in the box head. A one-week bracket is a short underline under that week's bar.</li> <li><strong>This week's outline is <code>--text-headings</code>,</strong> not <code>--accent-bright</code>. The busiest weeks are filled with <code>--accent</code>, and <code>--accent-bright</code> (the accent with 18% white) barely showed on them.</li> </ul> <h2 id="saturns-new-footer-and-post-headers" tabindex="-1">Saturn's new footer and post headers <a class="anchor" href="#saturns-new-footer-and-post-headers">#</a></h2> <p>Saturn changed its footer and page headers, and showcase follows so <a href="http://danieldaum.net/projects">danieldaum.net/projects</a> stays seamless.</p> <ul> <li><strong>Footer:</strong> saturn's new links: email, source, ID, changelog, privacy, RSS, theme. "source" is <code>/saturn/</code>, showcase's own page for saturn, so it becomes <code>/projects/saturn/</code> under <code>base_path</code> and opens in the same tab. ID, changelog, privacy and RSS stay absolute <code>https://danieldaum.net/…</code> links. The 600px hide rule now matches <code>a[href$="/id/"]</code> where it matched <code>/pgp.asc</code>.</li> <li><strong>Headers, one rule:</strong> the big <code>/name</code> header is only for pages in the top nav, so only the home page (<code>/projects</code>) keeps it. Every other page uses saturn's post header, <code>.page-header--post</code>, with a kicker linking to its parent, and that kicker replaces the <code>projects -> …</code> breadcrumb. <ul> <li><code>/repos/</code>: kicker <code>/projects</code>, h1 "Repositories", the count sentence as <code>.meta</code>.</li> <li>Repo pages: kicker <code>/projects</code>, h1 the repo name (shown in capitals by saturn's caps rule), the description as <code>.meta</code>, then topics, stats and links as before. Every page in a repo (code, commits, a file, a commit, releases …) keeps this same header, so the tabs under it don't move. The tabs and the in-repo path crumbs show where you are inside the repo. The repo name in the h1 is no longer a link: the Code tab goes there.</li> </ul> </li> <li><strong>CSS:</strong> saturn's <code>.page-header-kicker</code> and <code>.page-header--post</code> rules are copied into part 1 of <code>style.css</code>. <code>.repo-title</code> only lays out the archived pill now. <code>.breadcrumb</code> stays in part 1 as saturn's copy, unused.</li> </ul>
- "pushed N commits to