#fedidev

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@[email protected]

I jsut wrote a detailed post on my blog about @ghost's for @fedify! (Both English and Korean available.)

writings.hongminhee.org/2024/0

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@[email protected] · Reply to 洪 民憙 (Hong Minhee)'s post

now has a queue for incoming activities and they are automatically retried when they fail. The default retry strategy is good enough (exponential backoff + decorrelated jitter), and it's even fully customizable. Updated also the docs:

unstable.fedify.dev/manual/inb

You can give it a try by installing 0.12.0-dev.265+cb851932, the latest unstable release:

jsr.io/@fedify/[email protected]
npmjs.com/package/@fedify/fedi

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@[email protected]

In the next version of , the type is introduced to let you fully customize the retry policy of the task queue for incoming and outgoing activities. Of course, you can also simply adjust the parameters of the built-in exponential backoff + decorrelated jitter policy.

outboxRetryPolicy

This API is available since Fedify 0.12.0.

The retry policy for sending activities to recipients' inboxes.

By default, this uses an exponential backoff strategy with a maximum of 10 attempts and a maximum delay of 12 hours.

You can fully customize the retry policy by providing a custom function that satisfies the RetryPolicy type. Or you can adjust the parameters of the createExponentialBackoffRetryPolicy() function, which is a default implementation of the retry policy.
outboxRetryPolicy This API is available since Fedify 0.12.0. The retry policy for sending activities to recipients' inboxes. By default, this uses an exponential backoff strategy with a maximum of 10 attempts and a maximum delay of 12 hours. You can fully customize the retry policy by providing a custom function that satisfies the RetryPolicy type. Or you can adjust the parameters of the createExponentialBackoffRetryPolicy() function, which is a default implementation of the retry policy.
洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@[email protected]

Basic implementation of the inbox queue is complete and documentation is being worked on.

hollo.social/@fedify/0190687b-

Making inbox listeners non-blocking

This API is available since Fedify 0.12.0.

Usually, processes inside an inbox listener should be non-blocking because they may involve long-running tasks. Fortunately, you can easily turn inbox listeners into non-blocking by providing a queue option to createFederation() function. If it is not present, incoming activities are processed immediately and block the response to the sender until the processing is done.

While the queue option is not mandatory, it is highly recommended to use it in production environments to prevent the server from being overwhelmed by incoming activities.

Note: Activities with invalid signatures/proofs are silently ignored and not queued.
Making inbox listeners non-blocking This API is available since Fedify 0.12.0. Usually, processes inside an inbox listener should be non-blocking because they may involve long-running tasks. Fortunately, you can easily turn inbox listeners into non-blocking by providing a queue option to createFederation() function. If it is not present, incoming activities are processed immediately and block the response to the sender until the processing is done. While the queue option is not mandatory, it is highly recommended to use it in production environments to prevent the server from being overwhelmed by incoming activities. Note: Activities with invalid signatures/proofs are silently ignored and not queued.
Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@[email protected]

In the next version of , the Context.hostname, Context.host, and Context.origin properties will be added for better multitenancy/virtual hosting support.

https://github.com/dahlia/fedify/issues/66#issuecomment-2198967566

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@[email protected] · Reply to 洪 民憙 (Hong Minhee)'s post

When there is no queue, if the process fails, the inbox can just respond with a 500 server error and the sender will resend it.

But with a queue, by the time the inbox responds, it doesn't know if the process will fail because it hasn't run yet. So the sender won't retry whether it fails or not.

So, should it have its own retry logic when there is a queue?

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@[email protected]

I'm adding a queue for incoming activities in , and I have a concern. If an error occurs while processing an activity, should it retry?

hollo.social/@fedify/0190687b-

Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@[email protected]

has always been queuing outgoing activities, but not incoming activities. Thanks to @ghost's sponsorship, we are now implementing queues for incoming activities!

https://github.com/dahlia/fedify/issues/70

Tokyo Outsider (337ppm)'s avatar
Tokyo Outsider (337ppm)

@[email protected]

, and question: If instances generally collect only one copy of each post and then share it with the users that need to see it, does that mean nonoriginating instances are trusted to not show that post to users the poster has blocked (or who shouldn't see it because they're not following etc depending on visibility)?

How do the collecting instances know who should see it? (A cached copy of the poster's follow list?)

And does change any of this?

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@[email protected]

Today we created KR, a community for Korean people who are not only implementing fediverse servers, but also those who are running them, such as server operators, moderators, client app developers, bot developers, writers, translators, researchers, and more. For now, we're based on a Discord server, but we hope to eventually organize offline meetups and workshops. We'd love your support!

fedidev.kr/

Tokyo Outsider (337ppm)'s avatar
Tokyo Outsider (337ppm)

@[email protected]

How long (hours, roughly) would it take to implement a basic server from scratch in — absoluet bare bones, like a proof of concept just capable of sending and receiving posts, which could then be developed more before becoming a finished, user-ready system?

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@[email protected] · Reply to 洪 民憙 (Hong Minhee)'s post

먼저 Discord에 KR 서버를 하나 만들었습니다!

discord.gg/B2ABMBpHNA

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@[email protected]

서울에서 모임하는 생각 💭

洪 民憙 (Hong Minhee) 🤏🏼's avatar
洪 民憙 (Hong Minhee) 🤏🏼

@[email protected]

is an server framework in & . It aims to eliminate the complexity and redundant boilerplate code when building a federated server app, so that you can focus on your business logic and user experience.

The key features it provides currently are:

• Type-safe objects for Activity Vocabulary (including some vendor-specific extensions)
client and server
• HTTP Signatures
• Middleware for handling webhooks
protocol
.js, , and support
• CLI toolchain for testing and debugging

If you're curious, take a look at the Fedify website! There's comprehensive docs, a demo, a tutorial, example code, and more:

fedify.dev/

Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@[email protected]

has supported optional queuing for outgoing activities, with two built-in message queue backends: InProcessMessageQueue, which is suitable for development, and DenoKvMessageQueue, which is only available in Deno.

Fedify has also had two built-in cache backends, MemoryKvStore, which is suitable for development, and DenoKvStore, which is only available in Deno.

Now, however, by installing the @fedify/redis package, you can use as both a message queue backend and a cache backend! Unlike DenoKvMessageQueue and DenoKvStore, it's also available for .js and .

This feature was made possible with the support of @ghost.

https://github.com/dahlia/fedify-redis

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@[email protected] · Reply to kodingwarrior :vim:'s post

@kodingwarrior 한국에도 모임 같은 거 개최하면 좋겠어요 ㅎㅎ

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@[email protected]

now has the official account! Please follow @fedify!

hollo.social/@fedify/01905d6a-

Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@[email protected]

Hello, ! It's the official fedi account of the Fedify, an server framework!

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@[email protected]

Found a memory leak (on ) in recent commits of —be careful when using the unstable versions.

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@[email protected]

I wish there was a meetup in too…

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@[email protected]

development is often motivation to add features to , for example, most of the commits I added to Fedify today were for Hollo.

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@[email protected]

If you'd like to support the development of or , you can sponsor me on GitHub!

github.com/sponsors/dahlia

Hollo's avatar
Hollo

@[email protected]

Introducing . Hollo is an -enabled single-user microblogging software. Although it's for a single user, it also supports creating and running multiple accounts for different topics.

It's headless, meaning you can use existing client apps instead, with its Mastodon-compatible APIs. It has most feature parity with Mastodon. One big difference with Mastodon is that you can use in the content of your posts.

Oh, and Hollo is built using and .

https://github.com/dahlia/hollo

洪 民憙 (Hong Minhee) 🤏🏼's avatar
洪 民憙 (Hong Minhee) 🤏🏼

@[email protected]

Version 0.10.0 of , an server framework, has been released! Starting with this release, Fedify, previously distributed under AGPL 3.0, is now distributed under the MIT License to encourage wider adoption. Here are the major changes:

• In addition to RSA-PKCS#1-v1.5, Fedify now supports Ed25519 for signing and verifying the activities.
• FEP-521a: Multiple key pairs can now be registered for an actor.
• FEP-8b32: Implemented Object Integrity Proofs.
• Added Arrive and Question classes.

github.com/dahlia/fedify/relea

Jeff Sikes's avatar
Jeff Sikes

@[email protected]

TIL when you upload a video file to Mastodon, it generates a preview thumbnail. The thumbnail isn't passed through to other servers in the ActivityPub payload (similar to preview cards).

Each receiving platform handles this situation differently. Some regenerate a thumbnail (processing again). Some ignore it and don't show one. Others create blank thumbnails to appease the Mastodon API.

A blurhash is passed, tho, and could be used as a placeholder.

洪 民憙 (Hong Minhee) 🤏🏼's avatar
洪 民憙 (Hong Minhee) 🤏🏼

@[email protected]

@hollo is a testbed for the bleeding edge of . 😂

洪 民憙 (Hong Minhee) 🤏🏼's avatar
洪 民憙 (Hong Minhee) 🤏🏼

@[email protected]

sends Create(Question) for the poll, even though the Question itself is an Activity. Does it see Question as a regular Object rather than an Activity?

洪 民憙 (Hong Minhee) 🤏🏼's avatar
洪 民憙 (Hong Minhee) 🤏🏼

@[email protected]

I'm very excited that the team has chosen to implement . I've been working closely with the Ghost team, and it's been a lot of fun, and I can't wait to see the ActivityPub implementation at Ghost.

activitypub.ghost.org/day-4/

Jeff Sikes's avatar
Jeff Sikes

@[email protected]

Ghost will be using the open source Fedify server framework to manage the activitypub bits and pieces of their service.

activitypub.ghost.org/day-4/?r

洪 民憙 (Hong Minhee) 🤏🏼's avatar
洪 民憙 (Hong Minhee) 🤏🏼

@[email protected] · Reply to 洪 民憙 (Hong Minhee) 🤏🏼's post

Thanks to @silverpill, is finally FEP-8b32 compliant! Though it's not ready for general release yet, it's passing tests in the latest main branch. I'll test it with Mitra and other FEP-8b32-compliant implementations, and if it works well, it'll be included in 0.10.0.

You can try it out in version 0.10.0-dev.205+0cbca257.

jsr.io/@fedify/[email protected]

洪 民憙 (Hong Minhee) 🤏🏼's avatar
洪 民憙 (Hong Minhee) 🤏🏼

@[email protected]

I just released 0.9.1, which fixed one small bug.

github.com/dahlia/fedify/relea

洪 民憙 (Hong Minhee) 🤏🏼's avatar
洪 民憙 (Hong Minhee) 🤏🏼

@[email protected]

now supports sharing posts (reblogs)!

Jeff Sikes's avatar
Jeff Sikes

@[email protected]

Bonfire, the modular Fediverse platform, is looking for five Elixir developers to act as test subjects to improve the developer onboarding experience. Participants can receive a €50 stipend for their one-hour session.

Please share with your elixir dev friends, and boost!

bonfirenetworks.org/posts/surv

洪 民憙 (Hong Minhee) 🤏🏼's avatar
洪 民憙 (Hong Minhee) 🤏🏼

@[email protected] · Reply to 洪 民憙 (Hong Minhee) 🤏🏼's post

Implementing Object Integrity Proofs (FEP-8b32) and my implementation is not passing the test vectors. I haven't found the reason for 24 hours… 😫

洪 民憙 (Hong Minhee) 🤏🏼's avatar
洪 民憙 (Hong Minhee) 🤏🏼

@[email protected] · Reply to 洪 民憙 (Hong Minhee) 🤏🏼's post

FEP-521a has been implemented in .

Actors now have the property, and the class has been added. For example, if you look at the the actor from the Fedify Example Blog (fedify-blog.deno.dev/users/fed), you can see that it has the assertionMethods property in addition to the publicKey property.

You can try it out in version 0.10.0-dev.196+55cc34d1.

jsr.io/@fedify/[email protected]

洪 民憙 (Hong Minhee) 🤏🏼's avatar
洪 民憙 (Hong Minhee) 🤏🏼

@[email protected] · Reply to 洪 民憙 (Hong Minhee) 🤏🏼's post

throws an error when a remote actor has multiple public keys, so I sent a patch to fix this bug.

This is my first patch for Misskey!

github.com/misskey-dev/misskey

洪 民憙 (Hong Minhee) 🤏🏼's avatar
洪 民憙 (Hong Minhee) 🤏🏼

@[email protected]

As a first step towards adding Object Integrity Proofs (FEP-8b32) to , I've made it support keys. I've also enabled multiple keys to be associated with an actor. For example, if you look at the actor from the Fedify Example Blog (fedify-blog.deno.dev/users/fed), you'll see that it has two public keys, one for RSA and one for Ed25519.

You can try it out in version 0.10.0-dev.190+4dffb89a.

jsr.io/@fedify/[email protected]

洪 民憙 (Hong Minhee) 🤏🏼's avatar
洪 民憙 (Hong Minhee) 🤏🏼

@[email protected]

Version 0.9.0 of , an server framework, has been released! Here are the main changes:

• Added Tombstone, Hashtag, and Emoji classes.
• Added normalizeActorHandle() function to normalize an actor handle. This is needed when the domain of the actor handle is an IDN, or when the domain contains capital letters.
• Added an option to the sendActivity() function, excludeBaseUris, to exclude specified servers from sending activities. This can be used when you don't want to send activities to your own server.
• Added Context.parseUri(), a method to parse actor, object, inbox, and collection URIs.
• The time window for HTTP Signatures verification is now configurable.
• The @fedify/fedify/httpsig module has been renamed to . This is in preparation for implementing additional object integrity proofs other than HTTP Signatures.
• Improved interoperability with .

github.com/dahlia/fedify/relea

洪 民憙 (Hong Minhee) 🤏🏼's avatar
洪 民憙 (Hong Minhee) 🤏🏼

@[email protected] · Reply to 洪 民憙 (Hong Minhee) 🤏🏼's post

Now has several more features:

• Following/unfollowing accounts
• Following/unfollowing hashtags
• Post visibility
• Post language
• Editing profile
• Mentions
• Likes
• Bookmarks
• Notifications
• Markers

洪 民憙 (Hong Minhee) 🤏🏼's avatar
洪 民憙 (Hong Minhee) 🤏🏼

@[email protected]

I'm rebuilding from scratch, and I've implemented some -compatible APIs to let me do the following actions with and now:

• Logging in
• Composing a post
• Writing a reply
• View posts
• Public timeline
• Home timeline

✌️