jdev - 2020-04-09


  1. Guus

    I've reworked Openfire pubsub code. Can anyone suggest some ways to do some quick functional tests?

  2. Guus

    I've ran the Smack Integration Tests, which seem to be fine - but those don't go into much detail. I'd like to run some additional tests, preferably not ones created by me.

  3. jonas’

    aioxmpp has some PEP related tests for sure, and very bare PubSub tests

  4. Guus

    jonas’ cool - how do I run them?

  5. jonas’

    Guus, git clone https://github.com/horazont/aioxmpp, you may be able to get some inspiration from https://github.com/horazont/aioxmpp/blob/devel/utils/travis-e2etest-ejabberd.py

  6. jonas’

    if you adapt the scripts and configs in that repository to work with openfire, that’d be amazing

  7. Guus

    My understanding of the python language is that 'hssssssss' means that you should step away.

  8. jonas’

    that py file I linked you is more of a glorified shell script really. I can’t guide you at this moment, I’m supposed to be in a meeting in four minutes

  9. Guus

    kk, tx

  10. Guus

    There must be a better way to figure out what modules are needed other than to try and run it, see an error, and install that?

  11. Guus

    ah: https://docs.zombofant.net/aioxmpp/devel/user-guide/installation.html

  12. Guus

    I was looking under 'developer guide' 🙂

  13. Guus

    hmm, still missing modules

  14. Guus

    ohh, pip3 install -e .

  15. Guus

    look ma, I can do python

  16. Zash

    Look ma, no jvm!

  17. Guus

    heheeh

  18. Guus

    hmm, it doesn't like Openfire's self-signed certs, even when setting the no_verify option

  19. Zash

    openssl no_verify?

  20. Guus

    ah, it helps if you don't have a typo in "no_verify" (jonas: there's a typo in the documentation as well as in the ejabberd config file)

  21. Zash

    Guus, ever tried running scansion against Openfire?

  22. Guus

    no. I'd like to.

  23. Guus

    Ran 4503 tests in 76.160s FAILED (SKIP=4, errors=19, failures=5)

  24. Guus

    That's an impressive amount of tests.

  25. Guus

    Loooots of output - might need some help interpreting

  26. jonas’

    Guus, note that most of these are not end-to-end

  27. jonas’

    before you go further, what’s the output of python3 --version?

  28. Guus

    Python 3.6.9

  29. Guus

    We're disabling SASL anon by default. Can you share the configuration for a simple username/password auth?

  30. jonas’

    Guus, unfortunately, not

  31. jonas’

    it needs multiple connections usually

  32. jonas’

    (with different accounts)

  33. Guus

    hmm, that makes it harder to put in our CI

  34. jonas’

    I’m not sure if I ever developed the "pre-provisioned account" mode

  35. jonas’

    I planned for it, but I think I simply never needed it

  36. Zash

    Implement (in OF) a mode that simply accepts any username+password?

  37. jonas’

    then you still need (in aioxmpp) a mode which uses random username/password

  38. Guus

    It's all doable, but not today 🙂

  39. jonas’

    same here :)

  40. jonas’

    but I’d love to test against OF in the CI -- but I never got around to set it up

  41. Guus

    jonas’ : https://github.com/igniterealtime/Openfire/blob/master/runIntegrationTests

  42. Guus

    that's what we use for Smack's integration tests

  43. Guus

    probably more elaborate than what it needs to be

  44. Guus

    but it launches an openfire instance, and runs the tests

  45. Guus

    (Smack's implementation require an account that's allowed to create other accounts)

  46. Guus

    apart from needing to enable SASL anonymous, it worked pretty much out of the box

  47. Guus

    [global] provisioner=aioxmpp.e2etest.provision.AnonymousProvisioner [aioxmpp.e2etest.provision.AnonymousProvisioner] domain=cluster.goodbytes.im host=cluster-a.goodbytes.im no_verify=true

  48. Guus

    (note that at some point, that domain goes away - I'm using it for testing only)

  49. Guus

    Zash, how do I run scansion?

  50. Guus

    heck, how do I _find_ it. Googling for prosody scansion gives me linguistic results. 🙂

  51. Zash

    https://matthewwild.co.uk/projects/scansion/

  52. Guus

    is there a repo of scripts?

  53. Zash

    There's a bunch in the Prosody repo: https://hg.prosody.im/trunk/file/tip/spec/scansion

  54. Zash

    Those are written expecting that arbitrary username/passwords are accepted

  55. Guus

    Doesn't seem to like my self-signed cert either

  56. Zash

    Pretty sure we run our CI with TLS disabled

  57. Zash

    Prosody config is in the same directory

  58. Guus

    hmm... doesn't help

  59. Guus

    does it do DNS SRV lookups?

  60. Guus

    the domain in the JID does not resolve with an A record.

  61. Zash

    Probably

  62. Guus

    https://igniterealtime.org:443/httpfileupload/94c20187-8fa0-4f98-9d0f-0a1869538173/image.png

  63. Guus

    Unsure what to make of that

  64. Guus

    jonas’ I'd be greatful if you can help me interpret the gazillion lines of logs generated by your tests.

  65. Zash

    screenshot of text :|

  66. Zash

    Guus: I think you need to trick docker into letting it have access to where your xmpp server is running

  67. Guus

    screenshot of text to preserve format - didn't assume anyone wanted to copy stuff from this 🙂

  68. Guus

    ah, it does not have access by default?

  69. Zash

    "connection refused" is the relevant thing I assume

  70. Guus

    my docker is as good as my python

  71. Guus

    sure

  72. Guus

    but ... why 🙂

  73. Zash

    Try `--network host` maybe?

  74. Martin

    Wher is specified how a message should look like when sending the link to a http-uploaded file OOB? Or how is it done that clients show the file instead of the link?

  75. Martin

    Where is specified how a message should look like when sending the link to a http-uploaded file OOB? Or how is it done that clients show the file instead of the link?

  76. Zash

    Docker is so last years, now it's Kubernetes all the things!

  77. flow

    Martin, I think this is implementation dependend

  78. Zash

    Martin, source code of Conversations probably

  79. Martin

    Yeah, code == specification? ;-(

  80. Zash

    In theory you just follow XEP-0066

  81. Zash

    In practice I think you must have the URL both in that and in <body>, and nothing else

  82. Martin

    Thanks, will figure out.

  83. Zash

    I'm kinda sad that you can't include a description, which is supported by OOB.

  84. Zash

    Did anyone get anywhere with XEP-0385 yet?

  85. rion

    Psi supports 385

  86. rion

    But currently implementation is incomplete. Works for images and audio messages only. And has some bugs.

  87. Martin

    > In practice I think you must have the URL both in that and in <body>, and nothing else Ok, that worked. Thanks. 😃

  88. Martin

    > I'm kinda sad that you can't include a description, which is supported by OOB. That would be really nice.

  89. jonas’

    Guus, send them to me via email or something

  90. Martin

    Is it safe to assume that the max file size is always in the value of the second field of the second x in the reply to disco#info?

  91. Martin

    For the http upload service

  92. flow

    Martin, that sounds wrong

  93. flow

    Martin, why not use the field's name?

  94. flow

    and why *second* <x/>?

  95. Zash

    wat

  96. Martin

    Worked here for dismail (ejabberd) and my own server (prosody). Dunno how to access by name without cycling through all.

  97. flow

    Martin, that is very fragile

  98. flow

    so it is *definetly* not safe and unsound

  99. pep.

    Zash, movim also has 385 support

  100. Martin

    Ok, then I'd better go through all and check the names.

  101. Zash

    Martin, what language and xml library are you using?

  102. flow

    and trick question by Zash ;)

  103. flow

    aah, trick question by Zash ;)

  104. Zash

    pep., /react nice

  105. Martin

    DISCLAIMER: I am no dev so probably I am holding it wrong anyway.

  106. Martin

    I am using go and github.com/mattn/go-xmpp

  107. flow

    Martin, no worries. but you definetly should not settle for quick hacks, especially if they fragile

  108. Martin

    I did create a struct with the structure of the xml and then xml.Unmarshal the IQ reply into it.

  109. flow

    that alone sounds worrysome. due to the extensible nature of XMPP the returned XML may not match your struct

  110. pep.

    Martin, you can easily become a developer if you go into your Android settings and tap on "Build number" multiple times. Then it will say "You are now a developer!"

  111. flow

    that alone sounds worrisome. due to the extensible nature of XMPP the returned XML may not match your struct

  112. pep.

    It's that easy

  113. Martin

    Looking at the output it seems the max-file-size is in the value of the second field on the first and second x. But if this is not standardized I will check for the "max-file-size" in var while cycling through all.

  114. flow

    Martin, it *is* standardized

  115. pep.

    You need to own a device with android, it's the only requirement for being a developer

  116. Martin

    pep.: Did that several times already on all of my phones. Thanks, no I can not hide behind "I'm no dev" anymore. :(

  117. flow

    Martin, it is the value of the max-size-field of the extended disco info form with the type urn:xmpp:http:upload:0

  118. Martin

    Ok. So it is important to check the field name. That's what I wanted to know. Thanks. :)

  119. flow

    Martin, not only the field name, you also have to check that you are looking at the right form

  120. Martin

    About the issue that the struct might not matching if/when something there get's extended I don't know what to do, as somehow I must get the date of that byte array into something I can process.

  121. Martin

    flow: Meh, why everything must be complicated…

  122. flow

    I don't think it is complicated, nor that there is a much simpler alternative

  123. flow

    you could extra the value with a pull parser

  124. flow

    or mayben even an xpath expression

  125. Martin

    Hmm, that would be two new things to read up. ^^

  126. flow

    always a good idea to learn new things :)

  127. Martin

    It's always exponential growth, I want to do one thing than I need look up three things for that. Number 1 requires me to look up 4 other things, number two requires me to look up 2 new things and numer 3 requires me to look up 3 new things. And every level 2 new thing requires me to look up n level 3 new things. It's never ending. I, as an engineer, don't understand how you devs ever finished your studies because everything is a hydra. ^^

  128. flow

    the secret is: we are always studying and shaving yaks

  129. Martin

    You never shave Ge0rg, his avatar is as hairy as always!

  130. Martin

    So, you think this is sufficient for determining the max-file-size or is it still fragile? https://salsa.debian.org/mdosch-guest/go-sendxmpp/-/commit/9702df6c84a189fbf881c29c9ba07d3e77ae84c8

  131. flow

    Martin, it is far better, but AFAIKT you do not check if you look at the right form

  132. Martin

    What to check for? I don't see anything interesting for FORM:

  133. Martin

    <iq id='1eda7aa0-fd912ef9-30805dc5' type='result' to='go-sendxmpp@mdosch.de/go-sendxmpp' from='files.mdosch.de'> <query xmlns='http://jabber.org/protocol/disco#info'> <identity type='file' name='HTTP File Upload' category='store'/> <feature var='http://jabber.org/protocol/disco#info'/> <feature var='http://jabber.org/protocol/disco#items'/> <feature var='urn:xmpp:http:upload:0'/> <feature var='urn:xmpp:http:upload'/> <x type='result' xmlns='jabber:x:data'> <field type='hidden' var='FORM_TYPE'> <value>urn:xmpp:http:upload:0</value></field> <field type='text-single' var='max-file-size'> <value>104857600</value></field> </x> <x type='result' xmlns='jabber:x:data'> <field type='hidden' var='FORM_TYPE'> <value>urn:xmpp:http:upload</value></field> <field type='text-single' var='max-file-size'> <value>104857600</value></field> </x>

  134. Martin

    Or do you mean to check which is the http upload component? That's done there: https://salsa.debian.org/mdosch-guest/go-sendxmpp/-/blob/http_upload/httpupload.go#L141

  135. pep.

    Martin, I think he meant checking FORM_TYPE?

  136. Martin

    Ok, what is that good for? No need feed me with a golden spoon just direct me at the right xep. But all I see is `<field type='hidden' var='FORM_TYPE'>` which seems quite uninteresting for me.

  137. pep.

    Martin, the value of that field is what indicates what type of field it is

  138. pep.

    Which fields you may find in it

  139. Martin

    Ah, so I need to check for `urn:xmpp:http:upload:0`. Ok thx.

  140. pep.

    yeah

  141. Martin

    Ok, am checking for this as well now.

  142. Martin

    Thanks all for the useful feedback. 😃 If you feel bored someday you can go through the rest, tell me what I'm doing wrong there. 😂

  143. lovetox

    what priority do i have to set if i dont want to use priority

  144. flow

    lovetox, define "do not want to use priority"

  145. lovetox

    i just read i can just leave it out of the presence

  146. lovetox

    then server assumes 0

  147. flow

    that's right

  148. lovetox

    does it do anything if i include priority in a presence to a MUC?

  149. flow

    that's a good question. I think the priority in directed presence stanzas it not used anywhere

  150. flow

    but I could be wrong. A server dev could may say more about this

  151. flow

    but then again, *why* do you want to include a priority value in a directed presence?

  152. lovetox

    i dont want to, and i dont do it

  153. lovetox

    but i have no rational for it