Web presentation for CZ moderation service
README.md

moderace.atproto.cz #

Landing page and published rules for the Czech community labeler (@moderace.atproto.cz, did:plc:fzoxvf3f4lma7fwaswjy7fal).

Astro 7 + Tailwind 4. Static output, no server, no runtime dependencies — dist/ is a self-contained folder any static host can serve.


Změna textů (to je to, co většinou chcete) #

Všechny texty jsou v jediném souboru: src/data/content.ts.

V šablonách (src/pages, src/components) nejsou natvrdo žádné věty. Oprava překlepu nebo přeformulování pravidla znamená upravit jeden řádek v tom souboru.

npm install     # jednou
npm run dev     # náhled na http://localhost:4321, překresluje se při uložení
npm run build   # hotová stránka do dist/

Na co si dát pozor:

  • Apostrof v textu. Řetězce jsou v jednoduchých uvozovkách, takže větu obsahující ' uzavřete do dvojitých: "ne'co".
  • Odkazy a tučný text se v některých polích píšou jako HTML (jsou to pole, která se vykreslují přes set:html — poznáte je podle toho, že v nich už nějaké <strong> nebo <a> je). V ostatních se HTML vypíše jako text.
  • <code>Něco</code> vysází popisek ovládacího prvku aplikace.
  • Po změně pravidel zvyšte site.version a site.effectiveDate.

Pokud se build rozbije, text je pořád čitelný a upravitelný v content.ts — stránka se dá v nouzi vygenerovat i ručně z posledního dist/.


Layout #

src/data/content.ts        všechny texty  ← sem
src/styles/global.css      barvy (3 bloky: světlý / systémově tmavý / ručně tmavý)
src/layouts/Base.astro     <head>, fonty, meta
src/components/            LabelDemo, LabelCard, Callout
src/pages/index.astro      složení stránky

Colors are CSS custom properties mapped to Tailwind utilities via @theme inline, so bg-surface / text-ink follow the theme. Change a colour in :root and all three theme states follow. Fonts are self-hosted via @fontsource-variable.

Deploy — Cloudflare Pages #

Source of truth is Tangled; .tangled/workflows/deploy.yml builds on every push to main and uploads dist/ to Cloudflare Pages. Cloudflare's own Git integration only auto-builds from GitHub/GitLab, so this is a Pages Direct Upload project driven by wrangler.

One-time setup #

npx wrangler login
npx wrangler pages project create moderace-atproto-cz --production-branch main

Then in the Cloudflare dashboard → Workers & Pages → moderace-atproto-cz → Custom domains, add moderace.atproto.cz. DNS for atproto.cz is already on Cloudflare, so the record is created for you. Leave it proxied — the grey-cloud rule applies to ozone.atproto.cz (its subscribeLabels WebSocket dies on Cloudflare's idle timeout), not to a static page.

Finally, in Tangled repo Settings → Secrets:

Secret Value
CLOUDFLARE_API_TOKEN API token with the Cloudflare Pages: Edit permission
CLOUDFLARE_ACCOUNT_ID Account id, visible in the dashboard URL

wrangler reads both straight from the environment. Tangled secret names cannot contain -, which is why these use underscores.

Deploying by hand #

If CI is down or you want to push a fix immediately:

npm run build
npm run deploy

Why not the Ozone VPS #

This page tells people how to appeal a label and who to email. It needs to be up exactly when the labeler is not, so it deliberately does not share a failure domain with it. dist/ is portable, though — if you ever need to, copy it to /ozone/caddy/etc/caddy/site/ and add a moderace.atproto.cz block to the Caddyfile.

npm audit #

npm audit reports a high-severity advisory in http-cache-semantics, pulled in transitively by Astro. npm audit fix --force "fixes" it by downgrading Astro to 2.10.9 — don't. It is a build-time dependency, nothing from it reaches the browser, and the output is static HTML.

Contributing identity #

Commits in this repo are authored as Moderace atproto.cz <moderator@atproto.cz>, not under personal accounts — same reasoning as the "Kdo službu provozuje" section of the page itself: individual moderation decisions should not be attributable to individual people.

jj and git both keep their identity in untracked config (.jj/repo/config.toml, .git/config), so this cannot be enforced by the repo — every contributor has to set it after cloning:

jj config set --repo user.name  "Moderace atproto.cz"
jj config set --repo user.email "moderator@atproto.cz"
jj config set --repo signing.behavior drop

# plain git, if you use it directly
git config user.name  "Moderace atproto.cz"
git config user.email "moderator@atproto.cz"

The signing.behavior drop line matters: an SSH-signed commit embeds the signer's public key, and a public key published anywhere else (GitHub serves them at github.com/<user>.keys) ties the anonymous author back to a person. Signing is off here on purpose.

If an existing commit has the wrong author:

jj metaedit --author "Moderace atproto.cz <moderator@atproto.cz>"