diff -Nru go-sendxmpp-0.1.2/CHANGELOG.md go-sendxmpp-0.2.0/CHANGELOG.md --- go-sendxmpp-0.1.2/CHANGELOG.md 2021-11-18 13:20:50.000000000 +0000 +++ go-sendxmpp-0.2.0/CHANGELOG.md 2022-02-12 11:30:08.000000000 +0000 @@ -1,5 +1,19 @@ # Changelog +##[v0.2.0] +### Added +- Added listening function. +- Added flag to configure connection timeout. +- Added flag to configure minimum TLS version. +- Added flag to show version. + +### Removed +- Removed deprecated option `-x`. + +## [v0.1.3] +### Changed +- Rename files to use a limited character set (alpha numerical and some extra characters) file name before uploading. Workaround for https://github.com/mattn/go-xmpp/issues/132 + ## [v0.1.2] ### Changed - Use xml.Marshal to safely build HTTP Upload request. diff -Nru go-sendxmpp-0.1.2/debian/changelog go-sendxmpp-0.2.0/debian/changelog --- go-sendxmpp-0.1.2/debian/changelog 2022-01-16 10:25:43.000000000 +0000 +++ go-sendxmpp-0.2.0/debian/changelog 2022-02-17 10:46:47.000000000 +0000 @@ -1,3 +1,9 @@ +go-sendxmpp (0.2.0-1) unstable; urgency=medium + + * New upstream release. + + -- Martin Dosch Thu, 17 Feb 2022 11:46:47 +0100 + go-sendxmpp (0.1.2-1) unstable; urgency=medium * Initial release (Closes: #905427) diff -Nru go-sendxmpp-0.1.2/.gitlab-ci.yml go-sendxmpp-0.2.0/.gitlab-ci.yml --- go-sendxmpp-0.1.2/.gitlab-ci.yml 2021-11-18 13:20:50.000000000 +0000 +++ go-sendxmpp-0.2.0/.gitlab-ci.yml 2022-02-12 11:30:08.000000000 +0000 @@ -23,7 +23,7 @@ stages: - test - build - - deploy + - release format: stage: test @@ -32,62 +32,39 @@ - go vet $(go list ./... | grep -v /vendor/) - go test -race $(go list ./... | grep -v /vendor/) -compile_linux-amd64: +compile: stage: build only: - tags script: - - env GOOS=linux GOARCH=amd64 go build -race -ldflags "-extldflags '-static'" -o $CI_PROJECT_DIR/go-sendxmpp + - echo "${CI_JOB_ID}" > CI_JOB_ID.txt + - env GOOS=linux GOARCH=amd64 go build -race -ldflags "-extldflags '-static'" -o $CI_PROJECT_DIR/linux-amd64/go-sendxmpp + - env GOOS=linux GOARCH=arm64 go build -ldflags "-extldflags '-static'" -o $CI_PROJECT_DIR/linux-arm64/go-sendxmpp + - env GOOS=linux GOARCH=386 go build -ldflags "-extldflags '-static'" -o $CI_PROJECT_DIR/linux-386/go-sendxmpp + - env GOOS=linux GOARCH=arm go build -ldflags "-extldflags '-static'" -o $CI_PROJECT_DIR/linux-arm/go-sendxmpp + - env GOOS=windows GOARCH=386 go build -ldflags "-extldflags '-static'" -o $CI_PROJECT_DIR/win386/go-sendxmpp.exe + - env GOOS=windows GOARCH=amd64 go build -ldflags "-extldflags '-static'" -o $CI_PROJECT_DIR/win64/go-sendxmpp.exe artifacts: paths: - - go-sendxmpp + - linux-amd64/go-sendxmpp + - linux-arm64/go-sendxmpp + - linux-386/go-sendxmpp + - linux-arm/go-sendxmpp + - win386/go-sendxmpp.exe + - win64/go-sendxmpp.exe + - CI_JOB_ID.txt -compile_linux-arm64: - stage: build - only: - - tags - script: - - env GOOS=linux GOARCH=arm64 go build -ldflags "-extldflags '-static'" -o $CI_PROJECT_DIR/go-sendxmpp - artifacts: - paths: - - go-sendxmpp - -compile_linux-386: - stage: build +release: + stage: release + image: registry.gitlab.com/gitlab-org/release-cli:latest only: - tags script: - - env GOOS=linux GOARCH=386 go build -ldflags "-extldflags '-static'" -o $CI_PROJECT_DIR/go-sendxmpp - artifacts: - paths: - - go-sendxmpp - -compile_linux-arm: - stage: build - only: - - tags - script: - - env GOOS=linux GOARCH=arm go build -ldflags "-extldflags '-static'" -o $CI_PROJECT_DIR/go-sendxmpp - artifacts: - paths: - - go-sendxmpp - -compile_win386: - stage: build - only: - - tags - script: - - env GOOS=windows GOARCH=386 go build -ldflags "-extldflags '-static'" -o $CI_PROJECT_DIR/go-sendxmpp.exe - artifacts: - paths: - - go-sendxmpp.exe - -compile_win64: - stage: build - only: - - tags - script: - - env GOOS=windows GOARCH=amd64 go build -ldflags "-extldflags '-static'" -o $CI_PROJECT_DIR/go-sendxmpp.exe - artifacts: - paths: - - go-sendxmpp.exe + - | + release-cli create --name "Release $CI_COMMIT_TAG" --tag-name $CI_COMMIT_TAG --description="`cat CHANGELOG.md`" \ + --assets-link "{\"name\":\"Linux amd64\",\"url\":\"https://salsa.debian.org/mdosch/go-sendxmpp/-/jobs/`cat CI_JOB_ID.txt`/artifacts/file/linux-amd64/go-sendxmpp\"}" \ + --assets-link "{\"name\":\"Linux arm64\",\"url\":\"https://salsa.debian.org/mdosch/go-sendxmpp/-/jobs/`cat CI_JOB_ID.txt`/artifacts/file/linux-arm64/go-sendxmpp\"}" \ + --assets-link "{\"name\":\"Linux 386\",\"url\":\"https://salsa.debian.org/mdosch/go-sendxmpp/-/jobs/`cat CI_JOB_ID.txt`/artifacts/file/linux-386/go-sendxmpp\"}" \ + --assets-link "{\"name\":\"Linux arm\",\"url\":\"https://salsa.debian.org/mdosch/go-sendxmpp/-/jobs/`cat CI_JOB_ID.txt`/artifacts/file/linux-arm/go-sendxmpp\"}" \ + --assets-link "{\"name\":\"Windows 386\",\"url\":\"https://salsa.debian.org/mdosch/go-sendxmpp/-/jobs/`cat CI_JOB_ID.txt`/artifacts/file/win386/go-sendxmpp.exe\"}" \ + --assets-link "{\"name\":\"Windows amd64\",\"url\":\"https://salsa.debian.org/mdosch/go-sendxmpp/-/jobs/`cat CI_JOB_ID.txt`/artifacts/file/win64/go-sendxmpp.exe\"}" diff -Nru go-sendxmpp-0.1.2/go.mod go-sendxmpp-0.2.0/go.mod --- go-sendxmpp-0.1.2/go.mod 2021-11-18 13:20:50.000000000 +0000 +++ go-sendxmpp-0.2.0/go.mod 2022-02-12 11:30:08.000000000 +0000 @@ -4,8 +4,8 @@ require ( github.com/gabriel-vasile/mimetype v1.4.0 - github.com/mattn/go-xmpp v0.0.0-20210723025538-3871461df959 + github.com/mattn/go-xmpp v0.0.0-20211029151415-912ba614897a github.com/pborman/getopt/v2 v2.1.0 - golang.org/x/net v0.0.0-20211020060615-d418f374d309 // indirect - salsa.debian.org/mdosch/xmppsrv v0.1.0 + golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect + salsa.debian.org/mdosch/xmppsrv v0.1.1 ) diff -Nru go-sendxmpp-0.1.2/go-sendxmpp.go go-sendxmpp-0.2.0/go-sendxmpp.go --- go-sendxmpp-0.1.2/go-sendxmpp.go 2021-11-18 13:20:50.000000000 +0000 +++ go-sendxmpp-0.2.0/go-sendxmpp.go 2022-02-12 11:30:08.000000000 +0000 @@ -226,8 +226,7 @@ flagUser := getopt.StringLong("username", 'u', "", "Username for XMPP account.") flagPassword := getopt.StringLong("password", 'p', "", "Password for XMPP account.") flagChatroom := getopt.BoolLong("chatroom", 'c', "Send message to a chatroom.") - flagTLS := getopt.BoolLong("tls", 't', "Use direct TLS.") - flagStartTLS := getopt.BoolLong("start-tls", 'x', "Use StartTLS. (DEPRECATED)") + flagDirectTLS := getopt.BoolLong("tls", 't', "Use direct TLS.") flagResource := getopt.StringLong("resource", 'r', "", "Set resource. "+ "When sending to a chatroom this is used as 'alias'.") flagFile := getopt.StringLong("file", 'f', "", "Set configuration file. (Default: "+ @@ -237,6 +236,11 @@ flagSkipVerify := getopt.BoolLong("no-tls-verify", 'n', "Skip verification of TLS certificates (not recommended).") flagRaw := getopt.BoolLong("raw", 0, "Send raw XML.") + flagListen := getopt.BoolLong("listen", 'l', "Listen for messages and print them to stdout.") + flagTimeout := getopt.IntLong("timeout", 0, 10, "Connection timeout in seconds.") + flagTLSMinVersion := getopt.IntLong("tls-version", 0, 12, + "Minimal TLS version. 10 (TSLv1.0), 11 (TLSv1.1), 12 (TLSv1.2) or 13 (TLSv1.3).") + flagVersion := getopt.BoolLong("version", 0, "Show version information.") // Parse command line flags. getopt.Parse() @@ -247,19 +251,22 @@ os.Exit(0) } + // If requested, show version and quit. + if *flagVersion { + fmt.Println("go-sendxmpp", "0.2.0") + fmt.Println("License: BSD-2-clause") + os.Exit(0) + } + // Read recipients from command line and quit if none are specified. - // For sending raw XML it's not required to specify a recipient except - // for MUCs (go-sendxmpp will join the MUC automatically). + // For listening or sending raw XML it's not required to specify a recipient except + // when sending raw messages to MUCs (go-sendxmpp will join the MUC automatically). recipients := getopt.Args() - if (len(recipients) == 0 && !*flagRaw) || (len(recipients) == 0 && *flagChatroom) { + if (len(recipients) == 0 && !*flagRaw && !*flagListen) || + (len(recipients) == 0 && *flagChatroom) { log.Fatal("No recipient specified.") } - // Quit if unreasonable TLS setting is set. - if *flagStartTLS && *flagTLS { - log.Fatal("Use either TLS or StartTLS.") - } - // Check that all recipient JIDs are valid. for i, recipient := range recipients { validatedJid, err := MarshalJID(recipient) @@ -320,25 +327,45 @@ } } + // Timeout + timeout := time.Duration(*flagTimeout * 1000000000) + // Use ALPN var tlsConfig tls.Config tlsConfig.ServerName = user[strings.Index(user, "@")+1:] tlsConfig.NextProtos = append(tlsConfig.NextProtos, "xmpp-client") tlsConfig.InsecureSkipVerify = *flagSkipVerify + switch *flagTLSMinVersion { + case 10: + tlsConfig.MinVersion = tls.VersionTLS10 + case 11: + tlsConfig.MinVersion = tls.VersionTLS11 + case 12: + tlsConfig.MinVersion = tls.VersionTLS12 + case 13: + tlsConfig.MinVersion = tls.VersionTLS13 + default: + fmt.Println("Unknown TLS version.") + os.Exit(0) + } // Set XMPP connection options. options := xmpp.Options{ - Host: server, - User: user, - // TODO: Check whether the timeout is reasonable or maybe make - // it configurable - DialTimeout: 1 * time.Second, + Host: server, + User: user, + DialTimeout: timeout, Resource: resource, Password: password, - NoTLS: !*flagTLS, - StartTLS: !*flagTLS, - Debug: *flagDebug, - TLSConfig: &tlsConfig, + // NoTLS doesn't mean that no TLS is used at all but that instead + // of using an encrypted connection to the server (direct TLS) + // an unencrypted connection is established. As StartTLS is + // set when NoTLS is set go-sendxmpp won't use unencrypted + // client-to-server connections. + // See https://pkg.go.dev/github.com/mattn/go-xmpp#Options + NoTLS: !*flagDirectTLS, + StartTLS: !*flagDirectTLS, + Debug: *flagDebug, + TLSConfig: &tlsConfig, } // Read message from file. @@ -350,7 +377,7 @@ } // Connect to server. - client, err := connect(options, *flagTLS) + client, err := connect(options, *flagDirectTLS) if err != nil { log.Fatal(err) } @@ -361,7 +388,8 @@ } // Skip reading message if '-i' or '--interactive' is set to work with e.g. 'tail -f'. - if !*flagInteractive { + // Also for listening mode. + if !*flagInteractive && !*flagListen { if message == "" { scanner := bufio.NewScanner(os.Stdin) @@ -418,6 +446,36 @@ return } + if *flagListen { + for { + received, err := client.Recv() + if err != nil { + log.Println(err) + } + + switch v := received.(type) { + case xmpp.Chat: + if v.Text == "" { + continue + } + t := time.Now() + bareFrom := strings.Split(v.Remote, "/")[0] + // Print any messages if no recipients are specified + if len(recipients) == 0 { + fmt.Println(t.Format(time.RFC3339), bareFrom+":", v.Text) + } else { + for _, recipient := range recipients { + if bareFrom == strings.ToLower(recipient) { + fmt.Println(t.Format(time.RFC3339), bareFrom+":", v.Text) + } + } + } + default: + continue + } + } + } + // Send message to chatroom(s) if the flag is set. if *flagChatroom { diff -Nru go-sendxmpp-0.1.2/go.sum go-sendxmpp-0.2.0/go.sum --- go-sendxmpp-0.1.2/go.sum 2021-11-18 13:20:50.000000000 +0000 +++ go-sendxmpp-0.2.0/go.sum 2022-02-12 11:30:08.000000000 +0000 @@ -1,16 +1,20 @@ github.com/gabriel-vasile/mimetype v1.4.0 h1:Cn9dkdYsMIu56tGho+fqzh7XmvY2YyGU0FnbhiOsEro= github.com/gabriel-vasile/mimetype v1.4.0/go.mod h1:fA8fi6KUiG7MgQQ+mEWotXoEOvmxRtOJlERCzSmRvr8= -github.com/mattn/go-xmpp v0.0.0-20210723025538-3871461df959 h1:heUerLk4jOhweir4OqSGDUZueo9dRRtBcglPB44XRYY= -github.com/mattn/go-xmpp v0.0.0-20210723025538-3871461df959/go.mod h1:Cs5mF0OsrRRmhkyOod//ldNPOwJsrBvJ+1WRspv0xoc= +github.com/mattn/go-xmpp v0.0.0-20211029151415-912ba614897a h1:BRuMO9LUDuGp6viOhrEbmuXNlvC78X5QdsnY9Wc+cqM= +github.com/mattn/go-xmpp v0.0.0-20211029151415-912ba614897a/go.mod h1:Cs5mF0OsrRRmhkyOod//ldNPOwJsrBvJ+1WRspv0xoc= github.com/pborman/getopt/v2 v2.1.0 h1:eNfR+r+dWLdWmV8g5OlpyrTYHkhVNxHBdN2cCrJmOEA= github.com/pborman/getopt/v2 v2.1.0/go.mod h1:4NtW75ny4eBw9fO1bhtNdYTlZKYX5/tBLtsOpwKIKd0= golang.org/x/net v0.0.0-20210505024714-0287a6fb4125/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211020060615-d418f374d309 h1:A0lJIi+hcTR6aajJH4YqKWwohY4aW9RO7oRMcdv+HKI= -golang.org/x/net v0.0.0-20211020060615-d418f374d309/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd h1:O7DYs+zxREGLKzKoMQrtrEacpb0ZVXA5rIwylE2Xchk= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -salsa.debian.org/mdosch/xmppsrv v0.1.0 h1:DJpOJSmEDrj66o33239LlUMK6a/rAMBtMEy2gbHNLMk= -salsa.debian.org/mdosch/xmppsrv v0.1.0/go.mod h1:LGWT21BVAlCZD2+sXnRdHbeoqA89UI0jhgL/wErmawk= +salsa.debian.org/mdosch/xmppsrv v0.1.1 h1:I/5HS+cOg27LRADQ2R4KqQY6DTVMsaPMu9ywSAMTOG8= +salsa.debian.org/mdosch/xmppsrv v0.1.1/go.mod h1:udWXnWFa9zkcyN9YSB/u44BCnnRDpeQ0eDy3MVLjHZQ= diff -Nru go-sendxmpp-0.1.2/httpupload.go go-sendxmpp-0.2.0/httpupload.go --- go-sendxmpp-0.1.2/httpupload.go 2021-11-18 13:20:50.000000000 +0000 +++ go-sendxmpp-0.2.0/httpupload.go 2022-02-12 11:30:08.000000000 +0000 @@ -13,6 +13,7 @@ "net/http" "os" "path/filepath" + "regexp" "strconv" "github.com/gabriel-vasile/mimetype" // MIT License @@ -131,8 +132,15 @@ // Get file name fileName := filepath.Base(filePath) - var fileNameEscaped bytes.Buffer - xml.Escape(&fileNameEscaped, []byte(fileName)) + // Just use alphanumerical characters for now to work around + // https://github.com/mattn/go-xmpp/issues/132 + reg, err := regexp.Compile(`[^a-zA-Z0-9\+\-\_\.]+`) + if err != nil { + log.Fatal(err) + } + fileNameEscaped := reg.ReplaceAllString(fileName, "_") + //var fileNameEscaped bytes.Buffer + //xml.Escape(&fileNameEscaped, []byte(fileName)) // Query server for disco#items id := getID() @@ -204,7 +212,7 @@ var request IQHttpUploadSlotRequest request.Xmlns = "urn:xmpp:http:upload:0" - request.FileName = fileName + request.FileName = fileNameEscaped request.FileSize = fileSize request.FileType = mimeType r, err := xml.Marshal(request) diff -Nru go-sendxmpp-0.1.2/man/go-sendxmpp.1 go-sendxmpp-0.2.0/man/go-sendxmpp.1 --- go-sendxmpp-0.1.2/man/go-sendxmpp.1 2021-11-18 13:20:50.000000000 +0000 +++ go-sendxmpp-0.2.0/man/go-sendxmpp.1 2022-02-12 11:30:08.000000000 +0000 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.9.1 .\" http://github.com/apjanke/ronn-ng/tree/0.9.1 -.TH "GO\-SENDXMPP" "1" "July 2021" "" +.TH "GO\-SENDXMPP" "1" "February 2022" "" .SH "NAME" \fBgo\-sendxmpp\fR \- A little tool to send messages to an XMPP contact or MUC\. .SH "SYNOPSIS" @@ -10,59 +10,49 @@ .br You can either pipe a programs output to \fBgo\-sendxmpp\fR, write in your terminal (put \fB^D\fR in a new line to finish) or send the input from a file (\fB\-m\fR or \fB\-\-message\fR)\. The account data is expected at \fB~/\.config/go\-sendxmpp/sendxmpprc\fR (preferred) or \fB~/\.sendxmpprc\fR (for compatibility with the original perl sendxmpp) if no other configuration file location is specified with \fB\-f\fR or \fB\-\-file\fR\. .SH "OPTIONS" -.TP -\fB\-c\fR, \fB\-\-chatroom\fR=[\fIvalue\fR] -Send message to a chatroom\. -.TP -\fB\-d\fR, \fB\-\-debug\fR -Show debugging info\. -.TP -\fB\-f\fR, \fB\-\-file\fR=[\fIvalue\fR] -Set configuration file\. (Default: ~/\.sendxmpprc) -.TP -\fB\-\-help\fR -Show help\. -.TP -\fB\-\-http\-upload=\fR[\fIvalue\fR] -Send a file via http\-upload\. -.TP -\fB\-i\fR, \fB\-\-interactive\fR -Interactive mode (for use with e\.g\. \fBtail \-f\fR)\. -.TP -\fB\-j\fR, \fB\-\-jserver\fR=[\fIvalue\fR] -XMPP server address\. -.TP -\fB\-m\fR, \fB\-\-message\fR=[\fIvalue\fR] -Set file including the message\. -.TP -\fB\-n\fR, \fB\-\-no\-tls\-verify\fR -Skip verification of TLS certificates (not recommended)\. -.TP -\fB\-p\fR, \fB\-\-password\fR=[\fIvalue\fR] -Password for XMPP account\. -.TP -\fB\-\-raw\fR -Send raw XML\. To send raw XML to a contact as normal chat message no contact must be specified\. To send raw XML to a MUC you have to specify the MUC via \fB\-c\fR and \fBgo\-sendxmpp\fR will join the MUC\. -.TP -\fB\-r\fR, \fB\-\-resource\fR=[\fIvalue\fR] -Set resource\. When sending to a chatroom this is used as 'alias'\. -.TP -\fB\-t\fR, \fB\-\-tls\fR -Use direct TLS\. -.TP -\fB\-u\fR, \fB\-\-username\fR=[\fIvalue\fR] -Username for XMPP account (JID)\. -.TP -\fB\-x\fR, \fB\-\-start\-tls\fR -Use StartTLS\. -.br -DEPRECATED: This is used by default as long as direct TLS \fB\-t\fR is not used\. The setting will be removed soon\. +.IP "\[ci]" 4 +\fB\-c\fR, \fB\-\-chatroom\fR=[\fIvalue\fR]: Send message to a chatroom\. +.IP "\[ci]" 4 +\fB\-d\fR, \fB\-\-debug\fR: Show debugging info\. +.IP "\[ci]" 4 +\fB\-f\fR, \fB\-\-file\fR=[\fIvalue\fR]: Set configuration file\. (Default: ~/\.sendxmpprc) +.IP "\[ci]" 4 +\fB\-\-help\fR: Show help\. +.IP "\[ci]" 4 +\fB\-\-http\-upload=\fR[\fIvalue\fR]: Send a file via http\-upload\. +.IP "\[ci]" 4 +\fB\-i\fR, \fB\-\-interactive\fR: Interactive mode (for use with e\.g\. \fBtail \-f\fR)\. +.IP "\[ci]" 4 +\fB\-j\fR, \fB\-\-jserver\fR=[\fIvalue\fR]: XMPP server address\. +.IP "\[ci]" 4 +\fB\-l\fR, \fB\-\-listen\fR: Listen for messages and print them to stdout\. If JIDs are specified only messages from those contacts are shown\. If no JIDs are specified all received messages will be shown\. +.IP "\[ci]" 4 +\fB\-m\fR, \fB\-\-message\fR=[\fIvalue\fR]: Set file including the message\. +.IP "\[ci]" 4 +\fB\-n\fR, \fB\-\-no\-tls\-verify\fR: Skip verification of TLS certificates (not recommended)\. +.IP "\[ci]" 4 +\fB\-\-tls\-version\fR=[\fIvalue\fR]: Minimal TLS version\. 10 (TSLv1\.0), 11 (TLSv1\.1) (Default: 12) +.IP "\[ci]" 4 +\fB\-p\fR, \fB\-\-password\fR=[\fIvalue\fR]: Password for XMPP account\. +.IP "\[ci]" 4 +\fB\-\-raw\fR: Send raw XML\. To send raw XML to a contact as normal chat message no contact must be specified\. To send raw XML to a MUC you have to specify the MUC via \fB\-c\fR and \fBgo\-sendxmpp\fR will join the MUC\. +.IP "\[ci]" 4 +\fB\-r\fR, \fB\-\-resource\fR=[\fIvalue\fR]: Set resource\. When sending to a chatroom this is used as 'alias'\. +.IP "\[ci]" 4 +\fB\-\-timeout=\fR[\fIvalue\fR]: Connection timeout in seconds\. (Default: 10) +.IP "\[ci]" 4 +\fB\-t\fR, \fB\-\-tls\fR: Use direct TLS\. +.IP "\[ci]" 4 +\fB\-u\fR, \fB\-\-username\fR=[\fIvalue\fR]: Username for XMPP account (JID)\. +.IP "\[ci]" 4 +\fB\-\-version\fR: Show version information\. +.IP "" 0 .SH "CHAT" -Feel free to join https://join\.jabber\.network/#go\-sendxmpp@chat\.mdosch\.de?join +Feel free to join \fIhttps://join\.jabber\.network/#go\-sendxmpp@chat\.mdosch\.de?join\fR\. .SH "AUTHOR" Written by Martin Dosch\. .SH "REPORTING BUGS" -Report bugs at https://salsa\.debian\.org/mdosch/go\-sendxmpp/issues +Report bugs at \fIhttps://salsa\.debian\.org/mdosch/go\-sendxmpp/issues\fR\. .SH "COPYRIGHT" Copyright (c) 2018 \- 2021 Martin Dosch License: BSD 2\-clause License .SH "SEE ALSO" diff -Nru go-sendxmpp-0.1.2/man/go-sendxmpp.1.html go-sendxmpp-0.2.0/man/go-sendxmpp.1.html --- go-sendxmpp-0.1.2/man/go-sendxmpp.1.html 2021-11-18 13:20:50.000000000 +0000 +++ go-sendxmpp-0.2.0/man/go-sendxmpp.1.html 2022-02-12 11:30:08.000000000 +0000 @@ -91,64 +91,86 @@

OPTIONS

-
-
--c, --chatroom=[value]
-
Send message to a chatroom.
-
--d, --debug -
-
Show debugging info.
-
--f, --file=[value]
-
Set configuration file. (Default: ~/.sendxmpprc)
-
--help
-
Show help.
-
---http-upload=[value]
-
Send a file via http-upload.
-
--i, --interactive -
-
Interactive mode (for use with e.g. tail -f).
-
--j, --jserver=[value]
-
XMPP server address.
-
--m, --message=[value]
-
Set file including the message.
-
--n, --no-tls-verify -
-
Skip verification of TLS certificates (not recommended).
-
--p, --password=[value]
-
Password for XMPP account.
-
--raw
-
Send raw XML. To send raw XML to a contact as normal chat message no contact must be specified. -To send raw XML to a MUC you have to specify the MUC via -c and go-sendxmpp will join the MUC.
-
--r, --resource=[value]
-
Set resource. When sending to a chatroom this is used as -'alias'.
-
--t, --tls -
-
Use direct TLS.
-
--u, --username=[value]
-
Username for XMPP account (JID).
-
--x, --start-tls -
-
Use StartTLS.
-DEPRECATED: This is used by default as long as direct TLS -t is not used. -The setting will be removed soon.
-
+

CHAT

-

Feel free to join https://join.jabber.network/#go-sendxmpp@chat.mdosch.de?join

+

Feel free to join https://join.jabber.network/#go-sendxmpp@chat.mdosch.de?join.

AUTHOR

@@ -156,7 +178,7 @@

REPORTING BUGS

-

Report bugs at https://salsa.debian.org/mdosch/go-sendxmpp/issues

+

Report bugs at https://salsa.debian.org/mdosch/go-sendxmpp/issues.

@@ -165,11 +187,11 @@

SEE ALSO

-

go-sendxmpp(5), sendxmpp(1)

+

go-sendxmpp(5), sendxmpp(1)

  1. -
  2. July 2021
  3. +
  4. February 2022
  5. go-sendxmpp(1)
diff -Nru go-sendxmpp-0.1.2/man/go-sendxmpp.1.ronn go-sendxmpp-0.2.0/man/go-sendxmpp.1.ronn --- go-sendxmpp-0.1.2/man/go-sendxmpp.1.ronn 2021-11-18 13:20:50.000000000 +0000 +++ go-sendxmpp-0.2.0/man/go-sendxmpp.1.ronn 2022-02-12 11:30:08.000000000 +0000 @@ -37,12 +37,19 @@ * `-j`, `--jserver`=[]: XMPP server address. +* `-l`, `--listen`: +Listen for messages and print them to stdout. If JIDs are specified only messages from those contacts +are shown. If no JIDs are specified all received messages will be shown. + * `-m`, `--message`=[]: Set file including the message. * `-n`, `--no-tls-verify`: Skip verification of TLS certificates (not recommended). +* `--tls-version`=[]: +Minimal TLS version. 10 (TSLv1.0), 11 (TLSv1.1) (Default: 12) + * `-p`, `--password`=[]: Password for XMPP account. @@ -54,20 +61,20 @@ Set resource. When sending to a chatroom this is used as 'alias'. +* `--timeout=`[]: +Connection timeout in seconds. (Default: 10) + * `-t`, `--tls`: Use direct TLS. * `-u`, `--username`=[]: Username for XMPP account (JID). -* `-x`, `--start-tls`: -Use StartTLS. -DEPRECATED: This is used by default as long as direct TLS `-t` is not used. -The setting will be removed soon. +* `--version`: Show version information. ## CHAT -Feel free to join https://join.jabber.network/#go-sendxmpp@chat.mdosch.de?join +Feel free to join [https://join.jabber.network/#go-sendxmpp@chat.mdosch.de?join](https://join.jabber.network/#go-sendxmpp@chat.mdosch.de?join). ## AUTHOR @@ -75,7 +82,7 @@ ## REPORTING BUGS -Report bugs at https://salsa.debian.org/mdosch/go-sendxmpp/issues +Report bugs at [https://salsa.debian.org/mdosch/go-sendxmpp/issues](https://salsa.debian.org/mdosch/go-sendxmpp/issues). ## COPYRIGHT diff -Nru go-sendxmpp-0.1.2/man/go-sendxmpp.5 go-sendxmpp-0.2.0/man/go-sendxmpp.5 --- go-sendxmpp-0.1.2/man/go-sendxmpp.5 2021-11-18 13:20:50.000000000 +0000 +++ go-sendxmpp-0.2.0/man/go-sendxmpp.5 2022-02-12 11:30:08.000000000 +0000 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.9.1 .\" http://github.com/apjanke/ronn-ng/tree/0.9.1 -.TH "GO\-SENDXMPP" "5" "June 2021" "" +.TH "GO\-SENDXMPP" "5" "February 2022" "" .SH "NAME" \fBgo\-sendxmpp\fR \- A little tool to send messages to an XMPP contact or MUC\. .SH "LOCATION" @@ -22,7 +22,7 @@ .SH "AUTHOR" Written by Martin Dosch\. .SH "REPORTING BUGS" -Report bugs at https://salsa\.debian\.org/mdosch/go\-sendxmpp/issues +Report bugs at \fIhttps://salsa\.debian\.org/mdosch/go\-sendxmpp/issues\fR\. .SH "COPYRIGHT" Copyright (c) 2018 \- 2021 Martin Dosch License: BSD 2\-clause License .SH "SEE ALSO" diff -Nru go-sendxmpp-0.1.2/man/go-sendxmpp.5.html go-sendxmpp-0.2.0/man/go-sendxmpp.5.html --- go-sendxmpp-0.1.2/man/go-sendxmpp.5.html 2021-11-18 13:20:50.000000000 +0000 +++ go-sendxmpp-0.2.0/man/go-sendxmpp.5.html 2022-02-12 11:30:08.000000000 +0000 @@ -103,7 +103,7 @@

REPORTING BUGS

-

Report bugs at https://salsa.debian.org/mdosch/go-sendxmpp/issues

+

Report bugs at https://salsa.debian.org/mdosch/go-sendxmpp/issues.

@@ -112,11 +112,11 @@

SEE ALSO

-

go-sendxmpp(1), sendxmpp(1)

+

go-sendxmpp(1), sendxmpp(1)

  1. -
  2. June 2021
  3. +
  4. February 2022
  5. go-sendxmpp(5)
diff -Nru go-sendxmpp-0.1.2/man/go-sendxmpp.5.ronn go-sendxmpp-0.2.0/man/go-sendxmpp.5.ronn --- go-sendxmpp-0.1.2/man/go-sendxmpp.5.ronn 2021-11-18 13:20:50.000000000 +0000 +++ go-sendxmpp-0.2.0/man/go-sendxmpp.5.ronn 2022-02-12 11:30:08.000000000 +0000 @@ -30,7 +30,7 @@ ## REPORTING BUGS -Report bugs at https://salsa.debian.org/mdosch/go-sendxmpp/issues +Report bugs at [https://salsa.debian.org/mdosch/go-sendxmpp/issues](https://salsa.debian.org/mdosch/go-sendxmpp/issues). ## COPYRIGHT diff -Nru go-sendxmpp-0.1.2/README.md go-sendxmpp-0.2.0/README.md --- go-sendxmpp-0.1.2/README.md 2021-11-18 13:20:50.000000000 +0000 +++ go-sendxmpp-0.2.0/README.md 2022-02-12 11:30:08.000000000 +0000 @@ -19,13 +19,19 @@ ## installation -### Go < 1.16 +### 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 ```plain $ go get -u salsa.debian.org/mdosch/go-sendxmpp ``` -### Go >= 1.16 +#### Go >= 1.16 ```plain $ go install salsa.debian.org/mdosch/go-sendxmpp@latest @@ -33,6 +39,11 @@ You will find the binary in `$GOPATH/bin` or, if set, `$GOBIN`. +### binaries + +There are some (automatically built and untested) binaries linked to the +[release](https://salsa.debian.org/mdosch/go-sendxmpp/-/releases). + ## usage You can either pipe a programs output to `go-sendxmpp`, write in your terminal (put \^D in a new @@ -64,31 +75,37 @@ the account details via command line options: ```plain - Usage: go-sendxmpp [-cdintx] [-f value] [--help] [--http-upload value] [-j value] [-m value] [-p value] [-r value] [-u value] [parameters ...] +Usage: go-sendxmpp [-cdilnt] [-f value] [--help] [--http-upload value] [-j value] [-m value] [-p value] [--raw] [-r value] [--timeout value] [--tls-version value] [-u value] [--version] [parameters ...] -c, --chatroom Send message to a chatroom. -d, --debug Show debugging info. - -f, --file=value Set configuration file. (Default: ~/.sendxmpprc) + -f, --file=value Set configuration file. (Default: + ~/.config/go-sendxmpp/sendxmpprc) --help Show help. --http-upload=value Send a file via http-upload. -i, --interactive Interactive mode (for use with e.g. 'tail -f'). -j, --jserver=value XMPP server address. + -l, --listen Listen for messages and print them to stdout. -m, --message=value Set file including the message. -n, --no-tls-verify Skip verification of TLS certificates (not recommended). -p, --password=value Password for XMPP account. - --raw Send raw XML + --raw Send raw XML. -r, --resource=value Set resource. When sending to a chatroom this is used as 'alias'. + --timeout=value + Connection timeout in seconds. [10] -t, --tls Use direct TLS. + --tls-version=value + Minimal TLS version. 10 (TSLv1.0), 11 (TLSv1.1), 12 + (TLSv1.2) or 13 (TLSv1.3). [12] -u, --username=value Username for XMPP account. - -x, --start-tls Use StartTLS. (DEPRECATED) - + --version Show version information. ``` ### examples