AmaseCocoa
@cocoa@hackers.pub · 16 following · 17 followers
I maybe use Engrish in this account
Pythonista/Author of apkit. An Modularized ActivityPub Toolkit.
main (Iceshrimp)
- @AmaseCocoa@i.amase.cc
YarukiNotFound
- amase.cc
Zenn
- @amasecocoa
問題としてソフトウェアがAGPLだと感染する (個人的にはプラグインが拡張するソフトウェアのコードを含まない限りコピーレフトの制約に縛られることを望んでいない)のでどうしようってなる
この場合はプラグインAPIの概念をコアに分離してKagura (Mastodon API, Admin UI等)自体をそれのプラグインとして実装するのが妥当なんだろうけど悩む
ただその場合はコアにapkit.serverを実装しないと結局ライセンスに縛られかねない (Mastodon APIの実装側をAGPLにする方針の場合)
うーん調べてみたけどそれは無理そうだから難しい
問題としてソフトウェアがAGPLだと感染する (個人的にはプラグインが拡張するソフトウェアのコードを含まない限りコピーレフトの制約に縛られることを望んでいない)のでどうしようってなる
この場合はプラグインAPIの概念をコアに分離してKagura (Mastodon API, Admin UI等)自体をそれのプラグインとして実装するのが妥当なんだろうけど悩む
ただその場合はコアにapkit.serverを実装しないと結局ライセンスに縛られかねない (Mastodon APIの実装側をAGPLにする方針の場合)
拡張可能にしようにもプラグインの概念は悪意ある拡張から保護できるような安全性がないからうーんってなってる
まぁフォークせずにサーバーのコアを変更、拡張できるっていうのを念頭に置いてるので例えばWordPressのプラグインとかとは別物って考えてもいいかも
拡張可能にしようにもプラグインの概念は悪意ある拡張から保護できるような安全性がないからうーんってなってる
実装コストもあるのでひとまずv1で使われてるAPIを優先的に実装する
/api/v1/streaming実装してるんだけどなんか動かない🤔
多分FastAPI側がWebSocket用のルートを認識していない🤔
認識してくれたんだけどElkがトークンをそもそも渡してこないからそこから進めない...🤦♂️
/api/v1/streaming実装してるんだけどなんか動かない🤔
多分FastAPI側がWebSocket用のルートを認識していない🤔
バイナリには敵わないけど簡単にセットアップできるのを目標としている (サーバーを動かす敷居を下げたい)
First-version of My ActivityPub Implemention
ちなみにDBがJSONの簡易的なものなのでまだ世に出せるレベルまではバックエンドが実装できてない
APIが無の状態でActivityPub実装すると面倒になるので先に実装してからかな
First-version of My ActivityPub Implemention
見ての通りtootする程度のAPIは実装できた
First-version of My ActivityPub Implemention
Deploy AnywhereなActivityPubサーバー書いてる
それはそうとActivityPubのフォローがAcceptしてもIceshrimpだと処理中のままになるんだよな何故か
manuallyApprovesFollowersが原因?
それはそうとActivityPubのフォローがAcceptしてもIceshrimpだと処理中のままになるんだよな何故か
あとは全然まだ未完成だけどapkitのドキュメントみたいなものもできた
fedi-libs.github.io/apkit/
AmaseCocoa replied to the below article:
How to Build a Simple ActivityPub Reminder Bot in Python
AmaseCocoa @cocoa@hackers.pub
This post guides you through building a simple ActivityPub bot in Python using the `apkit` library. The bot listens for mentions and schedules reminders for users. It covers setting up the project, generating cryptographic keys for secure communication, defining the bot's identity as an ActivityPub Actor, and initializing the `apkit` server. The tutorial walks through the core logic for parsing reminder commands, sending notifications, and defining necessary web endpoints like `/actor` and `/inbox`. It also details how to handle incoming activities, such as `Follow` and `Create` events, and how to run the application using `uvicorn`. While the example uses in-memory storage for simplicity, the post suggests improvements like persistent storage and robust task queuing for production environments. This tutorial provides a solid foundation for building more complex ActivityPub applications.
Read more →Sorry, I forgot to enclose the mention in ` and ended up tagging someone unrelated...
How to Build a Simple ActivityPub Reminder Bot in Python
AmaseCocoa @cocoa@hackers.pub
This post guides you through building a simple ActivityPub bot in Python using the `apkit` library. The bot listens for mentions and schedules reminders for users. It covers setting up the project, generating cryptographic keys for secure communication, defining the bot's identity as an ActivityPub Actor, and initializing the `apkit` server. The tutorial walks through the core logic for parsing reminder commands, sending notifications, and defining necessary web endpoints like `/actor` and `/inbox`. It also details how to handle incoming activities, such as `Follow` and `Create` events, and how to run the application using `uvicorn`. While the example uses in-memory storage for simplicity, the post suggests improvements like persistent storage and robust task queuing for production environments. This tutorial provides a solid foundation for building more complex ActivityPub applications.
Read more →apkitで簡単なBotを作る記事みたいなのを書くかも
Windowsに(開発)環境破壊された...
開発ツール周りのPATHが一夜にして消失した
Windowsに(開発)環境破壊された...
Force pushが原因?
ちょっと気になるのが1/2くらいの確率でinboxの検証が進まなくなるんだよね
あれ、draft-cavage-http-signatures-12って何のDigest計算するんだっけ...?
うん、こういうときは文書読もうね
apkit間でしか使えない謎の署名実装が誕生して困る
draft-cavage-http-signatures-12に似て非なるdraftと名乗る謎の実装🤔
apkit間でしか使えない謎の署名実装が誕生して困る
あれ、draft-cavage-http-signatures-12って何のDigest計算するんだっけ...?
はぐれコミットがある...
Geminiがイライラしてる...
apkitのテスト用のコードで詰まってる箇所をだいたい特定するために大量のprintを追加した
apkitのActivityPubServerに関しては同期対応しないで非同期だけにしてる (分岐させてもいいけどわざわざこれでするであろう操作を同期でするとは考えてないから)
必要なら同期対応できるけどね
Coding ActivityPubServer...
nodeinfo path is auto-generated by starlette (fastapi)
StarletteじゃなくてFastAPIベースにしたのはルートがデコレータで定義できたりするっていう理由がある (自分で実装してもいいかもしれないけど既存のものを基盤にできるならしたかった)
Coding ActivityPubServer...
SSDが死にかけなのかわからないけどuvが待ってもパッケージインストールしてくれないので開発できない...
apkit書き直すか
ついでにuvに変えたのでよくなりそう
apkit書き直すか
apmodel 0.4.0
書き直したばかりでまだドキュメント整備してないからもしも使いたいならソースコード見ながら使ってください
https://pypi.org/project/apmodel/0.4.0/
ActivityPubのオブジェクト周りの文書があんまりないのもあって頭が混乱してきた
Mastodonの引用ってどういう仕様だっけ
Mastodonの引用ってどういう仕様だっけ
test (一部)とnodeinfoの実装終わり
バージョンごとに固有の型を使わないようにした (2.1のをベースに2.0で使われない値を強制的にそぎ落としてる)
test (一部)とnodeinfoの実装終わり
ちなみに一応Undefined型使うようにした(Noneで出力時に出力しないようにするのなんか違和感ある)
ひとまずActivityPubClientはapkitに入れておく (後で分離できるようにclient => apkitの依存性は含まないようにする)





