2
0
mirror of https://github.com/msantos/xmppipe synced 2024-11-16 00:12:59 +00:00
Commit Graph

246 Commits

Author SHA1 Message Date
Michael Santos
8e25057316 Fix typo in comment 2023-02-10 07:48:58 -05:00
Michael Santos
f58742d7e0 examples: cleanup: use coproc 2022-09-26 07:29:19 -04:00
Michael Santos
11d854f9e7 0.14.5: fix usage 2022-09-19 08:50:07 -04:00
Michael Santos
840ef08251 0.14.4: standardize exit status
* 2: usage errors
* 0: usage (-h)
2022-09-09 08:25:02 -04:00
Michael Santos
771822da1a 0.14.3: seccomp: add syscalls
Add syscalls for Ubuntu 22.04.
2022-08-16 07:28:18 -04:00
Michael Santos
fc84ad2e9b seccomp: allow clock_gettime64
xmppipe aborts with bad system call on raspbian 11 (debian bullseye).

Possibly fixes https://github.com/msantos/xmppipe/issues/7
2022-06-18 10:07:14 -04:00
Michael Santos
7bbf51567b 0.14.2
Tag release for https://github.com/msantos/xmppipe/issues/6

Thanks @anjandev!
2022-02-07 08:29:15 -05:00
Michael Santos
a3a29bbba6 cleanup: move common operation to function 2022-02-03 08:48:47 -05:00
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
2022-02-02 07:43:59 -05:00
Michael Santos
20b987ce21 README: cleanup 2022-01-31 08:27:59 -05:00
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
```
2022-01-28 08:22:14 -05:00
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).
2022-01-27 08:36:45 -05:00
Michael Santos
e1cbff0f14 Makefile: update static target for Ubuntu 20.04+ 2022-01-26 13:12:49 -05:00
Michael Santos
2bece1a74d README: sandbox->restrict_process 2020-09-12 07:03:43 -04:00
Michael Santos
a4bba88e40 README: fix typos 2020-08-21 08:12:54 -04:00
Michael Santos
5b23af5675 README: run shellcheck on examples 2020-08-20 06:19:10 -04:00
Michael Santos
80135667d6 usage: cleanup 2020-07-31 07:41:26 -04:00
Michael Santos
0ba12c23af seccomp: allow ppoll(), faccessat() 2020-07-26 06:36:22 -04:00
Michael Santos
85c13af092 README: add HTTP upload, inline image example; formatting 2020-07-07 08:05:05 -04:00
Michael Santos
f80ab9c65e Update README/usage 2020-07-04 07:21:01 -04:00
Michael Santos
91a43f2433 -V/--version: display version information 2020-07-04 07:19:16 -04:00
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.
~~~
2020-07-02 07:33:50 -04:00
Michael Santos
4997f4be2c 0.14.0 2020-07-01 08:04:31 -04:00
Michael Santos
25d8272656 examples: format and run shellcheck
~~~
shfmt -i 2 -ci -w examples
shellcheck examples/*
~~~
2020-06-30 16:13:07 -04:00
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
2020-06-29 08:20:07 -04:00
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.
2020-06-28 10:28:15 -04:00
Michael Santos
45e96e6ea9 s/XMPPIPE_RESTRICT/RESTRICT/gi 2019-12-21 08:44:53 -05:00
Michael Santos
7dda5bafcd sandbox->restrict_process 2019-12-20 10:51:27 -05:00
Michael Santos
fa88bc9f6d seccomp: allow running on termux 2019-11-29 10:12:39 -05:00
Michael Santos
d708ce27b9 sandbox: fix pledge on openbsd 6.6 2019-11-26 08:49:16 -05:00
Michael Santos
2e05ea3808 README: update compatibility list 2019-07-27 10:59:49 -04:00
Michael Santos
abfa336640 xmppipe_uuid_gen: xmpp_uuid_gen NULL check wrapper 2019-07-17 10:23:23 -04:00
Michael Santos
ad1bf58c55 xmppipe_send: move internal functions 2019-07-16 08:55:37 -04:00
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>"?
2019-07-15 10:15:01 -04:00
Michael Santos
11bc581608 oob inline image: u -> I 2019-07-14 08:36:50 -04:00
Michael Santos
3119d639ca version: add child stanza before release 2019-07-13 08:47:35 -04:00
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
~~~
2019-07-12 10:23:07 -04:00
Michael Santos
5f2c3003ff v0.13.0
Update usage with --format option.
2019-07-04 10:10:40 -04:00
Michael Santos
a45b734211 options: remove --chat-marker 2019-07-03 07:54:19 -04:00
Michael Santos
2a75c3373a Always display chat markers
Remove the option to explicitly enable/disable chat markers.
2019-07-02 08:13:39 -04:00
Michael Santos
900daefce4 makefile: remove conversion warnings 2019-07-01 08:33:06 -04:00
Michael Santos
997fc6a102 version: fix double free
Fix segfault from pasto when releasing stanza.
2019-06-30 09:06:19 -04:00
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;
2019-06-29 11:07:59 -04:00
Michael Santos
8776afe0f5 Suppress conversion warnings 2019-06-28 10:04:53 -04:00
Michael Santos
134d3599ce stream_management: warning: cast strotonum() result 2019-06-27 10:10:29 -04:00
Michael Santos
c8774e591c strtonum: fix prototype warning 2019-06-26 10:14:26 -04:00
Michael Santos
20bfcbfa9f Makefile: add warnings 2019-06-25 09:42:16 -04:00
Michael Santos
396188ea87 xmppipe.h: fix prototype 2019-06-24 10:36:20 -04:00
Michael Santos
a21d4d5b29 xmppipe_send: remove shadowed variable 2019-06-23 08:04:29 -04:00
Michael Santos
42e0ce4a67 xmppipe: free child stanzas 2019-06-22 08:08:47 -04:00