Giter VIP home page Giter VIP logo

Comments (23)

kaniini avatar kaniini commented on May 16, 2024 1

In your case, it is probably not necessary.

from writefreely.

kaniini avatar kaniini commented on May 16, 2024

if you must have it due to go structs being the way they are it should be set to null.

from writefreely.

thebaer avatar thebaer commented on May 16, 2024

Gotcha. Besides this issue, a shared inbox isn't needed, right? But it's probably a good thing to have? (For a platform that isn't receiving posts from the fediverse.)

from writefreely.

kaniini avatar kaniini commented on May 16, 2024

Looks like adding omitempty to sharedInbox in web-core/data.go should fix this.

from writefreely.

thebaer avatar thebaer commented on May 16, 2024

Yep. Should an empty endpoints property be left out, too?

from writefreely.

kaniini avatar kaniini commented on May 16, 2024

Ideally yes, but it doesn't matter. In LitePub, sharedInbox would generally be preferred if it is set, but Pleroma should also guard against that invalid value :)

However, there's another problem, your Accepts are wrong:

16:50:14.945 [info] Unhandled activity
16:50:14.950 [info] {
  "type": "Accept",
  "object": {
    "type": "Follow",
    "to": "https://blog.dereferenced.org/api/collections/kaniini",
    "state": "pending",
    "published": "2018-11-11T16:50:12Z",
    "object": "https://blog.dereferenced.org/api/collections/kaniini",
    "id": "https://pleroma.site/activities/b5bb0ad7-72fa-46d6-bc44-ced092bc3436",
    "context_id": 15104353,
    "context": "https://pleroma.site/contexts/1b428def-c9b3-4a4b-9f6e-465c84701b02",
    "cc": "https://www.w3.org/ns/activitystreams#Public",
    "actor": "https://pleroma.site/users/kaniini"
  },
  "nickname": "kaniini",
  "cc": [
    "https://pleroma.site/users/kaniini"
  ],
  "actor": "https://blog.dereferenced.org/api/collections/kaniini",
  "@context": [
    "https://www.w3.org/ns/activitystreams"
  ]
}

They need to be addressed to me, not cc me.

from writefreely.

kaniini avatar kaniini commented on May 16, 2024

Also

ERROR: 2018/11/11 16:50:14 log.go:26: Couldn't add new remoteuser in DB: Error 1364: Field 'followers' doesn't have a default value

Going to guess you need to do something with SQL there.

from writefreely.

kaniini avatar kaniini commented on May 16, 2024

oh, I see. nevermind on the to/cc. it's something else that Pleroma is hating.

from writefreely.

kaniini avatar kaniini commented on May 16, 2024

aha, the issue is that you're not generating an id for the accept.

from writefreely.

thebaer avatar thebaer commented on May 16, 2024

Ah ok, I'll get that in there.

Also that followers column shouldn't be in there -- it's a leftover from my local environment. This will fix that:

ALTER TABLE `remoteusers` DROP `followers`;

from writefreely.

kaniini avatar kaniini commented on May 16, 2024

Alright, I did that, and that got rid of that error, but publishing a blog post does not result in the blog post being distributed to subscribers.

from writefreely.

kaniini avatar kaniini commented on May 16, 2024

Ah, I see, it is only published directly if and only if I directly publish it there (instead of promoting a draft).

However...

17:16:11.027 [error] Task #PID<0.5979.0> started from Pleroma.Web.Federator terminating
** (Protocol.UndefinedError) protocol Enumerable not implemented for nil. This protocol is implemented for: DBConnection.PrepareStream, DBConnection.Stream, Date.Range, Ecto.Adapters.SQL.Stream, File.Stream, Function, GenEvent.Stream, HashDict, HashSet, IO.Stream, List, Map, MapSet, Postgrex.Stream, Range, Stream
    (elixir) /home/buildozer/aports/community/elixir/src/elixir-1.6.5/lib/elixir/lib/enum.ex:1: Enumerable.impl_for!/1
    (elixir) /home/buildozer/aports/community/elixir/src/elixir-1.6.5/lib/elixir/lib/enum.ex:141: Enumerable.reduce/3
    (elixir) lib/enum.ex:1919: Enum.uniq_by/2
    (pleroma) lib/pleroma/web/activity_pub/utils.ex:525: Pleroma.Web.ActivityPub.Utils.make_create_data/2
    (pleroma) lib/pleroma/web/activity_pub/activity_pub.ex:124: Pleroma.Web.ActivityPub.ActivityPub.create/1
    (pleroma) lib/pleroma/web/federator/federator.ex:106: Pleroma.Web.Federator.handle/2
    (elixir) lib/task/supervised.ex:88: Task.Supervised.do_apply/2
    (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
Function: #Function<12.33571476/0 in Pleroma.Web.Federator.maybe_start_job/2>
    Args: []

This is because your Create activity does not have actor set.

from writefreely.

thebaer avatar thebaer commented on May 16, 2024

Yeah, still need to send activities around moving posts from draft to a blog or between blogs.

But are you sure the Create activity doesn't have an actor? It should be getting set to the activity here, with the AttributedTo field set here

from writefreely.

kaniini avatar kaniini commented on May 16, 2024

Yeah, actually your Create is fine. Sorry about that. Digging a bit.

from writefreely.

kaniini avatar kaniini commented on May 16, 2024

Aha. I see the problem. Your Create is not addressed, only the underlying object is.

from writefreely.

thebaer avatar thebaer commented on May 16, 2024

So you need to be able to directly access the Create activity at its own URL / id?

from writefreely.

kaniini avatar kaniini commented on May 16, 2024

I did this:

diff --git a/activitypub.go b/activitypub.go
index 60561af..5a27ca2 100644
--- a/activitypub.go
+++ b/activitypub.go
@@ -580,6 +580,8 @@ func federatePost(app *app, p *PublicPost, collID int64, isUpdate bool) error {
                        activity = activitystreams.NewUpdateActivity(na)
                } else {
                        activity = activitystreams.NewCreateActivity(na)
+                       activity.To = na.To
+                       activity.CC = na.CC
                }
                err = makeActivityPost(actor, si, activity)
                if err != nil {

and that works.

from writefreely.

kaniini avatar kaniini commented on May 16, 2024

by the way, Update support is going to be a doozy. nobody has successfully implemented it yet :)

from writefreely.

thebaer avatar thebaer commented on May 16, 2024

Oh, got it. Will add that.

But yeah, just wanted to be future-proof by including Updates. Read.as does implement it and it seems to work, at least in our little universe of implementations :)

from writefreely.

kaniini avatar kaniini commented on May 16, 2024

The problem isn't with processing the literal Update, it's with preventing scenarios like:

  • Molly posts a photo of her cat. People are boosting it like crazy.
  • Few hours later, Molly Updates her cat photo to be nazi imagery.

Meaning that Announces need to become versioned, etc.

from writefreely.

kaniini avatar kaniini commented on May 16, 2024

Looks like other than the activities having to/cc on them (just copy them from the object, but you don't really need them on the object, just the activities themselves) and the Accepts not having an id, everything seems pretty solid here. At least solid enough that I can use it for my blog.

from writefreely.

thebaer avatar thebaer commented on May 16, 2024

Meaning that Announces need to become versioned, etc.

Ah, makes sense. Yeah that'll definitely be interesting!

For everything else, I've just pushed up their fixes. Just tested with Pleroma and it seems to work great!

from writefreely.

thebaer avatar thebaer commented on May 16, 2024

Thanks for your help on this. Closing now.

from writefreely.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.