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

WebHooks to NodeRed - HowTo? #2017

Open
yeurplc opened this Issue Nov 22, 2018 · 15 comments

Comments

Projects
None yet
4 participants
@yeurplc
Copy link

yeurplc commented Nov 22, 2018

Issue

Can't receive webhook Messages from Wekan.

POST / GET / PUT from console are working.

curl -X POST -d 'Nick' -H "Content-type: text/plain" http://192.168.1.20:1880/hello-raw
curl -X POST -d 'Nick' -H "Content-type: text/plain" http://192.168.1.20:1880/wekan

Server Setup Information:

  • Did you test in newest Wekan?: YES

  • For new Wekan install, did you configure root-url correctly: YES , think so

  • Wekan version: v1.78.0

  • Operating System: Ubuntu 18.04.1 LTS

  • Deployment Method: Docker version 18.03.1-ce

  • ROOT_URL environment variable: http://192.168.1.20:3000/

Problem description:

2018-11-22_135147

2018-11-22_134102

@xet7

This comment has been minimized.

Copy link
Member

xet7 commented Nov 23, 2018

Wekan only has Outgoing Webhooks going from Wekan to other software like Slack/Rocket.Chat/etc.

  1. Is that Outgoing Webhook URL the address of NodeRed ?

  2. Does NodeRed have incoming webhook that supports incoming Wekan data in this format ?

  3. For getting data into Wekan, there is Wekan REST API. Does it work for you?

@andyprv

This comment has been minimized.

Copy link

andyprv commented Nov 27, 2018

  1. Is that Outgoing Webhook URL the address of NodeRed ?

Yes , I tryed with & without Port declaration

  1. Does NodeRed have incoming webhook that supports incoming Wekan data in this format ?

It should be able to receive any kind of http POST / PUT Messages , I tested with
curl command from different PC , worked

  1. For getting data into Wekan, there is Wekan REST API. Does it work for you?

Puting Data into Wekan ,is not needed yet , first we like to Track all Card movements

@xet7

This comment has been minimized.

Copy link
Member

xet7 commented Jan 7, 2019

@andyprv

I added incoming HTTP POST to NodeRed:
nodered-01-http-post

Then I added debug:
nodered-02-debug

And Outgoing Wekan Webhook, that seems to send changes as seen above:
nodered-03-wekan-outgoing

I installed NodeRed like described here, also installing chatbot:
https://flows.nodered.org/node/node-red-contrib-chatbot

@xet7

This comment has been minimized.

Copy link
Member

xet7 commented Jan 7, 2019

Also, in NodeRed you need to click Deploy to deploy new HTTP Post etc changes.

@andyprv

This comment has been minimized.

Copy link

andyprv commented Jan 15, 2019

Hello ,

my setup is not installed on the host, both are Containers, running on Docker.

I fool'd arround and got sometimes Messages in NodeRed , when I open/close other connections .


2019-01-15_133429

2019-01-15_133401

@andyprv

This comment has been minimized.

Copy link

andyprv commented Jan 15, 2019

seems to work with v2.01

If I reload wekan , after setup webhook !

Just "SAVE" webhook settings or open/close the Board is not working ,
give you that strange behavior , as I discriped obove ...

2019-01-15_134753

@xet7 xet7 closed this Jan 15, 2019

@pouta

This comment has been minimized.

Copy link

pouta commented Jan 15, 2019

@andyprv I'm also having troubles with webhooks when running with docker. Can you share your docker-compose.yml and how you are running it?

@xet7 xet7 reopened this Jan 15, 2019

@xet7

This comment has been minimized.

Copy link
Member

xet7 commented Jan 15, 2019

Here is all steps I did:

  1. Install Docker and docker-compose to Ubuntu 16.04 64bit

  2. Deleted and cleaned up all docker data, so that Wekan starts correctly:

git clone https://github.com/wekan/docker-cleanup-volumes
cd docker-cleanup-volumes
./start.sh
  1. Cloned wekan repo and started wekan
git clone https://github.com/wekan/wekan
cd wekan
docker-compose up -d
  1. Installed Node 8.15.0
sudo apt-get install npm build-essential
sudo npm -g install npm
sudo npm -g install n
sudo n 8.15.0
  1. Installed node-red according to https://flows.nodered.org/node/node-red-contrib-chatbot
sudo npm -g install node-red
cd ~/.node-red
npm install node-red-contrib-chatbot
node-red
  1. Added node-red http-in /wekan and debug as above screenshot, added line between them, clicked deploy

  2. At wekan http://localhost registered new account and logged in with same credentials

  3. Created new board and added outgoing webhook to http://127.0.0.1:1880/wekan

  4. Docker does not send any changes of creating cards and lists, or moving cards

  5. Built from source and run

cd wekan
./rebuild-wekan.sh

And with 1 install dependencies, and 2 build from source

  1. Edit start-wekan.sh to have ROOT_URL=http://localhost and PORT=80

  2. Allowed wekan on port 80

cd wekan
./releases/virtualbox/node-allow-port-80.sh
  1. Install MongoDB 3.2.21 according to Ubuntu MongoDB docs

  2. Start Wekan

cd wekan
./start-wekan.sh
  1. Add new board and outgoing webhook to http://127.0.0.1:1880/wekan

  2. And from source it works.

  3. But docker does not work. Is it because some Docker network settings? Is there limited access in Docker to localhost ports? Or does nodered need to be in some docker container, defined to wekan network defined in docker-compose.yml ?

@xet7

This comment has been minimized.

@xet7

This comment has been minimized.

Copy link
Member

xet7 commented Jan 16, 2019

It seems that Wekan source/snap/docker on Linux outgoing webhooks to Rocket.Chat snap incoming webhook chat channel works with copying webhook url to Wekan board.

But, it seems that:

  • Linux source/Docker/snap webhook to Discord does not work at all anymore, it did before
  • on Mac sending Wekan Docker outgoing Webhooks does not work, most likely because of Mac networking etc does not work well
  • on Linux sending from source Wekan to source NodeRed works on localhost to localhost, but from Docker to localhost needs some setup that I did not yet figure out https://stackoverflow.com/questions/24319662/from-inside-of-a-docker-container-how-do-i-connect-to-the-localhost-of-the-mach
  • most likely if some other webhook code is included into same docker-compose.yml to use same docker internal wekan-tier network, outgoing webhook to that webhook receiving code would work

These still need more testing, because it feels like sometimes some of the above works, and sometime not.

@andyprv

This comment has been minimized.

Copy link

andyprv commented Jan 16, 2019

@andyprv I'm also having troubles with webhooks when running with docker. Can you share your docker-compose.yml and how you are running it?

I just pulled the Wekan 2.01 , and started with ....

sudo docker run -d \
    --restart always \
    -p 8080:8080 \
    -e "MONGO_URL=mongodb://db" \
    -e "ROOT_URL=http://server:8080/dev/wekan" \
    -e "NODE_TLS_REJECT_UNAUTHORIZED=0" \
    -e "MAIL_FROM='Wekan Notifications <noreply.wekan@web.eu.com>'" \
    -e "WITH_API=true" \
    -e "LDAP_ENABLE=true" \
    -e "LDAP_PORT=389" \
    -e "LDAP_HOST=192.168.0.1" \
    -e "LDAP_BASEDN=dc=www,dc=loc" \
    -e "LDAP_LOGIN_FALLBACK=false" \
    -e "LDAP_RECONNECT=true" \
    -e "LDAP_ENCRYPTION=false" \
    -e "LDAP_REJECT_UNAUTHORIZED=true" \
    -e "LDAP_GROUP_FILTER_ENABLE=true" \
    -e "LDAP_GROUP_FILTER_OBJECTCLASS=group" \
    -e "LDAP_GROUP_FILTER_GROUP_ID_ATTRIBUTE=cn" \
    -e "LDAP_GROUP_FILTER_GROUP_MEMBER_ATTRIBUTE=member" \
    -e "LDAP_GROUP_FILTER_GROUP_MEMBER_FORMAT=dn" \
    -e "LDAP_GROUP_FILTER_GROUP_NAME=Europe" \
    -e "LDAP_UTF8_NAMES_SLUGIFY=false" \
    -e "LDAP_SYNC_USER_DATA=false" \
    -e "LDAP_SYNC_GROUP_ROLES=" \
    -e "LDAP_AUTHENTIFICATION=true" \
    -e "DEFAULT_AUTHENTICATION_METHOD=ldap" \
    -e "LDAP_AUTHENTIFICATION_USERDN=SERVICE-Wekan" \
    -e "LDAP_AUTHENTIFICATION_PASSWORD=password" \
    -e "LDAP_LOG_ENABLED=true" \
    -e "LDAP_Internal_Log_Level=debug" \
    -e "LDAP_MERGE_EXISTING_USERS=true" \
    -e "LDAP_DEFAULT_DOMAIN=aaaaaaaaaa.eu.com" \
    -e "LDAP_USER_SEARCH_FIELD=mail" \
    -e "OAUTH2_ENABLED=false" \
    -e "PASSWORD_LOGIN_ENABLED=false" \
    -e "LOGOUT_WITH_TIMER=true" \
    -e "LOGOUT_ON_HOURS=6" \
    --link "mongodb:db" \
    --name wekan \
    quay.io/wekan/wekan:v2.01
@xet7

This comment has been minimized.

Copy link
Member

xet7 commented Jan 16, 2019

@andyprv

You docker command above does not specify MongoDB version.

quay.io/wekan/wekan:v2.01 is compatible with MongoDB 3.2.21 and
quay.io/wekan/wekan:meteor-1.8 is with MongoDB 4.x

@andyprv

This comment has been minimized.

Copy link

andyprv commented Jan 17, 2019

Ohh , do I have to specify the MongoDB Version as enviroment variable on wekan run command ?

Right now it's running ( accidentally ) on the Right Version

sudo docker run -d \
    --restart always \
    -p 27017:27017 \
    -v wekandb.data:/data/db \
    -v wekandb.backup:/data/bak \
    --name mongodb \
    mongo:3.2.20    
@xet7

This comment has been minimized.

Copy link
Member

xet7 commented Jan 17, 2019

@andyprv

All environment settings are documented in docker-compose.yml at https://github.com/wekan/wekan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment