Commit Graph

288 Commits (master)
 

Author SHA1 Message Date
Michael Santos 2df5896df2 Set a unique default resource
The default resource is "xmppipe". A subsequent xmppipe using the default
resource connects to the groupchat will be disconnected.

* reduce the amount of configuration needed for scripts
* make the resource unique on the same host by appending the PID
2 years ago
Michael Santos 20b987ce21 README: cleanup 2 years ago
Michael Santos f9bdddd910 0.14.1: --chat: fix use of username without domain
One to one chats with a username without a domain would echo back
messages. Use the domain from the user's JID:

```
xmppipe -u user1@example.com --chat user2
```
2 years ago
Michael Santos 15859bb11e seccomp: allowlist for termux/android 12
Update syscalls in seccomp policy for termux on android 12. With this
change, xmppipe works with the seccomp process restrictions on termux
but will still crash on exit:

* prctl(PR_SET_VMA): prctl(2) is not allowed by the stdin restrictions

* if prctl(2) is allowed, xmppipe aborts with "bad syscall" on exit. The
  system call doesn't show up in strace(1).
2 years ago
Michael Santos e1cbff0f14 Makefile: update static target for Ubuntu 20.04+ 2 years ago
Michael Santos 2bece1a74d README: sandbox->restrict_process 4 years ago
Michael Santos a4bba88e40 README: fix typos 4 years ago
Michael Santos 5b23af5675 README: run shellcheck on examples 4 years ago
Michael Santos 80135667d6 usage: cleanup 4 years ago
Michael Santos 0ba12c23af seccomp: allow ppoll(), faccessat() 4 years ago
Michael Santos 85c13af092 README: add HTTP upload, inline image example; formatting 4 years ago
Michael Santos f80ab9c65e Update README/usage 4 years ago
Michael Santos 91a43f2433 -V/--version: display version information 4 years ago
Michael Santos 69391951c8 freebsd: fix capsicum warning
~~~
In file included from src/restrict_process_capsicum.c:16:                   /usr/include/sys/capability.h:44:2: warning: this file includes <sys/capability.h> which is deprecated [-W#warnings]
 ^
1 warning generated.
~~~
4 years ago
Michael Santos 4997f4be2c 0.14.0 4 years ago
Michael Santos 25d8272656 examples: format and run shellcheck
~~~
shfmt -i 2 -ci -w examples
shellcheck examples/*
~~~
4 years ago
Michael Santos 11ee1c92f4 image-upload: example of uploading images
An example bot for:
* creating an HTTP upload slot
* using curl to put the image file
* displaying the image inline
4 years ago
Michael Santos c4b7c7d79c README: inline images, XEP-0363 HTTP Uploads
Document the support for inline images for displaying images in clients
like Conversations and for creating upload slots for files.
4 years ago
Michael Santos 45e96e6ea9 s/XMPPIPE_RESTRICT/RESTRICT/gi 4 years ago
Michael Santos 7dda5bafcd sandbox->restrict_process 4 years ago
Michael Santos fa88bc9f6d seccomp: allow running on termux 5 years ago
Michael Santos d708ce27b9 sandbox: fix pledge on openbsd 6.6 5 years ago
Michael Santos 2e05ea3808 README: update compatibility list 5 years ago
Michael Santos abfa336640 xmppipe_uuid_gen: xmpp_uuid_gen NULL check wrapper 5 years ago
Michael Santos ad1bf58c55 xmppipe_send: move internal functions 5 years ago
Michael Santos 31d6a03bfc XEP-0363: HTTP File Upload
Add initial support for XEP-0363. HTTP uploads can be used when colon
separated values for stdin is enabled:

~~~

u::::<filename>|<size (bytes)>[|<content-type>]

u::::example.png%7C16698

u::::tr.png%7C16698%7Cimage%2Fpng
~~~

The reponse:

~~~
U:upload.example.com:user@example.com/477937350262208314215778:https%3A%2F%2Fexample.com%2Fupload%2F1234%2Fabc%2Fexample.png%7Chttps%3A%2F%2Fexample.com%2Fupload%2F1234%2Fabc%2Fexample.png
~~~

TODO:

* support PUT header elements
* support/test error conditions

Questions:

* save the maximum file size returned by the server and disallow uploads
  larger than the value?

* xmppipe is "pinned" to the upload server returned in the IQ reply (the
  "to" field is ignored)

  * allow other upload servers?
  * error if different upload server is specified in "u:<from>:<to>"?
5 years ago
Michael Santos 11bc581608 oob inline image: u -> I 5 years ago
Michael Santos 3119d639ca version: add child stanza before release 5 years ago
Michael Santos cb21c2860e Support inline images
When using the csv input format, add a new format ('u') that wraps the
message in an "x:oob" element. The image will be displayed inline by
Conversations.

~~~
u:groupchat:::https%3A%2F%2Fhttpstatusdogs.com%2Fimg%2F500.jpg
~~~
5 years ago
Michael Santos 5f2c3003ff v0.13.0
Update usage with --format option.
5 years ago
Michael Santos a45b734211 options: remove --chat-marker 5 years ago
Michael Santos 2a75c3373a Always display chat markers
Remove the option to explicitly enable/disable chat markers.
5 years ago
Michael Santos 900daefce4 makefile: remove conversion warnings 5 years ago
Michael Santos 997fc6a102 version: fix double free
Fix segfault from pasto when releasing stanza.
5 years ago
Michael Santos 5e488e059a xmpp_conn_set_flags() argument is a long
Correct the type for the flag argument from int to long. Note the
compiler will still complain because, although xmpp_conn_set_flags() is
declared to take a signed long, the constants are declared as unsigned
longs:

src/xmppipe.c: In function ‘main’:
src/xmppipe.c:205:13: warning: conversion to ‘long unsigned int’ from
‘long int’ may change the sign of the result [-Wsign-conversion]
       flags |= XMPP_CONN_FLAG_TRUST_TLS;
             ^
src/xmppipe.c:205:16: warning: conversion to ‘long int’ from ‘long
unsigned int’ may change the sign of the result [-Wsign-conversion]
       flags |= XMPP_CONN_FLAG_TRUST_TLS;
5 years ago
Michael Santos 8776afe0f5 Suppress conversion warnings 5 years ago
Michael Santos 134d3599ce stream_management: warning: cast strotonum() result 5 years ago
Michael Santos c8774e591c strtonum: fix prototype warning 5 years ago
Michael Santos 20bfcbfa9f Makefile: add warnings 5 years ago
Michael Santos 396188ea87 xmppipe.h: fix prototype 5 years ago
Michael Santos a21d4d5b29 xmppipe_send: remove shadowed variable 5 years ago
Michael Santos 42e0ce4a67 xmppipe: free child stanzas 5 years ago
Michael Santos 2f4e1459e9 version: free stanza on error 5 years ago
Michael Santos c4de097c6b ping: free child stanza 5 years ago
Michael Santos e4e78775be muc: free child stanzas 5 years ago
Michael Santos 287bb92aee vesion: free allocated stanzas 5 years ago
Michael Santos 1bb03b563e xmppipe_send_message: fix memory leak
Fix a memory leak caused by improper usage of
xmpp_stanza_new()/xmpp_stanza_release() by replacing usage with the
simpler xmpp_message_new()/xmpp_message_set_body() API available in
libstrophe 0.9.0, as advised by @pasis.

Fixes https://github.com/msantos/xmppipe/issues/3.
5 years ago
Michael Santos 8792a8a05c Mark fun as static 5 years ago
Michael Santos e00a7fddd2 Consistently format using clang-format 5 years ago
Michael Santos 4b85976242 --keepalives -> --keepalive 5 years ago