Skip to content

Commit a39a7d2

Browse files
docs: add Micro.blog logo and token setup
1 parent 591c727 commit a39a7d2

4 files changed

Lines changed: 37 additions & 5 deletions

File tree

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,16 @@ DATABASE_PATH=./data/crosspoint.db PORT=8080 node dist/index.js
6161
| `AUTH_RATE_LIMIT_PER_MINUTE` | `30` | Per-IP limit on registration (0 disables) |
6262
| `TOKEN_ENC_KEY` | _(unset)_ | Enables external-service connectors. 64 hex chars, a base64 32-byte key, or a ≥32-char passphrase. Encrypts stored connector credentials at rest; unset = connectors disabled. |
6363

64+
### Link Micro.blog
65+
66+
1. Sign in to [Micro.blog](https://micro.blog/).
67+
2. Open [Account → App tokens](https://micro.blog/account/apps).
68+
3. Create a separate app token for **CrossPoint Sync**.
69+
4. In CrossPoint Sync, open your account, choose **Micro.blog**, and paste the new token.
70+
71+
Treat the token like a password: Micro.blog app tokens have full account access. CrossPoint Sync
72+
encrypts the token at rest using `TOKEN_ENC_KEY`.
73+
6474
## Point your reader at it
6575

6676
- **KOReader:** Tools → Progress sync → Custom sync server → `http://your-host:8080`

assets/icons/microblog.png

4.44 KB
Loading

src/routes/web.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ const LANDING = shell(
225225
<div class="svc"><div class="lead"><img class="svc-icon" src="/icons/hardcover.png" alt="" width="34" height="34"><div><div class="name">Hardcover</div>
226226
<div class="desc">Keep your Hardcover shelf and reading progress up to date automatically.</div></div></div>
227227
<span class="pill warn">beta</span></div>
228-
<div class="svc"><div class="lead"><img class="svc-icon" src="/icons/microblog.png" alt="" width="34" height="34" onerror="this.style.display='none'"><div><div class="name">Micro.blog</div>
228+
<div class="svc"><div class="lead"><img class="svc-icon" src="/icons/microblog.png" alt="" width="34" height="34"><div><div class="name">Micro.blog</div>
229229
<div class="desc">Keep your Currently reading and Finished reading bookshelves up to date automatically.</div></div></div>
230230
<span class="pill">ready</span></div>
231231
<div class="svc"><div class="lead"><img class="svc-icon" src="/icons/audiobookshelf.png" alt="" width="34" height="34"><div><div class="name">Audiobookshelf</div>
@@ -529,13 +529,23 @@ async function jsend(u, m='POST', body){ const r = await fetch(u,{method:m,heade
529529
530530
const HINTS = {
531531
hardcover: 'Paste your Hardcover API token from hardcover.app/account/api. Syncs your reading progress and shelf status.',
532-
microblog: 'Paste your Micro.blog app token from Account → Edit Apps. Keeps your Currently reading and Finished reading bookshelves in sync.',
532+
microblog: 'Connect an app token to keep your Currently reading and Finished reading bookshelves in sync.',
533533
readwise: 'Paste your Readwise access token from readwise.io/access_token. Syncs your highlights.',
534534
kosync: 'Mirror your reading progress to another KOReader-compatible (KOSync) server, so your other devices see it too.',
535535
bookfusion: 'Connect your BookFusion account to sync reading progress. You will approve the request on bookfusion.com.',
536536
audiobookshelf: 'Sync your reading position to the matching audiobook on your Audiobookshelf server. Create an API key in Audiobookshelf under Settings, Users, API Keys.'
537537
};
538538
539+
const TOKEN_HELP = {
540+
microblog: '<div class="muted" style="margin-bottom:18px"><p style="margin-top:0"><b>Get a Micro.blog app token:</b></p>'
541+
+ '<ol style="padding-left:20px;margin-bottom:10px">'
542+
+ '<li>Sign in to Micro.blog in another tab.</li>'
543+
+ '<li>Open <a href="https://micro.blog/account/apps" target="_blank" rel="noopener noreferrer">Account → App tokens</a>.</li>'
544+
+ '<li>Create a separate token for <b>CrossPoint Sync</b>.</li>'
545+
+ '<li>Copy the new token and paste it below.</li>'
546+
+ '</ol><p style="margin-bottom:0">Treat this token like a password: it has full access to your Micro.blog account. CrossPoint Sync encrypts it before storing it.</p></div>'
547+
};
548+
539549
(async () => {
540550
const { ok, status, data } = await jget('/api/v1/connectors');
541551
if (status === 409) { location.href = '/account'; return; } // no sync account yet
@@ -553,7 +563,7 @@ function done() { location.href = '/account'; }
553563
function render(conn) {
554564
const f = $('form');
555565
if (conn.credential_kind === 'token') {
556-
f.innerHTML = '<label>API token</label><input id="tok" class="mono" placeholder="paste token">'
566+
f.innerHTML = (TOKEN_HELP[ID] || '') + '<label>API token</label><input id="tok" class="mono" placeholder="paste token">'
557567
+ '<button class="primary full mt" id="go">Link ' + esc(conn.name) + '</button><div class="err" id="e"></div>';
558568
$('go').onclick = async () => {
559569
$('e').textContent = '';

test/web-microblog.test.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@ describe('Micro.blog web setup', () => {
99
expect(html).toContain('Micro.blog');
1010
expect(html).toContain('Currently reading');
1111
expect(html).toContain('Finished reading');
12-
expect(html).toContain('onerror="this.style.display=\'none\'"');
12+
13+
const icon = await app.request('/icons/microblog.png');
14+
expect(icon.status).toBe(200);
15+
expect(icon.headers.get('content-type')).toBe('image/png');
16+
expect([...new Uint8Array(await icon.arrayBuffer()).slice(0, 8)]).toEqual([
17+
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a,
18+
]);
1319
});
1420

1521
it('renders where to create the pasted app token', async () => {
@@ -47,7 +53,13 @@ describe('Micro.blog web setup', () => {
4753
await new Promise((resolve) => setTimeout(resolve, 0));
4854

4955
expect(getElement('desc').textContent).toBe(
50-
'Paste your Micro.blog app token from Account → Edit Apps. Keeps your Currently reading and Finished reading bookshelves in sync.',
56+
'Connect an app token to keep your Currently reading and Finished reading bookshelves in sync.',
5157
);
58+
expect(getElement('form').innerHTML).toContain('Sign in to Micro.blog');
59+
expect(getElement('form').innerHTML).toContain('https://micro.blog/account/apps');
60+
expect(getElement('form').innerHTML).toContain('Account → App tokens');
61+
expect(getElement('form').innerHTML).toContain('CrossPoint Sync');
62+
expect(getElement('form').innerHTML).toContain('Copy the new token and paste it below');
63+
expect(getElement('form').innerHTML).toContain('full access to your Micro.blog account');
5264
});
5365
});

0 commit comments

Comments
 (0)