I use AdonisJS V5 in my application. I want to use Activitypub to decentraliszed my application and connected it to the fediverse.
AdonisJS is very similar to Laravel or RubyOnRails. But Adonis don’t have package or librairie to use Activitypub but I saw that it’s not a problem because I will have to deal with JSON-LD only.
Here is my code :
public async get({ request, response }: HttpContextContract) {
const user = await User.findBy('username', request.param('username'))
if (!user) throw new APIException("Not found.", 404)
const actor = {
'@context': ['https://www.w3.org/ns/activitystreams', 'https://w3id.org/security/v1'],
'type': 'Person',
'id': `https://api.creativeblogger.org/users/${user.username}`,
'username': user.username,
'acct': `${user.username}@api.creativeblogger.org`,
'display_name': `${user.username}`,
'url': `https://api.creativeblogger.org/users/${user.username}`,
'avatar': `${user.pp}`,
'inbox': `https://api.creativeblogger.org/users/${user.username}/inbox`,
'outbox': `https://api.creativeblogger.org/users/${user.username}/outbox`,
'avatar_static': `${user.pp}`,
'note': `${user.biography}`,
'note_text': `${user.biography}`,
'created_at': `${user.createdAt}`,
'icon': [`${user.pp}`],
'publicKey': {
id: `https://api.creativeblogger.org${request.url()}actor`,
owner: `https://api.creativeblogger.org/users/${user.username}`,
publicKeyPem: `-----BEGIN PUBLIC KEY-----content of my public.pem-----END PUBLIC KEY-----
`,
},
}
return response.status(200).json(actor)
I also have a WebFinger who works perfectly. When I search my users on pixelfed, I find my users but no one information about the users. Not the avatar, display name, created_at… nothing.
When I search on mastodon I don’t find my users but with Pixelfed I find the users but without their informations…
I have this problem since a long time and it’s very tired because I don’t know why I have the error.
If you want to check here is one of the users of my application :
squaredot@api.creativeblogger.org
https://api.creativeblogger.org/users/SquareDot/actor
“”/.well-known/webfinger?resource=acct:squaredot@api.creativeblogger.org
Please help me ! I really need help lol