Project

General

Profile

How to enable pep plugin?

中秋 李
Added over 1 year ago

Thank you for your time.

I've recently use a project from github named 'Conversations' as client connecting to tigase. When i wanted to publish my avatar, an error occurred 'your server does not support to publish avatar'. So i checked the info of tigase, it showed like the snapshot.jpg. This is my init.properties:

config-type=--gen-config-def
--admins=admin@www.xxxxxxxxx.cn
--virt-hosts = www.xxxxxxxxx.cn
--debug=server
--user-db-uri=jdbc:mysql://127.0.0.1/tigasedb?user=tigase12&password=xxxxxxxxxxxxx&useUnicode=true&characterEncoding=UTF-8

--sm-plugins=+pep,+starttls,+message-app,+urn:ietf:params:xml:ns:xmpp-sasl,presence

--comp-name-1=http
--comp-class-1=tigase.http.HttpMessageReceiver
--comp-class-2 = tigase.pubsub.PubSubComponent

http/http/port[I]=9090
http/api-keys[s]=open_access
c2s/watchdog_delay[L]=30000
c2s/watchdog_timeout[L]=30000
c2s/watchdog_ping_type[S]=XMPP  
#c2s/max-inactivity-time[L]=60
--c2s-ports=5626

Please tell me how to enable pep? Any help will be appreciated, thanks again.


Replies (5)

(1)

Added by Wojciech Kapcia TigaseTeam over 1 year ago

你好, hello.

While you've enabled the pep plugin (i.e. --sm-plugins=+pep@) it requires PubSub component to function, and unfortunately you have incomplete configuration in that area - you lack component name (you only have class). You should add @--comp-name-2=pubsub so your full config would look as follows:

config-type=--gen-config-def
--admins=admin@www.xxxxxxxxx.cn
--virt-hosts = www.xxxxxxxxx.cn
--debug=server
--user-db-uri=jdbc:mysql://127.0.0.1/tigasedb?user=tigase12&password=xxxxxxxxxxxxx&useUnicode=true&characterEncoding=UTF-8

--sm-plugins=+pep,+starttls,+message-app,+urn:ietf:params:xml:ns:xmpp-sasl,presence

--comp-name-1=http
--comp-class-1=tigase.http.HttpMessageReceiver
--comp-name-2=pubsub
--comp-class-2 = tigase.pubsub.PubSubComponent

http/http/port[I]=9090
http/api-keys[s]=open_access
c2s/watchdog_delay[L]=30000
c2s/watchdog_timeout[L]=30000
c2s/watchdog_ping_type[S]=XMPP  
#c2s/max-inactivity-time[L]=60
--c2s-ports=5626

Added by 中秋 李 over 1 year ago

Surprised to see you could speak chinese 'hello'? Aha :)

Thank you for your help. I think i have enabled pep in my tigase with your configuration, although the apk still shows pep was unavaible. However i only need publish my avatar. These are logs between client and tigase which is consistent with the specification in XEP-0084 3.1&3.2:

  1. client to tigase:
<pubsub xmlns="http://jabber.org/protocol/pubsub">

    <publish node="urn:xmpp:avatar:data">

        <item id="1f2b8015688ccc4938084772cc9cf27fcaff6ab5">

            <data xmlns="urn:xmpp:avatar:data">

                UklGRrgWAABXRUJQVlA4WAoAAAAQAAAAvwAAvwAAQUxQSEUIAAANx6egbSPnEv6sb/wEEBEZ/CRV

                JknZlm9klBvwhm3bIqnZtq3juFzB4+4hgsZdkEviuDvEg/vgGjcc4u6O3CE4cXfgwh3mguHnHbqY

                6a6pXqp/RvQ/pddFJmtsi7WW+9wSm2XYdeZI/MN5GmqsqT995F0L98mUmykl23mudoMGC73oFbtk

                vturSq7C9W52g4/M8679Mtm3Gqop6fJaulMjL5jiBxlVrhOdoo7Ksu1xwCYbN/jTfsns7etRWVKq

                rpVe1ujvB5lPvktv0NR5SqogVw01a6tro2+s8pnPbFTCy171mAIpZrvZUK8aYY+oltfcLa6XSrZj

                nOkCTTW1xVtescRBh2d53FzHSznf3Vq7/w0ZSH2d/Fu4p2vmX073ihlL/b1CV8M1F8IJpm3XzS4Z

                Q5aW+qmmrGq4Wft8kzxrvfbqGyZH6q10d7P1MoBst+kvAhfqp5ExZhruE7PVkfp5prvNOjF/vVEi

                dKKB6rvHEPea5DKpn2qM2/xPfB9nSgWRq2+yX92umWbuliXVJpqYLJ6zdNNLVNu5Wy+N/OjpalIe

                7GGbxG8Ns0W7nhl+drbej2sgxUr+ZY64re9p0c/WSR83Hed2PaV4nffF66VGSJda5ox3ug2eUFUK

                p/lenJ5hvHTKf8YgY4zyhAaSznFQfOaYJ80qG6WXn7XxH/1kSeq/wrxBGt5ojXX26+8rM9SRxFJx

                eqk0zFbfKon33GOwW5Syx9OCdRTZIu7ypGW+IsGNuvuvPlrIE9imq0QjM1SXb/NEj4q15RpKw++V

                vNAUCzU6Tb4fLJOoZo7gqXfJ1cUhsfWSYzWUZosks92S7xU5sp0SOznGULF1wI06u1WWdNk1w9tC

                uEIpg3xqodjaoYvVWrpAHVUkVVmuJMsrJ8l8FZWw1d+7bPKrby31uXCOV0qW6XopFmPfe9Uq6+2Q

                1E4HJLnXPkkW2a2M85R6jhO9LhYLqjpgt/3SfJtqSu1lmlir6Z8udalj/H+uigpE8H922OTnz71l

                ...

            </data>

        </item>

    </publish>

</pubsub>
  1. tigase to client:
  1. client to tigase:
<pubsub xmlns="http://jabber.org/protocol/pubsub">

    <publish node="urn:xmpp:avatar:metadata">

        <item id="1f2b8015688ccc4938084772cc9cf27fcaff6ab5">

            <metadata xmlns="urn:xmpp:avatar:metadata">

                <info width="192" height="192" type="image/webp" id="1f2b8015688ccc4938084772cc9cf27fcaff6ab5" bytes="5824"/>

            </metadata>

        </item>

    </publish>

</pubsub>
  1. tigase to client:

But after cleaning the cache of the client and using the same account to login, the avatar of this account was lost. And there was nothing i found in db to store the avatar. Would you please tell me how tigase deals with avatar publishing?

Added by 中秋 李 over 1 year ago

I hava just debugged the tigase. If i used pep in --sm-plugins, there was no 2/3/4 logs, while using pep-simple, there would be. So i think the avatar publishing iq stanza is processed by src/main/java/tigase/xmpp/impl/PepPlugin.java. In this file, i only find reply packets but no processing the avatar image.

Added by Andrzej Wójcik IoT 1 CloudTigaseTeam over 1 year ago

src/main/java/tigase/xmpp/impl/PepPlugin.java is a very basic implementation of PEP (named @pep-simple@), which just forwards notification about avatar/metadata changes to the recipients which are active, but data of avatar is not stored anywhere.

To use full implementation of a PEP, you have to use pep plugin and have PubSub component enabled.

But PubSub component, by default, is not sending last published items (which is expected by PEP specification) and you need to enable this feature by adding following entries to your configuration file.

pubsub/persistent-pep[B]=true
pubsub/send-last-published-item-on-presence[B]=true

With these lines added, after server restart, your client should receive avatar from PubSub component.

(1)

Added by 中秋 李 over 1 year ago

Oh yeah, thank you both, thank you so much. I have noticed this component was develped by you. All of you are great, and i love this forum, haha.

    (1-5/5)