{"id":13493466,"url":"https://github.com/horazont/xmpp-echo-bot","last_synced_at":"2025-04-14T16:07:56.457Z","repository":{"id":50336127,"uuid":"130348941","full_name":"horazont/xmpp-echo-bot","owner":"horazont","description":"XMPP/Jabber echo bot (written in sed)","archived":false,"fork":false,"pushed_at":"2020-07-25T17:55:51.000Z","size":12,"stargazers_count":147,"open_issues_count":3,"forks_count":12,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-28T04:51:09.363Z","etag":null,"topics":["bash","chatbot","sed","xmpp-bot"],"latest_commit_sha":null,"homepage":null,"language":"sed","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/horazont.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-20T10:43:04.000Z","updated_at":"2025-03-24T04:41:09.000Z","dependencies_parsed_at":"2022-09-12T03:40:26.107Z","dependency_job_id":null,"html_url":"https://github.com/horazont/xmpp-echo-bot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/horazont%2Fxmpp-echo-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/horazont%2Fxmpp-echo-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/horazont%2Fxmpp-echo-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/horazont%2Fxmpp-echo-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/horazont","download_url":"https://codeload.github.com/horazont/xmpp-echo-bot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246273533,"owners_count":20750904,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","chatbot","sed","xmpp-bot"],"created_at":"2024-07-31T19:01:15.485Z","updated_at":"2025-03-30T03:31:21.975Z","avatar_url":"https://github.com/horazont.png","language":"sed","funding_links":[],"categories":["sed"],"sub_categories":[],"readme":"XMPP Echo Bot\n=============\n\nDo you know that situation, you really really need an XMPP echo bot, but you don’t have access to high-level tools like `Python \u003chttps://github.com/horazont/aioxmpp\u003e`_ to write one? All you have is `openssl`, `bash`, `dig`, `stdbuf` and `sed`? Then this tool is for you.\n\nThis is an XMPP echo bot written in (mostly) sed. Bash is used to do the pre-authentication setup (look up DNS records, establish TLS via ``openssl s_client``). sed processes the XML stream and handles all interaction with the server on the XMPP level. Yes, this kinda parses XML in sed.\n\nTested to work against Prosody 0.9.\n\nUsage\n-----\n\n::\n\n    ./echoz.sh user@domain password\n\nSupported Features\n------------------\n\n* Off-the-Record messaging\n* `XEP-0092 (Software Version) \u003chttps://xmpp.org/extensions/xep-0092.html\u003e`_\n* `XEP-0199 (XMPP Ping) \u003chttps://xmpp.org/extensions/xep-0199.html\u003e`_\n\nTestimonials\n------------\n\n* *This is crazy, I haven't crashed it yet!* — `Matthew Wild \u003chttps://github.com/mwild1\u003e`_\n* *I'm frightened. It's only two steps away from gaining consciousness.* — `Georg Lukas \u003chttps://op-co.de/\u003e`_\n* *I am simultaneously appalled and in awe. wow* — `Lance \u003chttps://github.com/legastero\u003e`_\n* *With Echoz.sed, we were able to reduce our XMPP Echo server costs by 90% compared to our previous TeX-based solution.* — Leon\n* *While simple and limited, sed is sufficiently powerful for a large number of purposes.* — `Wikipedia \u003chttps://en.wikipedia.org/wiki/Sed\u003e`_\n* *oh my god this actually works* — `Test \u003cxmpp:test@hub.sotecware.net\u003e`_\n\nImplementation Details\n----------------------\n\n* We use ``tr`` to convert ``\u003e`` to ``\\n`` -- since sed is line (or NUL) based, there’s not really another way to parse XMPP XML (which generally never contains newlines) with sed.\n* TLS is handled outside of sed for similar reasons. And to keep my sanity (some people might question whether I still have any bit of sanity left).\n* Likewise, SRV lookup and composition of the authentication data is entirely handled in bash. This also means that only PLAIN SASL authentication is supported -- SCRAM requires a level of interactivity which would be extremely hard to achieve in sed (not impossible though; we would \"just\" have to implement base64 and sha1-hmac in sed).\n* Since XMPP is a protocol where the client speaks first, we need to hand sed some initial input to allow it to generate a \"line\" of output (the stream header). We do that with bash, and use that opportunity to pass some configuration to the sed program (namely JID and authentication string).\n\n**Design Considerations**\n\n* We considered using ``xml2`` to convert the XML stream into events; however, it turns out that ``2xm[`` doesn’t like stream resets. Also, using the ``tr`` approach also allows us to detect the end of elements, which is useful for various purposes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhorazont%2Fxmpp-echo-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhorazont%2Fxmpp-echo-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhorazont%2Fxmpp-echo-bot/lists"}