garage44.eu/jeroen/cartopolis

logclone: git clone https://garage44.eu/jeroen/cartopolis.git

.. /docs/mockups/external-sign-in/v2-free.html

raw

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Sign in with free alternatives too, v2</title>
<link rel="stylesheet" href="style.css">
</head>
<body>

<svg width="0" height="0" style="position:absolute">
  <defs>
    <symbol id="google" viewBox="0 0 48 48">
      <path fill="#EA4335" d="M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z"/>
      <path fill="#4285F4" d="M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z"/>
      <path fill="#FBBC05" d="M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z"/>
      <path fill="#34A853" d="M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z"/>
    </symbol>
    <symbol id="github" viewBox="0 0 16 16"><path fill="currentColor" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.530 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.150 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"/></symbol>
    <!-- simplified marks, for the mockup only -->
    <symbol id="codeberg" viewBox="0 0 24 24"><path fill="#2185D0" d="M12 3L1.5 20.5h21z" opacity=".55"/><path fill="#2185D0" d="M12 3l-4.2 17.5h8.4z"/></symbol>
    <symbol id="mastodon" viewBox="0 0 24 24"><rect x="2" y="2" width="20" height="20" rx="6" fill="#6364FF"/><path d="M7.5 16V10a2.25 2.25 0 0 1 4.5 0v3M12 13v-3a2.25 2.25 0 0 1 4.5 0v6" fill="none" stroke="#fff" stroke-width="2" stroke-linecap="round"/></symbol>
    <symbol id="forgejo" viewBox="0 0 24 24"><g fill="none" stroke-width="2.6" stroke-linecap="round"><path d="M7 21V9a4 4 0 0 1 4-4h6" stroke="#FF6600"/><path d="M7 21v-4a4 4 0 0 1 4-4h6" stroke="#D40000"/></g><circle cx="18" cy="5" r="2.6" fill="none" stroke="#FF6600" stroke-width="2"/><circle cx="18" cy="13" r="2.6" fill="none" stroke="#D40000" stroke-width="2"/><circle cx="7" cy="21" r="0.1"/></symbol>
    <symbol id="lock" viewBox="0 0 24 24"><rect x="5" y="11" width="14" height="10" rx="2.5"/><path d="M8 11V8a4 4 0 0 1 8 0v3"/></symbol>
    <symbol id="key" viewBox="0 0 24 24"><circle cx="8" cy="15" r="4"/><path d="M11 12l8-8M16 7l2.5 2.5M14 9l2 2"/></symbol>
    <symbol id="info" viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><path d="M12 11v6M12 7.5v.5"/></symbol>
    <symbol id="globe" viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3c3 3.5 3 14.5 0 18M12 3c-3 3.5-3 14.5 0 18"/></symbol>
  </defs>
</svg>

<h1>Sign in with <b>free alternatives</b> too</h1>
<p class="lede">
  v2 of <code>v1.html</code>: the same flow, with free, non-commercial providers beside Google and GitHub.
  <b>Codeberg</b> (a non-profit Forgejo host), <b>Mastodon and the fediverse</b> (any server, typed in by
  the person), and <b>a community's own login server</b> (any OpenID server, such as
  code.garage44.eu's Forgejo, Keycloak or Authentik), added by the operator. Everything not shown here is as
  in v1. Everything is <span class="new">NEW</span>.
</p>

<!-- ───────────────────────── 1. the card ───────────────────────── -->
<section class="sec">
  <h2><span>1</span>One grid of ways in, free ones first</h2>
  <p class="cap">The v1 card with four providers no longer fits as full-width buttons, so they become a two-column grid. The operator sets the order; cartopolis.org lists the free ones first.</p>
  <div class="row">
    <div class="win">
      <div class="bar"><div class="dots"><i></i><i></i><i></i></div><div class="url"><svg class="i" style="width:13px;height:13px"><use href="#lock"/></svg><b>cartopolis.org</b>/buildings</div></div>
      <div class="page">
        <div class="card">
          <div class="hd">Sign in</div>
          <div class="bd">
            <p>One account for the world and for this page.</p>
            <div class="prov ring">
              <div class="btn"><svg class="logo"><use href="#codeberg"/></svg>Codeberg</div>
              <div class="btn"><svg class="logo"><use href="#mastodon"/></svg>Mastodon</div>
              <div class="btn"><svg class="logo"><use href="#google"/></svg>Google</div>
              <div class="btn"><svg class="logo" style="color:#fff"><use href="#github"/></svg>GitHub</div>
              <div class="btn wide"><svg class="logo"><use href="#forgejo"/></svg>garage44<small>code.garage44.eu</small></div>
            </div>
            <div class="or">or with your Cartopolis name</div>
            <div class="field"><label>Username</label><div class="input ph">anna</div></div>
            <div class="field"><label>Password</label><div class="input ph">••••••••</div></div>
            <div class="btn primary">Sign in</div>
            <div class="foot">New here? <a>Sign up</a></div>
          </div>
        </div>
      </div>
    </div>
    <div class="notes">
      <h3>The providers</h3>
      <ul>
        <li><b>Codeberg</b>: run by a German non-profit association on Forgejo. Standard OpenID Connect,
          and it gives a verified e-mail address, so it behaves exactly like Google in v1.</li>
        <li><b>Mastodon</b> stands for the whole fediverse (Mastodon, and the many servers that copy its
          sign-in: GoToSocial, Pleroma, Akkoma…). There is no single server to send you to, so it asks
          which one first (section 2).</li>
        <li><b>A community's own server</b> (<i>garage44</i> here): any OpenID server, with its name and logo
          set by the operator. A neighbourhood association, a school or a co-op that already runs
          Nextcloud, Keycloak or Forgejo can let its members in with the accounts they have.</li>
        <li><b>Google and GitHub</b> as in v1. Each one is still off until the operator configures it, so a
          server can offer only free ones, or none.</li>
      </ul>
      <h3>Why the grid</h3>
      <ul>
        <li>Five full-width buttons push the password form off a phone screen. Two columns keep every option the
          same size, so no provider looks like the default.</li>
      </ul>
    </div>
  </div>
</section>

<!-- ───────────────────────── 2. mastodon ───────────────────────── -->
<section class="sec">
  <h2><span>2</span>Mastodon: which server are you on?</h2>
  <p class="cap">One extra step. Your fediverse address tells us where to send you, and that server asks you to allow Cartopolis, as when signing in to a Mastodon app.</p>
  <div class="row">
    <div class="win" style="width:520px">
      <div class="bar"><div class="dots"><i></i><i></i><i></i></div><div class="url"><svg class="i" style="width:13px;height:13px"><use href="#lock"/></svg><b>cartopolis.org</b>/signin/fediverse</div></div>
      <div class="page">
        <div class="card">
          <div class="hd" style="display:flex;align-items:center;gap:10px"><svg class="logo" style="width:22px;height:22px"><use href="#mastodon"/></svg>Sign in with the fediverse</div>
          <div class="bd">
            <p>Mastodon, GoToSocial, Pleroma, Akkoma or any server that works with Mastodon apps.</p>
            <div class="field">
              <label>Your fediverse address or server</label>
              <div class="input focus">@anna@mastodon.nl</div>
              <div class="help ok">mastodon.nl answers. You'll go there to allow Cartopolis.</div>
            </div>
            <div class="list">
              <div class="label" style="margin:4px 0 0">Recently used here</div>
              <div class="who"><svg class="i"><use href="#globe"/></svg><div class="t">mastodon.social</div></div>
              <div class="who"><svg class="i"><use href="#globe"/></svg><div class="t">groningen.social</div></div>
            </div>
            <div class="btn primary">Continue to mastodon.nl</div>
          </div>
        </div>
      </div>
    </div>
    <div class="arrow">→</div>
    <div class="win" style="width:520px">
      <div class="bar"><div class="dots"><i></i><i></i><i></i></div><div class="url"><svg class="i" style="width:13px;height:13px"><use href="#lock"/></svg><b>cartopolis.org</b>/welcome</div></div>
      <div class="page">
        <div class="card">
          <div class="hd">Welcome to Cartopolis</div>
          <div class="bd">
            <div class="who">
              <div class="av" style="background:#6364FF">A</div>
              <div class="t">Anna de Vries<small>@anna@mastodon.nl · confirmed by mastodon.nl</small></div>
              <svg class="logo"><use href="#mastodon"/></svg>
            </div>
            <div class="field">
              <label>Your name here</label>
              <div class="input focus">anna<span class="suffix">@cartopolis.org</span></div>
              <div class="help ok">Free. This is how people find you in chat and calls.</div>
            </div>
            <div class="field">
              <label>E-mail <span style="color:var(--faint)">(optional)</span></label>
              <div class="input ph">for a lost-account reset</div>
              <div class="help">Mastodon doesn't tell us your address. Leave it empty and we'll never mail you.</div>
            </div>
            <div class="alert info"><svg class="i"><use href="#info"/></svg><div>Your profile will show <b>@anna@mastodon.nl</b> as confirmed, so people who follow you there know it's you.</div></div>
            <div class="btn primary">Create my account</div>
          </div>
        </div>
      </div>
    </div>
    <div class="notes" style="max-width:420px">
      <h3>How it differs from Google</h3>
      <ul>
        <li><b>Cartopolis registers itself with each server</b> the first time someone from it signs in
          (Mastodon's <code>POST /api/v1/apps</code>), and remembers that. The operator configures nothing
          for this one beyond turning it on.</li>
        <li><b>No e-mail address</b>: Mastodon's sign-in shares the account, not the address. So there's
          nothing to link on (v1 section 3 doesn't happen here), and the address is optional.</li>
        <li><b>A bonus that fits Cartopolis</b>: the fediverse handle shows as confirmed on your profile.
          The server already federates public posts (<code>fediverse-live</code>), so your followers can
          trust it's the same person.</li>
        <li><b>Servers can be refused.</b> The operator can block a server, using the same list it already uses
          for federation.</li>
      </ul>
    </div>
  </div>
</section>

<!-- ───────────────────────── 3. app ───────────────────────── -->
<section class="sec">
  <h2><span>3</span>In the app</h2>
  <p class="cap">The app's card takes the same grid. The rest of the hand-off to the browser and back is v1 section 4, unchanged. Mastodon's server question is asked in the browser, not in the app.</p>
  <div class="row" style="gap:28px">
    <div class="phone"><div class="screen"><div class="map"></div><div class="dim"></div>
      <div class="appcard" style="top:70px">
        <div class="t">Sign in to cartopolis</div>
        <div class="s">Sign in to share a world with other people</div>
        <div class="row2">Server<div class="input">cartopolis.org</div></div>
        <div class="prov ring">
          <div class="btn"><svg class="logo"><use href="#codeberg"/></svg>Codeberg</div>
          <div class="btn"><svg class="logo"><use href="#mastodon"/></svg>Mastodon</div>
          <div class="btn"><svg class="logo"><use href="#google"/></svg>Google</div>
          <div class="btn"><svg class="logo" style="color:#fff"><use href="#github"/></svg>GitHub</div>
          <div class="btn wide"><svg class="logo"><use href="#forgejo"/></svg>garage44</div>
        </div>
        <div class="or">or</div>
        <div class="row2">User<div class="input ph">your account name</div></div>
        <div class="row2">Password<div class="input ph">••••••</div></div>
        <div class="btn primary">Sign in</div>
        <div class="stat">Offline — the map only</div>
      </div>
    </div></div>
    <div class="notes">
      <h3>Notes</h3>
      <ul>
        <li><b>The grid comes from the server</b> (what <code>GET /api/register</code> lists), so a self-hosted
          server with only its community's login shows one button, and one with none shows today's card.</li>
        <li><b>Logos for the community's server</b> come from the Cartopolis server itself, so the app
          contacts no third party until you tap a button.</li>
      </ul>
    </div>
  </div>
</section>

<!-- ───────────────────────── 4. account page ───────────────────────── -->
<section class="sec">
  <h2><span>4</span>Ways to sign in, with the free ones</h2>
  <p class="cap">v1 section 5 with the longer list. Same rule: never zero ways in.</p>
  <div class="row">
    <div class="win">
      <div class="bar"><div class="dots"><i></i><i></i><i></i></div><div class="url"><svg class="i" style="width:13px;height:13px"><use href="#lock"/></svg><b>cartopolis.org</b>/account</div></div>
      <div class="page" style="padding:28px 40px;min-height:0">
        <div class="label">Ways to sign in</div>
        <div class="methods">
          <div class="method"><div class="ic"><svg class="logo"><use href="#mastodon"/></svg></div>
            <div class="t">Mastodon<small>@anna@mastodon.nl · since 24 Oct 2026</small></div>
            <div class="btn small danger">Remove</div></div>
          <div class="method"><div class="ic"><svg class="logo"><use href="#codeberg"/></svg></div>
            <div class="t">Codeberg<small>annadv · since 24 Oct 2026</small></div>
            <div class="btn small danger">Remove</div></div>
          <div class="method"><div class="ic"><svg class="logo"><use href="#forgejo"/></svg></div>
            <div class="t">garage44<small>Not linked</small></div>
            <div class="btn small">Link</div></div>
          <div class="method"><div class="ic"><svg class="logo"><use href="#google"/></svg></div>
            <div class="t">Google<small>Not linked</small></div>
            <div class="btn small">Link</div></div>
          <div class="method"><div class="ic" style="color:#fff"><svg class="logo"><use href="#github"/></svg></div>
            <div class="t">GitHub<small>Not linked</small></div>
            <div class="btn small">Link</div></div>
          <div class="method"><div class="ic"><svg class="i"><use href="#key"/></svg></div>
            <div class="t">Password<small>None</small></div>
            <div class="btn small">Add a password</div></div>
        </div>
      </div>
    </div>
    <div class="notes">
      <h3>Notes</h3>
      <ul>
        <li>A person can link several fediverse accounts. Each shows as its own row, by handle.</li>
        <li>Removing the Mastodon row also removes the “confirmed” mark from the profile.</li>
      </ul>
    </div>
  </div>
</section>

<!-- ───────────────────────── 5. config ───────────────────────── -->
<section class="sec">
  <h2><span>5</span>Turning them on</h2>
  <p class="cap">Codeberg and a community server are one generic OpenID block each, so a new provider of that kind is configuration, never code. Mastodon is one switch.</p>
  <div class="row">
    <div class="card" style="width:620px;margin:0"><div class="bd">
<pre style="font:13px/1.55 ui-monospace,Menlo,monospace;color:var(--text);white-space:pre"><span style="color:var(--faint)"># cartopolis.toml — listed in the order the buttons appear</span>
[[auth.openid]]
name      = "Codeberg"
issuer    = "https://codeberg.org"
client_id = "…"           <span style="color:var(--faint)"># secret from the environment</span>

[auth.fediverse]
enabled   = true          <span style="color:var(--faint)"># registers itself per server</span>

[auth.google]             <span style="color:var(--faint)"># as in v1</span>
[auth.github]

[[auth.openid]]
name      = "garage44"
issuer    = "https://code.garage44.eu"
logo      = "garage44.svg"
client_id = "…"</pre>
    </div></div>
    <div class="notes">
      <h3>Server side, on top of v1</h3>
      <ul>
        <li><b>Generic OpenID</b> reads the issuer's discovery document, so Codeberg, Forgejo, Keycloak,
          Authentik, Nextcloud and Google itself all go through one path. GitHub and Mastodon are the
          two that need their own code.</li>
        <li><b>The fediverse needs a table of registered servers</b> (server, client id, secret), filled on
          first use and cleaned when a server stops answering.</li>
        <li><b>Free providers can't be trusted more than Google.</b> A community server's verified e-mail is
          only as good as that server. So linking to an existing account always asks for the password
          (v1 section 3), whoever the provider is.</li>
      </ul>
    </div>
  </div>
</section>

<div class="decide">
  <h2>Open questions</h2>
  <ol>
    <li><b>Order on cartopolis.org</b>: free ones first (drawn), or Google first because most people have it?</li>
    <li><b>Which free ones to switch on at launch?</b> Drawn: Codeberg, Mastodon, and garage44's Forgejo
      as the example community server. Others worth a look: Disroot, a Nextcloud host.</li>
    <li><b>Fediverse: any server, or only an allowed list?</b> Any server means anyone can stand one up and
      make accounts at will. That's no worse than the open sign-up form, but it skips the confirmation e-mail.
      Drawn: any server, minus the federation blocklist (<code>fediverse_blocklists</code>).</li>
    <li><b>Still open from v1</b>: an account with no password (drawn: allowed), password reset by mail,
      importing profile pictures (drawn: never).</li>
  </ol>
</div>

</body>
</html>