If you keep your Omoeba library in a Google Drive folder, Omoeba can create a file index.html for reading your library using the Google Drive API.
Omoeba keeps omoeba-library.jsonl in each library folder.
It lists the papers, one per line, and is updated after each index sync when a paper
changed. The page reads it from Google Drive, so the library folder must be in Google
Drive, synced by Google Drive for desktop.
If you additionally sync your library by git, you can add omoeba-library.jsonl to
.gitignore.
In https://console.cloud.google.com:
-
Create a project, for example "Omoeba".
-
APIs & Services › Library: enable the Google Drive API.
-
APIs & Services › OAuth consent screen:
- User type: External.
- App name: "Omoeba".
- Your e-mail as the support and developer contact.
- Scopes: add
.../auth/drive.readonly. - Test users: add your Google account.
- Leave the app in Testing: then only the test users can sign in.
-
APIs & Services › Credentials › Create credentials › OAuth client ID:
- Type: Web application.
- Authorized JavaScript origins: the address the page will be hosted at, without its path. For GitHub Pages that is
https://<your-github-name>.github.io. - You can also add
http://localhost:8000to try the page locally. - Authorized redirect URIs (for phones, which sign in by going to Google and back): the page's full address, exactly as you open it, without
#…or?…. For examplehttps://<your-github-name>.github.io/omoeba-web/. If you sometimes open it as…/omoeba-web/index.html, add that address too.
-
Copy the client ID (
….apps.googleusercontent.com) intosrc/web/config.ts:export const GOOGLE_CLIENT_ID = '….apps.googleusercontent.com';
It is not a secret: it only lets the page ask a signed-in person for read-only access to their own Drive.
Because the app stays unverified, Google shows a "Google hasn't verified this app" screen when you sign in. Click Continue.
The client ID must list http://localhost:8000 as an authorized JavaScript origin (step 2). Then:
node scripts/build.mjs
cd dist/web && python3 -m http.server 8000Open http://localhost:8000 in Chrome and sign in. Stop the server with Ctrl-C. After a change to the page, run node scripts/build.mjs again and reload. The server can keep running.
Opening index.html directly from disk (file://) does not work: Google signs in only pages served from an authorized http(s):// address.
- Build: run
node scripts/build.mjs. This writesdist/web/index.html, a single file. - GitHub Pages:
- Create a public repository, for example
omoeba-web. - Add
dist/web/index.htmlto it asindex.htmland push. - In the repository's Settings › Pages, deploy from the
mainbranch. - The page is then at
https://<your-github-name>.github.io/omoeba-web/.
- Create a public repository, for example
- Updates: after a change to the page, copy the newly built
index.htmlthere again.
Anyone who finds the address only gets the page's code. Reading a library needs signing in as a test user, and each person only ever sees their own Drive.
- Open the page in Safari and tap Sign in with Google.
- Tap Share › Add to Home Screen for an app-like icon.
Opened from the home-screen icon, signing in goes to Google’s page and comes back, rather than opening a popup (as in Safari): the page then runs in its own window, which a popup cannot report back to. This needs the page's address among the client's Authorized redirect URIs (step 2).