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
ghost opened this issue Jun 3, 2019 · 6 comments · Fixed by #111
Closed

Pubgate: unsupported protocol scheme #116

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

Comments

@ghost
Copy link

ghost 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 support pubgate #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

@ghost ghost mentioned this issue Jun 3, 2019
1 task
@thebaer
Copy link
Member

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?

@ghost
Copy link
Author

ghost 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
Copy link
Member

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: https://github.com/writeas/writefreely/blob/95215aa39db51f9510ded34480a62fb61242c4dd/activitypub.go#L550-L557 we need to check if f.SharedInbox == "" and if so, use f.Inbox instead.

@ghost
Copy link
Author

ghost commented Jun 3, 2019

perfect, thanks @thebaer

@thebaer
Copy link
Member

thebaer commented Jun 3, 2019

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

@ghost
Copy link
Author

ghost commented Jun 3, 2019

just testing now

@ghost ghost self-assigned this Jun 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant