Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pubgate: unsupported protocol scheme #116

Closed
robjloranger opened this issue Jun 3, 2019 · 6 comments · Fixed by #111
Closed

Pubgate: unsupported protocol scheme #116

robjloranger opened this issue Jun 3, 2019 · 6 comments · Fixed by #111
Assignees

Comments

@robjloranger
Copy link
Member

@robjloranger robjloranger commented Jun 3, 2019

Describe the bug

Confirming the fix in #111, we discovered a different issue with followers using pubgate.

All POST requests against the Pubgate user return an error:

..Post : unsupported protocol scheme ""

It looks like we store an empty string as their inbox.

Steps to reproduce (if necessary)

Steps to reproduce the behavior:

  1. Follow a writefreely (running the fix for #111) blog from pubgate
  2. Post or delete a post on the writefreely blog
  3. Check logs

Expected behavior

POSTs should go out to an actual URL and succeed.

Application configuration

  • Single mode
  • Database? mysql?
  • Open registration? no
  • Federation enabled? yes

Version or last commit:
WF commit 95215aa on branch gh100

@robjloranger robjloranger mentioned this issue Jun 3, 2019
1 of 1 task complete
@thebaer

This comment has been minimized.

Copy link
Member

@thebaer thebaer commented Jun 3, 2019

Good catch. To be sure, this is the error returned on our end? If so, what's the full log around that error look like?

@robjloranger

This comment has been minimized.

Copy link
Member Author

@robjloranger robjloranger commented Jun 3, 2019

Jun 03 15:32:53 mangrove rob[8586]: 2019/06/03 15:32:53 POST
Jun 03 15:32:53 mangrove rob[8586]: ERROR: 2019/06/03 15:32:53 log.go:26: Couldn't delete post! Post : unsupported protocol scheme ""

This is among a bunch of successful POSTs for the same action

@thebaer

This comment has been minimized.

Copy link
Member

@thebaer thebaer commented Jun 3, 2019

I see. So looking into the code... actually we're not storing the user's shared inbox (I assume it doesn't have one). Looking at the database, we do have an inbox for that pubgate user.

So to fix this issue, we need to fix the logic in various activitypub.go funcs that compile an inboxes map to fall back to a RemoteUsers Inbox if their SharedInbox is empty. E.g. in places like this:

writefreely/activitypub.go

Lines 550 to 557 in 95215aa

inboxes := map[string][]string{}
for _, f := range *followers {
if _, ok := inboxes[f.SharedInbox]; ok {
inboxes[f.SharedInbox] = append(inboxes[f.SharedInbox], f.ActorID)
} else {
inboxes[f.SharedInbox] = []string{f.ActorID}
}
}
we need to check if f.SharedInbox == "" and if so, use f.Inbox instead.

@robjloranger

This comment has been minimized.

Copy link
Member Author

@robjloranger robjloranger commented Jun 3, 2019

perfect, thanks @thebaer

@thebaer

This comment has been minimized.

Copy link
Member

@thebaer thebaer commented Jun 3, 2019

No problemo! If you want to tackle this fix, please feel free to assign yourself.

@robjloranger

This comment has been minimized.

Copy link
Member Author

@robjloranger robjloranger commented Jun 3, 2019

just testing now

@robjloranger robjloranger self-assigned this Jun 3, 2019
@thebaer thebaer closed this in #111 Jun 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants
You can’t perform that action at this time.