saqura / xmppwb Goto Github PK
View Code? Open in Web Editor NEWXMPP Webhook Bridge [Archived]
License: MIT License
XMPP Webhook Bridge [Archived]
License: MIT License
Hi I try pip3 install xmppwb and look install xmppwb
Requirement already satisfied (use --upgrade to upgrade): xmppwb in /usr/local/lib/python3.4/dist-packages Requirement already satisfied (use --upgrade to upgrade): aiohttp in /usr/local/lib/python3.4/dist-packages (from xmppwb) Requirement already satisfied (use --upgrade to upgrade): pyyaml in /usr/local/lib/python3.4/dist-packages (from xmppwb) Requirement already satisfied (use --upgrade to upgrade): slixmpp in /usr/local/lib/python3.4/dist-packages (from xmppwb) Requirement already satisfied (use --upgrade to upgrade): chardet in /usr/local/lib/python3.4/dist-packages (from aiohttp->xmppwb) Requirement already satisfied (use --upgrade to upgrade): aiodns>=1.0 in /usr/local/lib/python3.4/dist-packages (from slixmpp->xmppwb) Requirement already satisfied (use --upgrade to upgrade): pyasn1 in /usr/local/lib/python3.4/dist-packages (from slixmpp->xmppwb) Requirement already satisfied (use --upgrade to upgrade): pyasn1-modules in /usr/local/lib/python3.4/dist-packages (from slixmpp->xmppwb) Requirement already satisfied (use --upgrade to upgrade): pycares>=1.0.0 in /usr/local/lib/python3.4/dist-packages (from aiodns>=1.0->slixmpp->xmppwb)
But by example I do xmppwb --help and I got:
File "/usr/local/bin/xmppwb", line 9, in <module> load_entry_point('xmppwb==0.2.5', 'console_scripts', 'xmppwb')() File "/usr/lib/python3/dist-packages/pkg_resources.py", line 351, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2363, in load_entry_point return ep.load() File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2088, in load entry = __import__(self.module_name, globals(),globals(), ['__name__']) File "/usr/local/lib/python3.4/dist-packages/xmppwb/core.py", line 17, in <module> from xmppwb.bridge import XMPPWebhookBridge, InvalidConfigError File "/usr/local/lib/python3.4/dist-packages/xmppwb/bridge.py", line 87 async def handle_outgoing(self, outgoing_webhook, msg): ^ SyntaxError: invalid syntax
Any ideas how to solve that
Since Cisco's implementation of Jabber is terrible, finding the service via DNS is next to impossible at my org. Any options for customizing the server that it's trying to connect with?
Hello
as far as i can tell to rocket chat user's avatar is stored in https://{rocketchaturl}/avatar/{rocketchatuser}.jpg, and i think that it's possible in the incoming webook to pass the icon_url
Do you think we could pass along the {rocketchatuser} so xmpp posts would appear with the user avatar. Do you think that in the bridge.py isn't possible to just put something like 'icon_url' : "https://{rocketchaturl}/avatar/" + username.+ ".jpg" ?
Hello.
I have xmppbw up and running but bridging only seems to work in one direction. I can enter some text in the rocketchat webbrowser and the text is shown in the conference configured. But when i enter some text via xabber (android) in the very same conference the text is not shown in the browser window in rocketchat. Firewall is disabled and i am able to connect on port 443. Here is the debug output:
04-20:43:37 INFO poll 299999.109 ms took 128825.052 ms: 1 events
04-20:43:37 DEBUG --> Received message from XMPP by [email protected]/himbeere: hallo!
04-20:43:37 DEBUG <-- Sending outgoing webhook. (from '[email protected]/himbeere')
04-20:43:37 DEBUG Get address info chat.meine-oma.de:443, type=<SocketKind.SOCK_STREAM: 1>
04-20:43:37 DEBUG Getting address info chat.meine-oma.de:443, type=<SocketKind.SOCK_STREAM: 1> took 0.933 ms: [(<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('138.201.43.25', 443))]
04-20:43:37 DEBUG poll 171169.313 ms took 0.615 ms: 1 events
04-20:43:37 DEBUG connect <socket.socket fd=8, family=AddressFamily.AF_INET, type=2049, proto=6, laddr=('0.0.0.0', 0)> to ('138.201.43.25', 443)
04-20:43:37 DEBUG poll 171167.081 ms took 0.016 ms: 1 events
04-20:43:37 DEBUG <_SelectorSslTransport fd=8 read=idle write=<idle, bufsize=0>> starts SSL handshake
04-20:43:37 DEBUG poll 171165.378 ms took 1.729 ms: 1 events
04-20:43:37 DEBUG poll 171162.243 ms took 0.120 ms: 1 events
04-20:43:37 DEBUG <_SelectorSslTransport fd=8 read=polling write=<idle, bufsize=0>>: SSL handshake took 4.4 ms
04-20:43:37 DEBUG <ssl.SSLSocket fd=8, family=AddressFamily.AF_INET, type=2049, proto=6, laddr=('138.201.43.25', 54502), raddr=('138.201.43.25', 443)> connected to chat.meine-oma.de:443: (<_SelectorSslTransport fd=8 read=polling write=<idle, bufsize=0>>, <aiohttp.parsers.StreamProtocol object at 0x7f5b5dfe47b8>)
04-20:43:37 DEBUG poll 171159.968 ms took 616.760 ms: 1 events
04-20:44:08 INFO poll 30720.661 ms took 30758.418 ms: timeout
04-20:44:28 INFO poll 139781.744 ms took 19886.611 ms: 1 events
04-20:44:28 DEBUG poll 119892.160 ms took 0.021 ms: 1 events
04-20:43:37 DEBUG --> Received message from XMPP by [email protected]/himbeere: hallo!
04-20:43:37 DEBUG <-- Sending outgoing webhook. (from '[email protected]/himbeere')
04-20:43:37 DEBUG Get address info chat.meine-oma.de:443, type=<SocketKind.SOCK_STREAM: 1>
04-20:43:37 DEBUG Getting address info chat.meine-oma.de:443, type=<SocketKind.SOCK_STREAM: 1> took 0.933 ms: [(<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('138.201.43.25', 443))]
04-20:43:37 DEBUG poll 171169.313 ms took 0.615 ms: 1 events
04-20:43:37 DEBUG connect <socket.socket fd=8, family=AddressFamily.AF_INET, type=2049, proto=6, laddr=('0.0.0.0', 0)> to ('138.201.43.25', 443)
04-20:43:37 DEBUG poll 171167.081 ms took 0.016 ms: 1 events
04-20
thanks again.
We had discovered a minor issue:
You can not omit the mucs section in bridge.conf
Here is our workaround:
# A list of all MUCs that should be available to the bridges defined later.
# none, as MUCs are not supported by IM+ client for Windows Phone, but we define one, seems needed
mucs:
- jid: [email protected]
nickname: nonexistent
I would like to start a discussion, which steps, scripts and elements would be needed, to automatically generate a bridge.conf file and sync all users, conversations and channels to a jabber server, so that people could simply choose, either to use an xmpp client or (in our case) Rocket.Chat. This is also a requirement discussed here: RocketChat/Rocket.Chat#404
New issue to add an Unsafe option, to allow bypass of SSL validation.
I have the code working with a -u option on the command line, just need permission to push a branch so you can merge.
Currently the XMPP parts of a single bridge don't relay messages between each other. Implementing this could be useful to keep the XMPP parts of a bridge "in sync".
We have set up an XMPP bridge with Rocket.Chat serving 2 MUCs and 1 JID (to a single user), using a common bridge-JID and defining separate webhooks for each room in RC.
We have the result, that messages mirrored to the JID are also seen in each MUC. Is this because we have enabled at each MUC:
- relay_all_normal: true
Or what exactly is this option good for?
if relay_all_normal: self.outgoing_mappings['all_normal'].append(outgoing_webhook)
https://github.com/saqura/xmppwb/blob/master/CONFIGURATION.rst says:
The bridge can also relay all messages received from normal JIDs. Note that this will only trigger outgoing webhooks
So, does this mirror any message which is passing the bridge-JID to the MUC, where it is set true, even if the message was not targeted to the MUC?
In the sample configuration file, this option is set to true, which may be probably not the desired effect at least for our use cases.
bridge.conf.anonymized.txt
Hey there,
currently struggeling with getting everything to run ;)
One thing that hit me (and which I could resolve) was that the dependency to slixmpp will cause an
ERROR 'XEP_0045' object has no attribute 'joinMUC'
when slixmpp is > 1.1 (current stable is 1.2.1)
Thanks for your effort in creating this bridge! Hope you can fix this issue.
Hello Devs.
I'm playing around with xmppwb but with little success. After running:
xmppwb --config /etc/xmppwb/config.conf
i get:
Traceback (most recent call last):
File "/usr/bin/xmppwb", line 9, in <module>
load_entry_point('xmppwb==0.2.6', 'console_scripts', 'xmppwb')()
File "/usr/lib64/python3.4/site-packages/pkg_resources/__init__.py", line 558, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib64/python3.4/site-packages/pkg_resources/__init__.py", line 2682, in load_entry_point
return ep.load()
File "/usr/lib64/python3.4/site-packages/pkg_resources/__init__.py", line 2355, in load
return self.resolve()
File "/usr/lib64/python3.4/site-packages/pkg_resources/__init__.py", line 2361, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/usr/lib64/python3.4/site-packages/xmppwb/core.py", line 17, in <module>
from xmppwb.bridge import XMPPWebhookBridge, InvalidConfigError
File "/usr/lib64/python3.4/site-packages/xmppwb/bridge.py", line 90
async def handle_outgoing(self, outgoing_webhook, msg):
^
SyntaxError: invalid syntax
The specific snippet looks like:
outgoing_webhooks:
# Note: "Outgoing from this bridge" means "Incoming to RocketChat",
# so this URL refers to the incoming webhook URL of RocketChat.
- url: https://domain/hooks/....deleted
override_username: "{nick}"
message_template: "_{msg}_"
use_attachment_formatting: true
Any suggestions?
thanks and cheers
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.