From 854fa1faf9b2a5b49658eabf74f074de95de74d6 Mon Sep 17 00:00:00 2001 From: DebXWoody Date: Sat, 16 May 2020 08:45:05 +0200 Subject: [PATCH] xmppc Release 0.1.0 --- Makefile.am | 2 +- README.md | 7 ++-- changelog | 10 ++++++ configure.ac | 2 +- doc/Makefile | 8 ++--- doc/xmppc.1 | 58 ++++++++++++++++++++++-------- doc/{xmppc.1.txt => xmppc.1.adoc} | 54 +++++++++++++++++++--------- doc/xmppc.1.html | 60 +++++++++++++++++++++++-------- src/main.c | 1 + 9 files changed, 150 insertions(+), 52 deletions(-) rename doc/{xmppc.1.txt => xmppc.1.adoc} (54%) diff --git a/Makefile.am b/Makefile.am index 40184f0..96c1ee3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -18,7 +18,7 @@ man_sources = doc/xmppc.1 AM_CFLAGS = @AM_CFLAGS@ -I$(srcdir)/src -dist_doc_DATA = README.md +dist_doc_DATA = README.md doc/xmppc.1.html bin_PROGRAMS = xmppc xmppc_SOURCES = $(core_sources) $(main_source) diff --git a/README.md b/README.md index 23bedae..eb582cd 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ the xmpp library [libstrophe](http://strophe.im/libstrophe/). The project is using [GNU Automake](https://www.gnu.org/software/automake/). ``` -aptitude install libstrophe-dev +aptitude install libstrophe-dev libc6-dev libglib2.0-dev libgpgme-dev ./bootstrap.sh ./configure make @@ -25,7 +25,10 @@ make ## Config file -Config file: ` ~/.config/xmppc.conf` +Config file: ` ~/.config/xmppc.conf`. + +The `[default]` will be used, when the user doesn't provider an account and +doesn't provider a jid. ``` [default] diff --git a/changelog b/changelog index cec7e1e..2acb55c 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,13 @@ +2020-05-16 DebXWoody + + Release 0.1.0 + * Read Password from stdin + +2020-05-02 DebXWoody + + Release 0.0.6 + * OpenPGP Bug fixes + 2020-04-25 DebXWoody Release 0.0.5 diff --git a/configure.ac b/configure.ac index 8e6faa7..3470cc8 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([xmppc], [0.0.6], [stefan@debxwoody.de]) +AC_INIT([xmppc], [0.1.0], [stefan@debxwoody.de]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_SRCDIR([src/main.c]) diff --git a/doc/Makefile b/doc/Makefile index aa5d32f..456885e 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -1,7 +1,7 @@ -TXT_FILE = xmppc.1.txt +ADOC_FILE = xmppc.1.adoc all: doxygen Doxyfile - asciidoc -b docbook $(TXT_FILE) - asciidoc -b html $(TXT_FILE) - a2x --doctype manpage --format manpage $(TXT_FILE) + asciidoc -b docbook $(ADOC_FILE) + asciidoc -b html $(ADOC_FILE) + a2x --doctype manpage --format manpage $(ADOC_FILE) diff --git a/doc/xmppc.1 b/doc/xmppc.1 index 5d01c3c..217e66d 100644 --- a/doc/xmppc.1 +++ b/doc/xmppc.1 @@ -2,12 +2,12 @@ .\" Title: xmppc .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 04/29/2020 +.\" Date: 05/16/2020 .\" Manual: \ \& .\" Source: \ \& .\" Language: English .\" -.TH "XMPPC" "1" "04/29/2020" "\ \&" "\ \&" +.TH "XMPPC" "1" "05/16/2020" "\ \&" "\ \&" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,25 +32,35 @@ xmppc \- XMPP Command line Tool .SH "SYNOPSIS" .sp \fIxmppc\fR [\fIOPTIONS\fR] \-m \fIMODE\fR \fICOMMAND\fR [\&...] +.sp +\fIxmppc\fR [\-a \fIACCOUNT\fR] [\-j \fIJID\fR] [\-p \fIPASSWORD\fR] \-m \fIMODE\fR \fICOMMAND\fR [\&...] .SH "DESCRIPTION" .sp -xmppc is a command line tool +xmppc is a XMPP command line tool\&. You need an XMPP Account to use this tool\&. The account information can be defined via command line argument \-j \fIJID\fR\&. If no password is provided via \-p \fIPASSWORD\fR xmppc will ask the user to enter the password\&. Another option is to define 1 or more accounts within a configuration file\&. The option \-a \fIACCOUNT\fR can be used to select the account\&. +.sp +The argument \-m \fIMODE\fR defines the xmppc \fIMODE\fR which should be used (roster, message, pgp, omemo, openpgp, monitor, bookmark, mam, discovery)\&. The \fICOMMAND\fR and the args required by the \fICOMMAND\fR depends on the chosen \fIMODE\fR\&. .SH "OPTIONS" .PP \fB\-a, \-\-attribute\fR \fIACCOUNT\fR .RS 4 \fIACCOUNT\fR -is an xmpp account\&... +is a name of a xmpp account defined within the configuration file\&. .RE .PP \fB\-j, \-\-jid\fR \fIJID\fR .RS 4 -JID of the XMPP Account\&. [ +\fIJID\fR +of the XMPP Account\&. .RE .PP -\fB\-p, \-\-pwd\fR \fIPWD\fR, \fB\-v\fR \fIVERBOSE\fR +\fB\-p, \-\-pwd\fR \fIPWD\fR .RS 4 -Verbose flags\&. \-v WARN \-vv INFO \-\-vvv DEBUG \-vvvv TRACE +Password of the XMPP Account\&. +.RE +.PP +\fB\-v\fR \fIVERBOSE\fR, Verbose flags\&. \-v[v[v[v]]] +.RS 4 +\-v is WARN \-vv is INFO \-\-vvv is DEBUG \-vvvv is TRACE .RE .PP \fB\-\-help\fR @@ -61,8 +71,9 @@ Print program version number and help .sp xmppc modes\&. .PP -\fB\-m roster\fR:: Roster +\fB\-m roster\fR .RS 4 +The Roster mode can be used to provided information of the xmpp account\(cqs roster\&. The roster is the XMPP list of contacts\&. .sp .RS 4 .ie n \{\ @@ -91,7 +102,7 @@ xmppc modes\&. .PP \fB\-m message\fR .RS 4 -Message +The message mode can be used to send unencrypted messages to another xmpp account\&. .sp .RS 4 .ie n \{\ @@ -250,7 +261,16 @@ Service Discovery (XEP\-0030) .RE .SH "ENVIRONMENT VARIABLES" .sp -*none +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +HOME +.RE .SH "EXAMPLES" .sp .if n \{\ @@ -258,7 +278,7 @@ Service Discovery (XEP\-0030) .\} .nf xmppc \-\-jid user@domain\&.tld \-\-pwd "secret" \-\-mode roster list -xmppc \-\-jid user@domain\&.tld \-\-pwd "secret" \-\-mode pgp chat friend@domain\&.tld "Hello" +xmppc \-\-jid user@domain\&.tld \-\-mode pgp chat friend@domain\&.tld "Hello" xmppc \-a account1 \-\-mode discovery item conference@domain\&.tld xmppc \-\-mode bookmark list .fi @@ -291,7 +311,6 @@ pwd=password1 .nf [account2] jid=account2@domain\&.tld -pwd=password2 .fi .if n \{\ .RE @@ -325,10 +344,21 @@ Failure See https://codeberg\&.org/Anoxinon_e\&.V\&./xmppc/issues .SH "AUTHOR" .sp -See +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +DebXWoody (OpenPGP: A602F76893F138B4A8EFDDD5C2DC916F35751C24) +.RE .SH "RESOURCES" .sp -Codeberg: https://codeberg\&.org/Anoxinon_e\&.V\&./xmppc +Source: https://codeberg\&.org/Anoxinon_e\&.V\&./xmppc +.sp +Documentation: https://codeberg\&.org/Anoxinon_e\&.V\&./xmppc/wiki .SH "COPYING" .sp Copyright (C) 2020 Anoxinon e\&.V\&. Free use of this software is granted under the terms of the GNU General Public License (GPL)\&. diff --git a/doc/xmppc.1.txt b/doc/xmppc.1.adoc similarity index 54% rename from doc/xmppc.1.txt rename to doc/xmppc.1.adoc index 2f472bb..44ffebf 100644 --- a/doc/xmppc.1.txt +++ b/doc/xmppc.1.adoc @@ -10,23 +10,36 @@ SYNOPSIS -------- 'xmppc' ['OPTIONS'] -m 'MODE' 'COMMAND' [...] +'xmppc' [-a 'ACCOUNT'] [-j 'JID'] [-p 'PASSWORD'] -m 'MODE' 'COMMAND' [...] + DESCRIPTION ----------- -xmppc is a command line tool +xmppc is a XMPP command line tool. You need an XMPP Account to use this tool. +The account information can be defined via command line argument -j 'JID'. If no +password is provided via -p 'PASSWORD' xmppc will ask the user to enter the +password. Another option is to define 1 or more accounts within a configuration +file. The option -a 'ACCOUNT' can be used to select the account. + +The argument -m 'MODE' defines the xmppc 'MODE' which should be used (roster, +message, pgp, omemo, openpgp, monitor, bookmark, mam, discovery). The 'COMMAND' +and the args required by the 'COMMAND' depends on the chosen 'MODE'. + OPTIONS ------- *-a, --attribute* 'ACCOUNT':: - 'ACCOUNT' is an xmpp account... + 'ACCOUNT' is a name of a xmpp account defined within the configuration file. *-j, --jid* 'JID':: - JID of the XMPP Account. -[ + 'JID' of the XMPP Account. + *-p, --pwd* 'PWD':: + Password of the XMPP Account. *-v* 'VERBOSE':: - Verbose flags. -v WARN -vv INFO --vvv DEBUG -vvvv TRACE + Verbose flags. -v[v[v[v]]]:: + -v is WARN -vv is INFO --vvv is DEBUG -vvvv is TRACE *--help*:: Print program version number and help @@ -36,28 +49,36 @@ MODES AND COMMANDS ------------------ xmppc modes. -*-m roster*:: Roster:: +*-m roster*:: +The Roster mode can be used to provided information of the xmpp account's +roster. The roster is the XMPP list of contacts. * *list* - List all contacts * *export* - Exports all contacts -*-m message*:: Message +*-m message*:: +The message mode can be used to send unencrypted messages to another xmpp +account. * *chat * - Sending unencrypted message to jid -*-m pgp*:: PGP Mode (XEP-0027) +*-m pgp*:: +PGP Mode (XEP-0027) * *chat * - Sending pgp encrypted message to jid -*-m omemo*:: OMEMO Mode (XEP-0384) +*-m omemo*:: +OMEMO Mode (XEP-0384) * *list* - List the device IDs and fingerprints -*-m openpgp*:: openpgp mode (XEP-0373) +*-m openpgp*:: +openpgp mode (XEP-0373) * *signcrypt * - Sending pgp signed and encrypted message to jid -*-m monitor*:: Monitot mode +*-m monitor*:: +Monitot mode * *stanza* - Stanza Monitor * *monitor* - microblog Monitor microblog (XEP-0277) @@ -79,13 +100,13 @@ xmppc modes. ENVIRONMENT VARIABLES --------------------- -*none +* HOME EXAMPLES -------- xmppc --jid user@domain.tld --pwd "secret" --mode roster list - xmppc --jid user@domain.tld --pwd "secret" --mode pgp chat friend@domain.tld "Hello" + xmppc --jid user@domain.tld --mode pgp chat friend@domain.tld "Hello" xmppc -a account1 --mode discovery item conference@domain.tld xmppc --mode bookmark list @@ -104,7 +125,6 @@ Example: [account2] jid=account2@domain.tld - pwd=password2 [account3] jid=account3@domain.tld @@ -126,11 +146,13 @@ See AUTHOR ------ -See +* DebXWoody (OpenPGP: A602F76893F138B4A8EFDDD5C2DC916F35751C24) RESOURCES --------- -Codeberg: +Source: + +Documentation: COPYING diff --git a/doc/xmppc.1.html b/doc/xmppc.1.html index d2354e7..7a40240 100644 --- a/doc/xmppc.1.html +++ b/doc/xmppc.1.html @@ -747,12 +747,20 @@ asciidoc.install();

SYNOPSIS

xmppc [OPTIONS] -m MODE COMMAND [<args>…]

+

xmppc [-a ACCOUNT] [-j JID] [-p PASSWORD] -m MODE COMMAND [<args>…]

DESCRIPTION

-

xmppc is a command line tool

+

xmppc is a XMPP command line tool. You need an XMPP Account to use this tool. +The account information can be defined via command line argument -j JID. If no +password is provided via -p PASSWORD xmppc will ask the user to enter the +password. Another option is to define 1 or more accounts within a configuration +file. The option -a ACCOUNT can be used to select the account.

+

The argument -m MODE defines the xmppc MODE which should be used (roster, +message, pgp, omemo, openpgp, monitor, bookmark, mam, discovery). The COMMAND +and the args required by the COMMAND depends on the chosen MODE.

@@ -764,7 +772,7 @@ asciidoc.install();

- ACCOUNT is an xmpp account… + ACCOUNT is a name of a xmpp account defined within the configuration file.

@@ -772,19 +780,26 @@ asciidoc.install();

- JID of the XMPP Account. -[ + JID of the XMPP Account.

-p, --pwd PWD
+
+

+ Password of the XMPP Account. +

+
-v VERBOSE
+
+Verbose flags. -v[v[v[v]]] +

- Verbose flags. -v WARN -vv INFO --vvv DEBUG -vvvv TRACE + -v is WARN -vv is INFO --vvv is DEBUG -vvvv is TRACE

@@ -804,9 +819,13 @@ asciidoc.install();

xmppc modes.

--m roster:: Roster +-m roster
+

+The Roster mode can be used to provided information of the xmpp account’s +roster. The roster is the XMPP list of contacts. +

  • @@ -825,7 +844,8 @@ asciidoc.install();

-Message +The message mode can be used to send unencrypted messages to another xmpp +account.

  • @@ -956,7 +976,13 @@ Service Discovery (XEP-0030)

    ENVIRONMENT VARIABLES

    -

    *none

    +
      +
    • +

      +HOME +

      +
    • +
    @@ -965,7 +991,7 @@ Service Discovery (XEP-0030)
    xmppc --jid user@domain.tld --pwd "secret" --mode roster list
    -xmppc --jid user@domain.tld --pwd "secret" --mode pgp chat friend@domain.tld "Hello"
    +xmppc --jid user@domain.tld --mode pgp chat friend@domain.tld "Hello"
     xmppc -a account1 --mode discovery item conference@domain.tld
     xmppc --mode bookmark list
    @@ -992,8 +1018,7 @@ pwd=password1
    [account2]
    -jid=account2@domain.tld
    -pwd=password2
    +jid=account2@domain.tld
    @@ -1037,13 +1062,20 @@ pwd=password3

    AUTHOR

    -

    See

    +
      +
    • +

      +DebXWoody (OpenPGP: A602F76893F138B4A8EFDDD5C2DC916F35751C24) +

      +
    • +
    @@ -1058,7 +1090,7 @@ granted under the terms of the GNU General Public License (GPL).

    diff --git a/src/main.c b/src/main.c index f55ca4f..eba6587 100644 --- a/src/main.c +++ b/src/main.c @@ -457,6 +457,7 @@ int main(int argc, char *argv[]) { pwd[strlen(pwd)-1] = '\0'; } tcsetattr(STDIN_FILENO, TCSANOW, ¤t_terminal); + printf("\n"); } int paramc = argc- optind;