softdevteam / mattermost-github-integration

GitHub integration for Mattermost
Other
79 stars 50 forks source link

always get bad request response before any code in def root() runs #40

Open christopherreay opened 7 years ago

christopherreay commented 7 years ago

I tried adding a print as the first line of def root():

so im running from docker Ive connected into the running docker container if I run wget --post-data="some=data" localhost:5000 I get this error:

bash-4.3# wget --post-data="asd=sd" localhost:5000
Connecting to localhost:5000 (127.0.0.1:5000)
wget: server returned error: HTTP/1.0 400 BAD REQUEST

where the first line of def root(): never runs. Any ideas?

(github webhook is set to application/json and also returns that the server says bad request)

ptersilie commented 7 years ago

The bad request on your wget example is normal. Why Github does the same I don't know. I'd need some more information. Like your config, if you are using a secret, etc.

christopherreay commented 7 years ago

So here is the config:

USERNAME = "Github"
ICON_URL = "chat.example.net/github.png"
MATTERMOST_WEBHOOK_URLS = {
    'default' : ("http://chat.example.net/hooks/jtk9idg4ifnj7ncm9et6tjdi5w", "off-topic"),
    'metacurrency/holochain' : ("http://chat.example.net/hooks/jtk9idg4ifnj7ncm9et6tjdi5w", "feedcode"),
    #'teamname' : ("yourdomain.org/hooks/hookid3", "town-square"),
    #'teamname/unimportantrepo' : None,
}
GITHUB_IGNORE_ACTIONS = {
    "issues": ["labeled", "assigned"],
}
SECRET = None
SHOW_AVATARS = True
SERVER = {
    'hook': "/"
,   'address': "0.0.0.0"
,   'port': 5000
}

I can tell you that:

Thank you

ptersilie commented 6 years ago

@christopherreay Sorry for the late reply. Do you still have this issue? SECRET=None should be fine. Did you set a secret in the Github webhook?