2018-08-04 10:16:28 +00:00
|
|
|
# go-sendxmpp
|
|
|
|
|
|
|
|
## about
|
|
|
|
|
2022-09-04 12:37:11 +00:00
|
|
|
A tool to send messages to an XMPP contact or MUC inspired by [sendxmpp](https://sendxmpp.hostname.sk/).
|
2021-04-18 08:52:38 +00:00
|
|
|
You can find other sendxmpp alternatives in the [XSF wiki](https://wiki.xmpp.org/web/User:MDosch/Sendxmpp_incarnations).
|
2018-08-04 10:16:28 +00:00
|
|
|
|
2021-01-29 17:09:58 +00:00
|
|
|
## support
|
|
|
|
|
|
|
|
You might join the [chat](https://join.jabber.network/#go-sendxmpp@chat.mdosch.de?join) if you have problems,
|
|
|
|
want to contribute or just want to talk about the project. You might also talk about any of the other
|
|
|
|
sendxmpp incarnations. :)
|
|
|
|
|
2021-09-09 09:35:21 +00:00
|
|
|
[![Go-sendxmpp MUC badge](https://chat.mdosch.de:5281/muc_badge/go-sendxmpp@chat.mdosch.de)](https://join.jabber.network/#go-sendxmpp@chat.mdosch.de?join)
|
|
|
|
|
2018-08-04 10:16:28 +00:00
|
|
|
## requirements
|
|
|
|
|
|
|
|
* [go](https://golang.org/)
|
|
|
|
|
|
|
|
## installation
|
|
|
|
|
2022-01-12 11:04:25 +00:00
|
|
|
### repositories including go-sendxmpp
|
|
|
|
|
|
|
|
[![Packaging status](https://repology.org/badge/vertical-allrepos/go:sendxmpp.svg)](https://repology.org/project/go:sendxmpp/versions)
|
|
|
|
|
|
|
|
### manual installation
|
|
|
|
|
|
|
|
#### Go < 1.16
|
2018-08-04 10:16:28 +00:00
|
|
|
|
2018-08-10 10:14:21 +00:00
|
|
|
```plain
|
2021-11-02 12:48:39 +00:00
|
|
|
$ go get -u salsa.debian.org/mdosch/go-sendxmpp
|
|
|
|
```
|
|
|
|
|
2022-01-12 11:04:25 +00:00
|
|
|
#### Go >= 1.16
|
2021-11-02 12:48:39 +00:00
|
|
|
|
2022-02-25 07:42:02 +00:00
|
|
|
Latest release:
|
|
|
|
|
2021-11-02 12:48:39 +00:00
|
|
|
```plain
|
|
|
|
$ go install salsa.debian.org/mdosch/go-sendxmpp@latest
|
2018-08-04 10:16:28 +00:00
|
|
|
```
|
|
|
|
|
2022-02-25 07:42:02 +00:00
|
|
|
Current development version:
|
|
|
|
|
|
|
|
```plain
|
|
|
|
$ go install salsa.debian.org/mdosch/go-sendxmpp@master
|
|
|
|
```
|
|
|
|
|
2018-08-04 10:16:28 +00:00
|
|
|
You will find the binary in `$GOPATH/bin` or, if set, `$GOBIN`.
|
|
|
|
|
2022-01-29 13:41:36 +00:00
|
|
|
### binaries
|
|
|
|
|
|
|
|
There are some (automatically built and untested) binaries linked to the
|
|
|
|
[release](https://salsa.debian.org/mdosch/go-sendxmpp/-/releases).
|
|
|
|
|
2018-08-04 10:16:28 +00:00
|
|
|
## usage
|
|
|
|
|
2018-08-10 11:53:42 +00:00
|
|
|
You can either pipe a programs output to `go-sendxmpp`, write in your terminal (put \^D in a new
|
|
|
|
line to finish) or send the input from a file (`-m` or `--message`).
|
2018-08-04 10:16:28 +00:00
|
|
|
|
2022-02-22 18:57:03 +00:00
|
|
|
The account data is expected at `~/.config/go-sendxmpp/config` if no other configuration file location
|
2021-03-10 08:56:41 +00:00
|
|
|
is specified with `-f` or `--file`. The configuration file is expected to be in the following format:
|
2018-08-04 10:16:28 +00:00
|
|
|
|
2018-08-10 10:14:21 +00:00
|
|
|
```plain
|
2020-06-06 10:06:09 +00:00
|
|
|
username: <your_jid>
|
2018-08-10 10:14:21 +00:00
|
|
|
password: <your_jabber_password>
|
|
|
|
```
|
2018-08-04 10:16:28 +00:00
|
|
|
|
2021-03-03 10:39:20 +00:00
|
|
|
If this is not sufficient to connect you might also specify `jserver` and `port`. It is also possible to
|
2020-10-01 16:55:41 +00:00
|
|
|
use a password manager. In this case the `password` setting should be replaced by the `eval_password`
|
|
|
|
setting:
|
|
|
|
|
|
|
|
```
|
|
|
|
eval_password: <command_to_unlock_your_password>
|
|
|
|
```
|
|
|
|
|
2022-08-06 09:52:47 +00:00
|
|
|
You can also configure the alias/nickname for MUCs via the `alias` setting:
|
2021-06-26 08:05:47 +00:00
|
|
|
|
|
|
|
```
|
2022-09-01 20:15:29 +00:00
|
|
|
alias: <my_alias>
|
2021-06-26 08:05:47 +00:00
|
|
|
```
|
|
|
|
|
2020-10-01 16:55:41 +00:00
|
|
|
If no configuration file is present or if the values should be overridden it is possible to define
|
|
|
|
the account details via command line options:
|
2018-08-10 10:14:21 +00:00
|
|
|
|
|
|
|
```plain
|
2022-08-06 09:52:47 +00:00
|
|
|
Usage: go-sendxmpp [-cdilnt] [-a value] [-f value] [--help] [--http-upload value] [-j value] [-m value] [--muc-password value] [--ox] [--ox-delete-nodes] [--ox-genprivkey-rsa] [--ox-genprivkey-x25519] [--ox-import-privkey value] [--ox-passphrase value] [-p value] [--raw] [-r value] [--timeout value] [--tls-version value] [-u value] [--version] [parameters ...]
|
|
|
|
-a, --alias=value Set alias/nicknamefor chatrooms.
|
2018-12-15 15:15:30 +00:00
|
|
|
-c, --chatroom Send message to a chatroom.
|
2018-08-10 13:03:04 +00:00
|
|
|
-d, --debug Show debugging info.
|
2022-02-07 15:19:30 +00:00
|
|
|
-f, --file=value Set configuration file. (Default:
|
|
|
|
~/.config/go-sendxmpp/sendxmpprc)
|
2018-08-10 13:03:04 +00:00
|
|
|
--help Show help.
|
2020-04-10 09:21:17 +00:00
|
|
|
--http-upload=value
|
|
|
|
Send a file via http-upload.
|
2018-08-10 13:03:04 +00:00
|
|
|
-i, --interactive Interactive mode (for use with e.g. 'tail -f').
|
2018-08-10 10:14:21 +00:00
|
|
|
-j, --jserver=value
|
2018-08-10 13:03:04 +00:00
|
|
|
XMPP server address.
|
2022-02-07 15:19:30 +00:00
|
|
|
-l, --listen Listen for messages and print them to stdout.
|
2018-08-10 11:12:21 +00:00
|
|
|
-m, --message=value
|
2018-08-10 13:03:04 +00:00
|
|
|
Set file including the message.
|
2022-02-19 07:30:35 +00:00
|
|
|
--muc-password=value
|
|
|
|
Password for password protected MUCs.
|
2020-04-05 19:49:17 +00:00
|
|
|
-n, --no-tls-verify
|
|
|
|
Skip verification of TLS certificates (not recommended).
|
2022-04-17 15:16:29 +00:00
|
|
|
--ox Use "OpenPGP for XMPP" encryption (experimental).
|
2022-05-04 09:18:24 +00:00
|
|
|
--ox-delete-nodes
|
|
|
|
Delete existing OpenPGP nodes on the server.
|
2022-04-26 17:47:22 +00:00
|
|
|
--ox-genprivkey-rsa
|
2022-04-27 12:31:44 +00:00
|
|
|
Generate a private OpenPGP key (RSA 4096 bit) for the given
|
2022-04-26 17:47:22 +00:00
|
|
|
JID and publish the corresponding public key.
|
|
|
|
--ox-genprivkey-x25519
|
2022-05-04 09:18:24 +00:00
|
|
|
Generate a private OpenPGP key (x25519) for the given JID
|
|
|
|
and publish the corresponding public key.
|
2022-04-18 09:16:41 +00:00
|
|
|
--ox-import-privkey=value
|
|
|
|
Import an existing private OpenPGP key.
|
2022-04-17 15:16:29 +00:00
|
|
|
--ox-passphrase=value
|
|
|
|
Passphrase for locking and unlocking the private OpenPGP
|
|
|
|
key.
|
2018-08-10 10:14:21 +00:00
|
|
|
-p, --password=value
|
2018-08-10 13:03:04 +00:00
|
|
|
Password for XMPP account.
|
2022-02-07 15:19:30 +00:00
|
|
|
--raw Send raw XML.
|
2018-08-10 10:14:21 +00:00
|
|
|
-r, --resource=value
|
2018-08-10 13:03:04 +00:00
|
|
|
Set resource. When sending to a chatroom this is used as
|
2022-08-06 09:52:47 +00:00
|
|
|
'alias'. DEPRECATED: Use --alias instead.
|
2022-02-12 08:18:02 +00:00
|
|
|
--timeout=value
|
|
|
|
Connection timeout in seconds. [10]
|
2021-01-21 10:19:55 +00:00
|
|
|
-t, --tls Use direct TLS.
|
2022-02-12 08:36:12 +00:00
|
|
|
--tls-version=value
|
2022-04-17 15:16:29 +00:00
|
|
|
Minimal TLS version. 10 (TLSv1.0), 11 (TLSv1.1), 12
|
2022-02-12 08:36:12 +00:00
|
|
|
(TLSv1.2) or 13 (TLSv1.3). [12]
|
2018-08-10 10:14:21 +00:00
|
|
|
-u, --username=value
|
2021-01-29 17:41:25 +00:00
|
|
|
Username for XMPP account.
|
2022-02-12 10:16:45 +00:00
|
|
|
--version Show version information.
|
2018-08-04 10:16:28 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### examples
|
|
|
|
|
2018-08-10 10:14:21 +00:00
|
|
|
Send a message to two recipients using a configuration file.
|
|
|
|
|
2018-08-04 10:16:28 +00:00
|
|
|
```bash
|
2018-08-10 10:14:21 +00:00
|
|
|
cat message.txt | ./go-sendxmpp -f ./sendxmpp recipient1@example.com recipient2@example.com
|
2018-08-04 10:16:28 +00:00
|
|
|
```
|
|
|
|
|
2018-08-10 10:14:21 +00:00
|
|
|
Send a message to two recipients directly defining account credentials.
|
|
|
|
|
2018-08-04 10:16:28 +00:00
|
|
|
```bash
|
2018-08-10 10:14:21 +00:00
|
|
|
cat message.txt | ./go-sendxmpp -u bob@example.com -j example.com -p swordfish recipient1@example.com recipient2@example.com
|
2018-08-04 10:16:28 +00:00
|
|
|
```
|
2018-08-10 10:14:21 +00:00
|
|
|
|
|
|
|
Send a message to two groupchats (`-c`) using a configuration file.
|
|
|
|
|
|
|
|
```bash
|
|
|
|
cat message.txt | ./go-sendxmpp -cf ./sendxmpp chat1@conference.example.com chat2@conference.example.com
|
2018-08-10 13:03:04 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
Send file changes to two groupchats (`-c`) using a configuration file.
|
|
|
|
|
|
|
|
```bash
|
|
|
|
tail -f example.log | ./go-sendxmpp -cif ./sendxmpp chat1@conference.example.com chat2@conference.example.com
|
2018-12-15 15:15:30 +00:00
|
|
|
```
|