mastodon.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
The original server operated by the Mastodon gGmbH non-profit

Administered by:

Server stats:

330K
active users

#inbox

2 posts2 participants0 posts today

Creating your own federated microblog | Hacker News

Link
Creating your own federated microblog | Hacker News
https://news.ycombinator.com/item?id=37598304

📌 Summary:
本文介紹如何使用 Fedify 這個 ActivityPub 伺服器框架,從零開始打造一個簡易的分散式微網誌(microblog)。教程聚焦於 Fedify 的實作與運用,無須事先深入瞭解 ActivityPub 協議細節。過程中涵蓋從開發環境建置、TypeScript 與 JSX 基礎、資料庫設計與連接,到 ActivityPub actor(帳號)建立、加密金鑰管理、Inbox 設計、追蹤關係管理、貼文發佈與通知等核心功能。透過 SQLite 作為資料庫,配合Node.js及 Hono 網頁框架,搭建單帳號微網誌應用,實現與 Mastodon 等 ActivityPub 服務的互通。文章同時展示如何利用 Fedify 的指令建立開發環境,啟動本地伺服器,以及使用 fedify tunnel 快速將本地服務暴露於公網,便於跨伺服器交流與實測。最終完成的系統支援帳號建立、追蹤及取消追蹤、查看追蹤與被追蹤帳號列表、發表與接收貼文,以及時間軸展示,並且實作 ActivityPub 的多種核心物件與活動類型,如 Person、Note、Follow、Accept、Undo 等。文章也提出安全性、認證機制、XSS 防範、媒體附加、標註等進階議題與改善方向。整體流程搭配大量程式碼範例與實際測試指令,對欲學習 ActivityPub 服務架設或開發分散式微網誌應用者具高度參考價值。

🎯 Key Points:
→ 教學目標與受眾設定
 ★ 適合熟悉 HTML、HTTP、SQL、JSON、基本 JavaScript 但不需 ActivityPub 與 Fedify 經驗的開發者。
 ★ 教學以單帳號微網誌為例,實作核心聯邦功能,無包含認證、編輯、搜尋等。

→ 環境建置
 ① 使用 Node.js 20.x 以上版本搭配 npm 安裝 Fedify CLI。
 ② 使用 fedify init 搭建專案骨架,採用 Hono 框架與 In-memory 快取。
 ③ Visual Studio Code 配合 TypeScript 及 Pico CSS 建構開發環境與 UI。

→ 資料庫設計與腳本執行
 ★ SQLite 為資料庫,建立 users、actors、keys、follows、posts 等多張表,明確定義主鍵、外鍵與約束條件。
 ★ 使用 better-sqlite3 連接與操作 SQLite,配合 TypeScript 型別定義保持安全與自動補全。

→ ActivityPub actor(使用者帳號)實作
 ★ Account 建立時,同步新增 users 與 actors 表記錄,維護聯邦用戶資料。
 ★ 實作 actor dispatcher,採內容協商 (Content Negotiation) 回應 HTML 或 ActivityPub JSON。
 ★ 生成並管理 RSA、Ed25519 兩種加密金鑰以簽署活動,透過 Fedify 接口完成金鑰產生、匯入匯出。

→ Inbox 與活動(Activity)處理
 ★ 設計 Inbox 接收 Follow、Undo、Accept、Create 等活動。
 ★ 收到 Follow 時,新增追蹤資料並回覆 Accept。
 ★ 收到 Undo(Follow) 時,處理取消追蹤。
 ★ 收到 Accept(Follow) 時,加入資料庫以確認雙方追蹤關係。
 ★ 接收並儲存 Create(Note) 活動,實現跨服務貼文同步。

→ 前端功能與路由設計
 ★ 建立基本頁面:設定頁、個人資料頁、個人貼文列表、貼文詳情頁、追蹤者與正在追蹤者列表。
 ★ 利用 JSX 建構組件,包含 Layout、Profile、PostList、FollowerList 等。
 ★ UI 表現使用 Pico CSS,兼顧易用性與輕量。

→ 與 Mastodon 等既有 ActivityPub 服務互通性測試
 ★ 利用 fedify tunnel 暴露本機服務至公網,方便跨服務測試。
 ★ 成功在 Mastodon 搜尋與瀏覽自訂帳號及貼文。
 ★ 在 ActivityPub.Academy 發送與接收追蹤請求、推文,確保活動流程正確。

→ 進階與安全性考量
 ★ 教學中無認證機制,任何人皆可發文,存有安全隱憂。
 ★ 直接顯示遠端貼文 HTML 內容,可能導致 XSS 攻擊。
 ★ 建議未來加入登入驗證、防範 XSS,並擴充支援圖片附加、標註、個人資料設定等功能。

🔖 Keywords:
#ActivityPub #Fedify #分散式微網誌 #加密金鑰 #Inbox
news.ycombinator.comCreating your own federated microblog | Hacker News

Ich habe jetzt mal die #App von #Thunderbird für #Android getestet.

Übernahme aller
#Konten und #Mailadressen aus dem Thunderbird am #Linux Rechner per (in meinem Fall 4) #QRCode klappt super.

Dann allerdings fangen bei etlichen
#Mailkonten, denen jeweils mehrere #Mailadressen zugeordnet sind, die Probleme an:

Vom Kontoname werden in einem farbigen Punkt nur die ersten 2 Buchstaben angezeigt. Zwar kann man die Farbe wählen, aber das reicht zur Unterscheidung nicht aus.

#Signaturen werden nicht übernommen, zumindest, wenn diese im Thunderbird am PC aus einer Textdatei eingebunden sind.

Wenn man unterhalb des
#Posteingang (#Inbox) Unterordner hat, werden diese nicht wie beim Thunderbird am PC als Unterordner des Posteingang samt Hierarchie angezeigt, sondern jeder Unterordner in flacher Hierarchie in der Form "INBOX.Ordnername" aufgeführt.

Man kann immer nur einer einem Postfach zugeordneten Mailadresse einen
#PGP Schlüssel zuweisen.

Der Ansatz für eine
#Thunderbirdapp ist vielversprechend, aber noch ist gewaltig Luft nach oben.

Ich bleibe deshalb bis auf weiteres erst mal bei
#FairEmail", das ich wärmsten empfehlen kann.

Sunday 05:25
My health is slowly getting better. I am eating more, keeping up the drinking of electrolytes and fruit juice, and continuing to sleep / nap a lot.

Today I shall stay home again, and attend our local #Church online at 11:00.
https://mycpointe.com/
Please feel free to join me. The chat is hosted.

I have been thinking about work at the #FoodBank.
This weekend I have managed to lower my #Outlook #Inbox to 11 emails to work on, but need to go into the office to check on physical paperwork from all of last week, especially to get Invoices paid. Therefore my plan is to go in tomorrow morning, gather the paperwork, work on the essentials, come on home, eat, nap, and then continue from my home office.

Being ill is not good at all, but I keep counting my many blessings in my Lord Jesus Christ. Take away everything else, and I still have Him.
Peter //O\

mycpointe.comChurch in Lexington, KYChristian Church in Lexington, KY helping people find and follow Jesus

Friday 06:23
Most of you are probably asking how I am feeling after yesterday.
Unsure if it was via food or air, but the stomach bug I picked up in Indianapolis on Wednesday has totally kicked my arse.
Yesterday I really did not want to eat anything, nor even drink water etc. I was absolutely drained and could hardly keep awake.
So, today after a LOT of sleep I am somewhat improved. Feeling about 40%, mostly awake, and more functional.
As you can imagine I was not able to work at all yesterday, and I hope to do so today, from home.
There are 164 emails in my #FoodBank #Outlook #Inbox that need organising, 104 unread, and I plan to do so this morning.

As I reported, my ordered #PineTab2 was delivered yesterday, and it is absolutely fantastic. The build quality is way superior to what I hoped for.
For a 10.1" tablet, 8GB RAM, 128GB HD, and keyboard I paid $242.99 delivered.
It runs Danctnix, which is KDE Plasma 6 compiled for ARM.
Please ask me questions about this excellent device.

Today is Arianna's last work day of PTO.
It's going to a whole lot warmer, and many of the Spring trees are starting to bloom, so she will be going into photography mode.

Time to dive into work mode as I listen to The Cybertronic Spree concert at The Echo, Los Angeles.
The 80s style beat is certainly helping keep me awake.
https://youtu.be/BUwJthSZo9k
#TheCybertronicSpree

Be well y'all,
Peter //O\

time

"Hey Daniel!

I was hoping to chat with you about libcurl — a source of my find it on their government laptop, with your name on the copyright. Are you around for a call sometime about it?"