choai日本語

Keeping it in a repository

Your journal can live in a private GitHub repository, so the same books open on a phone and on a desktop. The browser talks to GitHub directly; there is nothing of ours in between.

What a sync is here

Two acts, both of them yours to press. Taking brings the repository's copy down and opens it. Sending puts what you have written up. Nothing happens on a timer and nothing happens in the background.

The request goes from the browser straight to api.github.com. No server of ours sees the journal, the token, or that a sync happened at all.

The token

A fine-grained personal access token, given access to one repository and to Contents only, with read and write. That is the least that lets it work: it cannot see your other repositories, cannot act as you anywhere else, and can be revoked on its own without touching anything else you use GitHub for.

It is kept in this browser, in the same storage the journal is in, and is sent to api.github.com and nowhere else. Disconnecting forgets it.

Setting it up

Make a repository on GitHub and make it private — these are your books. It can be empty; nothing has to be in it yet.

Fill in the owner, the repository, and the path the journal should have. Folders in the path do not need to exist.

Save the token. That only asks GitHub who the token belongs to; it writes nothing.

Then take, or send. With nothing open here, taking is how a journal begins — there is no such thing as taking a copy from halfway, so nothing has to be made first.

When both sides have changed

Entries written on the phone are laid after entries written on the desktop, provided both texts still begin with what was last agreed. That covers the ordinary case, which is two devices appending to the same journal on different days.

When they do not — when the same lines were edited on both sides — nothing is merged and nothing is overwritten. It says the two have diverged and leaves both alone. Choosing a winner is a thing only you can do, and doing it silently is how a figure goes missing.

A repository for each set of books

A company's journal and a household's are different files, so they are different books here, each with its own repository and its own token if you like. They are switched in the corner of the window, and switching puts down everything that belonged to the one being closed.

What GitHub can see

Whatever is in the repository, which is your journal — that is what a repository is for. GitHub is not told anything else by this app, and nothing about the sync is reported anywhere.