unified-push-xmpp/gateway
genofire fdf9687dc9
continuous-integration/drone the build was successful Details
docs(gateway): add service discovery (XEP 0030) to README
2021-09-17 19:51:04 +02:00
..
README.md docs(gateway): add service discovery (XEP 0030) to README 2021-09-17 19:51:04 +02:00
config_example.toml gateway: improve logging to be more privat 2021-09-14 09:31:45 +02:00
go.mod depends: update mellium.im/xmpp to main 2021-09-16 14:36:33 +02:00
go.sum depends: update mellium.im/xmpp to main 2021-09-16 14:36:33 +02:00
main.go gateway: add disco feature and identity 2021-09-15 15:49:13 +02:00
token.go docs: token definition 2021-09-14 22:14:25 +02:00
token_test.go gateway: fix test and depends 2021-09-14 20:22:49 +02:00
web.go implement JWT for anti spam 2021-09-14 01:33:15 +02:00
web_get.go ci: add test and woodpicker/droneCI support 2021-09-16 14:36:26 +02:00
web_post.go docs: fix typos 2021-09-16 01:04:43 +02:00
web_test.go ci: add test and woodpicker/droneCI support 2021-09-16 14:36:26 +02:00
xmpp.go docs: fix typos 2021-09-16 01:04:43 +02:00

README.md

UnifiedPush over XMPP - gateway

The gateway is an XMPP Component and Webserver.

The Webserver receive notifications from application server by using an JWT-Token as Endpoint Token. The Signature JWT-Token is validated, so that only the Token generated by this gateway could be used (and no spaming over this Gateway is possible). The JWT-Token contains the XMPP-Address of the Distributor, so that this Gateway does not require to store anything. Current the JWT-Token is not encrypted like in [RFC 7516(https://tools.ietf.org/html/rfc7516) as an JWE we are working on it. So the XMPP-Address could be readed by Application-Server, Application and Distributor (and could be leaked there - we hope you could trust them till we implement JWE)

The XMPP Component implements XEP-0225 it could be plugged in at every common server (like ejabberd or Prosody) with an Secret and domain name.

XMPP Specials

Service Discovery XEP-0030

As Part of the XMPP-Component we implement the following result of an Service Discovery:

<iq type='result'
    from='up.chat.sum7.eu'
    id='iq-disco-request'>
  <query xmlns='http://jabber.org/protocol/disco#info'>
    <identity
        category='pubsub'
        type='push'
        name='Unified Push over XMPP'/>
    <feature var='unifiedpush.org'/>
  </query>
</iq

Install

How to configure this gateway take a look into the config_example.toml, we prefer it place it under /etc/up-gateway.conf

The Builded gateway binary, we place it under /usr/local/bin/up-gateway.

To get it running, we prefer following systemd.service file under /etc/systemd/system/up-gateway.service:

[Unit]
Description=UnifiedPush gateway
After=network.target
After=ejabberd.service

[Service]
Type=simple
ExecStart=/usr/local/bin/up-gateway -c /etc/up-gateway.conf
Restart=always
RestartSec=5sec

[Install]
WantedBy=multi-user.target

And run systemctl enable --now up-gateway.service to startup and start at boot.

Demo Gateway

An Demo gateway is running under Endpoint-Address https://up.chat.sum7.eu/UP and under the XMPP-Address (jid of component) xmpp:up.chat.sum7.eu. Have fun by using it ;)