mapache,
@mapache@hachyderm.io avatar

So, I will add a very basic #ActivityPub interface to my static site with #hugo. I will follow this https://paul.kinlan.me/adding-activity-pub-to-your-static-site/ but for #Azure, which is where my site is hosted, and this is a thread in case I don't find the time to write a blog.

mapache,
@mapache@hachyderm.io avatar

@SmartmanApps already gave me an alternative, which converts basically any rss to an activitypub enabled site.

But it is too much, too big, and also I just want to have some fun.

mapache,
@mapache@hachyderm.io avatar

The first two steps where very simple, adding the well-known and actor json, these are static and I can set the content-type in #azure #storage very easily.

mapache,
@mapache@hachyderm.io avatar

Now, I need to choose something that can answer the POST requests for the inbox. After a brief check on the pricing, I will use #Azure #Functions, which has enough free requests for now.

mapache,
@mapache@hachyderm.io avatar

I did a quick search in #GitHub and #Google for "azure function activity pub inbox", no relevant results.

mapache,
@mapache@hachyderm.io avatar

So, we are good, I will create something new. I need to store my followers somewhere, decided to use a table in #AzureStorage for simplicity.

mapache,
@mapache@hachyderm.io avatar

Ok, so created my azure function locally. Seems the actor file has a reference to the url where these requests will be processed: (ex. "inbox": "https://maho.dev/inbox"), so I need to configure the DNS for my azure function, but that is a TODO for later.

mapache,
@mapache@hachyderm.io avatar

I have my az function now, but just for reference, this is useful to understand how signatures work in #mastodon #activitypub - https://blog.joinmastodon.org/2018/06/how-to-implement-a-basic-activitypub-server/

mapache,
@mapache@hachyderm.io avatar

One thing I wonder is if #AzureStorage will override my content-type if I reupload.

mapache,
@mapache@hachyderm.io avatar

I love how sometimes #ChatGTP simply understands my shit.

mapache,
@mapache@hachyderm.io avatar

Ok, time to sleep, good progress, will continue tomorrow.

mapache,
@mapache@hachyderm.io avatar

I could not sleep, so trying to test the func and also creating a repo to put the code.

mapache,
@mapache@hachyderm.io avatar

While testing, I found that trying to get a record from #Azure #TableStorage that does not exists throws an exception. That let me to find this issue and spend some time reading the comments - https://github.com/Azure/azure-sdk-for-net/issues/16251 I need popcorn!

mapache,
@mapache@hachyderm.io avatar

I am at the point where everything seems to work except for confirming the follow/unfollow request. It is something about the signature.

These past few hours of development remind me of what @coachtony says in the last episode of #dotsocial by @mike, there is not a nice way to test your #activitypub implementations.

Different #mastodon versions, return different errors, there is no test suite, and basically I am testing in production and/or setting up my own #mastodon server.

mapache,
@mapache@hachyderm.io avatar

@coachtony Once I get this working, I will create some unit tests and mock http requests that hopefully would be helpful for others.

JsonCulverhouse,
@JsonCulverhouse@flipboard.social avatar

@mapache @coachtony There is a online test that can help you validate some of the http signatures. https://verify.funfedi.dev/

JsonCulverhouse,
@JsonCulverhouse@flipboard.social avatar

@mapache @coachtony Also you might be interested in joining the "Social Web Incubator Community Group" or reading the mailing list, there is recent activity discussing testing. https://www.w3.org/community/socialcg/

  • All
  • Subscribed
  • Moderated
  • Favorites
  • fediverse
  • DreamBathrooms
  • ngwrru68w68
  • tester
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • InstantRegret
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • mdbf
  • tacticalgear
  • megavids
  • osvaldo12
  • normalnudes
  • cubers
  • cisconetworking
  • everett
  • GTA5RPClips
  • ethstaker
  • Leos
  • provamag3
  • anitta
  • modclub
  • JUstTest
  • lostlight
  • All magazines