Skip to content

Commit

Permalink
edit actor json
Browse files Browse the repository at this point in the history
  • Loading branch information
pessi-v committed Jun 27, 2024
1 parent ad9441a commit ec3b3e7
Showing 1 changed file with 7 additions and 25 deletions.
32 changes: 7 additions & 25 deletions app/controllers/federation_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ def webfinger
render json: JSON.generate(
{
"subject": "acct:#{ENV.fetch('FEDIVERSE_USER_NAME').gsub('@', '')}@#{URI.parse(ENV.fetch('APP_URL')).host}",
"aliases": [
"#{ENV.fetch('APP_URL')}/@#{ENV.fetch('FEDIVERSE_USER_NAME').gsub('@', '')}"
],
# "aliases": [
# "#{ENV.fetch('APP_URL')}/@#{ENV.fetch('FEDIVERSE_USER_NAME').gsub('@', '')}"
# ],
"links": [
{
"rel": "http://webfinger.net/rel/profile-page",
Expand All @@ -26,7 +26,10 @@ def fediverse_user

render json: JSON.generate(
{
"@context": "https://www.w3.org/ns/activitystreams",
"@context": [
"https://www.w3.org/ns/activitystreams",
"https://w3id.org/security/v1"
],
"id": "#{ENV.fetch('APP_URL')}/@#{ENV.fetch('FEDIVERSE_USER_NAME').gsub('@', '')}",
"type": "Application",
"following": "#{ENV.fetch('APP_URL')}/following",
Expand All @@ -50,31 +53,10 @@ def fediverse_user
"url": "#{ENV.fetch('APP_URL')}/waves.jpg"
},
"publicKey": {
"@context": "https://w3id.org/security/v1",
"@type": "Key",
"id": "#{ENV.fetch('APP_URL')}/@#{ENV.fetch('FEDIVERSE_USER_NAME').gsub('@', '')}#main-key",
"owner": "#{ENV.fetch('APP_URL')}/@#{ENV.fetch('FEDIVERSE_USER_NAME').gsub('@', '')}",
"publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApU4KwPCuv7e59f2Bc0Nj\nnEOF+Zhd9rx6oeg36K2hSRExPVG14b2RgW5+9wHB7JoW2BC6zO21M3llMsisV147\nd2lSiOTFqJymq72E3XhvquDKLk/2vJ8ynPIPRnn+CDJd+lQPmnqH/BaKfi4lfUwr\nUMTGkaXZTStSSYSyyq2n5NC1jweZmJyYJZJ14fGc20fGwzkp7Ve3d65bBDcgfAUo\nv1Q8QXgIdsN92ELJbtJ65RTWY9hHS0e1vvy8aY9V9XK+u3Y/Apn8dSm1hhgLkdxU\n52K/b4Qm5ZYolyoH1QrnLhCyHwM8Vpvt4O0iSuIap47MPQv8a4HZQp41ybFXGTCB\nhQIDAQAB\n-----END PUBLIC KEY-----"
}
# "attachment": [
# {
# "type": "PropertyValue",
# "name": "Blog",
# "value": "<a href=\"https://maho.dev\" target=\"_blank\" rel=\"nofollow noopener noreferrer me\" translate=\"no\"><span class=\"invisible\">https://</span><span class=\"\">maho.dev</span><span class=\"invisible\"></span></a>"
# },
# {
# "type": "PropertyValue",
# "name": "LinkedIn",
# "value": "<a href=\"https://www.linkedin.com/in/mahomedalid\" target=\"_blank\" rel=\"nofollow noopener noreferrer me\" translate=\"no\"><span class=\"invisible\">https://www.</span><span class=\"\">linkedin.com/in/mahomedalid</span><span class

# =\"invisible\"></span></a>"
# },
# {
# "type": "PropertyValue",
# "name": "GitHub",
# "value": "<a href=\"https://github.com/mahomedalid\" target=\"_blank\" rel=\"nofollow noopener noreferrer me\" translate=\"no\"><span class=\"invisible\">https://</span><span class=\"\">github.com/mahomedalid</span><span class=\"invisible\"></span></a>"
# }
# ]
}), content_type: 'application/activity+json'
end

Expand Down

0 comments on commit ec3b3e7

Please sign in to comment.