SmallDocs SDocs SD / Trust

Proving sdocs.dev is running the public code

SDocs renders Markdown files, and the Markdown files we or our agents produce contain some of the most sensitive information we have (about codebases, unresolved bugs, production logs, etc.). For this reason client-side focused privacy (privacy that leave our server as blind as can be) is an essential component of SDocs.

In public/sdocs-app.js (which your browser - not our server - compiles and runs) we handle the use of the url fragment for our 100% our client-side default links and the encryption and client-side decryption key isolation for our short-links. You can use SDocs confidently because all the computation touching the content of your Markdown files is done in your browser and not on our server (i.e. we cannot see the content of your files).

SDocs is open-source, which means anyone can inspect our code to prove it does what we say (another layer of trust). However that leaves one broken link in the chain: Just because our open-source code does what we say, it doesn't mean that the sdocs.dev website is actually serving that same code.

This page explains how we do our best to prove that it is.

How we demonstrate trust

Because our client-side (browser run) files are the only ones that touch your sensitive data, the main thing to prove, and only thing we (and you) can prove, is that the files your browser is receiving to serve our website match the publicly available ones in our GitHub repo.

Our proof works like this:

You can also run the check here yourself (this will not update the timestamp):

Running commit: loading...
Ready. Click Run verification to fetch and hash every frontend file in your browser.

Or paste this code into the console on a sdoc.dev page rendering one of your Markdown files:

(async () => {
  const srv = await fetch('/trust/manifest').then(r => r.json());
  const url = 'https://raw.githubusercontent.com/espressoplease/SDocs'
            + '/trust-manifests/' + srv.commit + '.json';
  const gh  = await fetch(url).then(r => r.json());
  const hex = b => [...new Uint8Array(b)].map(x => x.toString(16).padStart(2, '0')).join('');
  let ok = 0, fail = 0;
  for (const f of gh.files) {
    const buf  = await fetch('/public' + f.path).then(r => r.arrayBuffer());
    const got  = hex(await crypto.subtle.digest('SHA-256', buf));
    const pass = got === f.sha256;
    console.log((pass ? '\u2713' : '\u2717') + ' ' + f.path);
    pass ? ok++ : fail++;
  }
  console.log(ok + '/' + (ok + fail) + ' match, commit ' + srv.commit.slice(0, 7));
})();

You will see a tick or a cross logged per frontend file and a final line with the pass count and the short commit hash the server reported. The fetches happen from whichever origin you're currently on, so the script verifies this page's bytes, not the /trust page's.

100% private (learn why) · CLI for you & your agents: npm i -g sdocs-dev · GitHub