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

Update for Discourse v2.x #2

Closed
wants to merge 6 commits into from

Conversation

jeffbyrnes
Copy link

@jeffbyrnes jeffbyrnes commented Jun 30, 2019

This updates the plugin to work with Discourse v2.x, and cleans up some now-unused config settings as well.

Fixes #1

@jeffbyrnes
Copy link
Author

@halkeye yeah it seemed like it would work, and I figured, with the extra few tweaks to clean up the config, it might be nice to kick it back up to the original.

Unfortunately, it seems that the /mailgun/incoming route isn’t added properly (anymore?), so it doesn’t quite work.

Any suggestions?

@halkeye
Copy link

halkeye commented Jun 30, 2019

I haven't used it in a while, but how are you checking. I can check my install when I get home.

@jeffbyrnes
Copy link
Author

So yeah, when I try to add the route to Mailgun, it errors out & says that the forward URL “needs to be publicly accessible”.

When I attempt to curl https://$my_domain/mailgun/incoming, I get a 404. So something is a little different with Discourse, maybe? I’m running Discourse 2.4.0.beta1 (discourse/discourse@4f97f85)

@halkeye
Copy link

halkeye commented Jun 30, 2019

Try curl -X post instead of just curl. I don't think it's exposed on get. Also is your domain publically accessible?

@halkeye
Copy link

halkeye commented Jun 30, 2019

 (ssh) odin  ~  curl -X POST https://discourse.gavinmogan.com/mailgun/incoming -v 2>&1 | grep HTTP
> POST /mailgun/incoming HTTP/1.1
< HTTP/1.1 401 Unauthorized

 (ssh) odin  ~  curl https://discourse.gavinmogan.com/mailgun/incoming -v 2>&1 | grep HTTP
> GET /mailgun/incoming HTTP/1.1
< HTTP/1.1 404 Not Found
/bin/sh -- -c 'cd /var/www/discourse; rails routes | grep mailgun -i'
                           webhooks_mailgun POST     /webhooks/mailgun(.:format)                                                                   webhooks#mailgun
                          discourse_mailgun          /mailgun                                                                                      DiscourseMailgun::Engine
Routes for DiscourseMailgun::Engine:
incoming POST /incoming(.:format) discourse_mailgun/mailgun#incoming
Time: 0h:00m:04s

@jeffbyrnes
Copy link
Author

Heh, yah, POST-ing did the trick; and I forgot about rails routes, thanks for the reminder! Been a while since I dealt with Rails so directly :)

So yeah, the route is there, and I’ve got it all working on my Discourse setup!

So this PR is all good & validated as working.

@jeffbyrnes jeffbyrnes closed this Jun 17, 2020
@jeffbyrnes jeffbyrnes deleted the master branch June 17, 2020 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error when installing on Discourse v2.0.0.beta9
4 participants