--- /dev/null
+vors@stargrave.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICasc3InBH3nN+b8/iKj7uOkr4Ue/teGfnWusXlepNxB
--- /dev/null
+-----BEGIN PGP SIGNATURE-----
+
+iHUEABYKAB0WIQTbL/jtRAp+lJhvt3bSI36ECQhstwUCZhzfDQAKCRDSI36ECQhs
+t8/OAQC2pXGJIhaZha1MRWgSxg60ioThenTlmwF4MFhs1WWb+gEApDvItkW4TF6M
+D/esXPWelNqqhU3ccZIrMNFMgkfjVgQ=
+=Noac
+-----END PGP SIGNATURE-----
--- /dev/null
+#!/bin/sh -e
+
+opus=opus-1.5.2
+if ! [ -d local/lib ] ; then
+ rm -fr local $opus
+ tar xf $opus.tar
+ cd $opus
+ ./configure --prefix=$(realpath ..)/local \
+ --enable-deep-plc \
+ --enable-osce \
+ --disable-doc \
+ --disable-extra-programs
+ make -j4
+ make install
+ cd ..
+ rm -r $opus
+fi
+export PKG_CONFIG_PATH="$(realpath local)/lib/pkgconfig:$PKG_CONFIG_PATH"
+
+mkdir -p bin
+[ -d vendor ] && vendor="-mod=vendor"
+strip=-ldflags=-s
+tags="nolibopusfile"
+go build -C cmd/vad $strip $vendor -o ../../bin/vors-vad
+go build -C cmd/keygen $strip $vendor -o ../../bin/vors-keygen
+go build -C cmd/server $strip $vendor -o ../../bin/vors-server
+go build -C cmd/client -tags $tags $strip $vendor -o ../../bin/vors-client
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
+// GNU Affero General Public License for more details.
//
-// You should have received a copy of the GNU General Public License
+// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package main
import (
"log"
+ "go.stargrave.org/opus/v2"
vors "go.stargrave.org/vors/internal"
- "gopkg.in/hraban/opus.v2"
)
func newOpusEnc() *opus.Encoder {
+++ /dev/null
-//go:build !decodersetcomplexity
-
-package main
-
-import "gopkg.in/hraban/opus.v2"
-
-func DecoderSetComplexity(dec *opus.Decoder, complexity int) error {
- return nil
-}
+++ /dev/null
-//go:build decodersetcomplexity
-
-package main
-
-import "gopkg.in/hraban/opus.v2"
-
-func DecoderSetComplexity(dec *opus.Decoder, complexity int) error {
- return dec.SetComplexity(complexity)
-}
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
+// GNU Affero General Public License for more details.
//
-// You should have received a copy of the GNU General Public License
+// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package main
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
+// GNU Affero General Public License for more details.
//
-// You should have received a copy of the GNU General Public License
+// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package main
import (
"bytes"
"crypto/subtle"
+ "encoding/base64"
"encoding/binary"
"encoding/hex"
"flag"
+ "fmt"
"io"
"log"
"net"
"github.com/flynn/noise"
"github.com/jroimartin/gocui"
+ "go.stargrave.org/opus/v2"
vors "go.stargrave.org/vors/internal"
"golang.org/x/crypto/blake2s"
"golang.org/x/crypto/chacha20"
"golang.org/x/crypto/poly1305"
- "gopkg.in/hraban/opus.v2"
)
type Stream struct {
Streams = map[byte]*Stream{}
Finish = make(chan struct{})
OurStats = &Stats{dead: make(chan struct{})}
- Name = flag.String("name", "test", "Username")
- Room = flag.String("room", "/", "Room name")
+ Name = flag.String("name", "test", "username")
+ Room = flag.String("room", "/", "room name")
Muted bool
)
func main() {
srvAddr := flag.String("srv", "vors.home.arpa:"+strconv.Itoa(vors.DefaultPort),
- "Host:TCP/UDP port to connect to")
- srvPubHex := flag.String("pub", "", "Server's public key, hex")
+ "host:TCP/UDP port to connect to")
+ srvPubB64 := flag.String("pub", "", "server's public key, Base64")
recCmd := flag.String("rec", "rec "+soxParams, "rec command")
playCmd := flag.String("play", "play "+soxParams, "play command")
vadRaw := flag.Uint("vad", 0, "VAD threshold")
- passwd := flag.String("passwd", "", "Protected room's password")
- muteToggle := flag.String("mute-toggle", "", "Path to FIFO to toggle mute")
+ passwd := flag.String("passwd", "", "protected room's password")
+ muteToggle := flag.String("mute-toggle", "", "path to FIFO to toggle mute")
+ version := flag.Bool("version", false, "print version")
+ warranty := flag.Bool("warranty", false, "print warranty information")
flag.Parse()
log.SetFlags(log.Lmicroseconds | log.Lshortfile)
- srvPub, err := hex.DecodeString(*srvPubHex)
+ if *warranty {
+ fmt.Println(vors.Warranty)
+ return
+ }
+ if *version {
+ fmt.Println(vors.GetVersion())
+ return
+ }
+
+ srvPub, err := base64.RawURLEncoding.DecodeString(*srvPubB64)
if err != nil {
log.Fatal(err)
}
if err != nil {
log.Fatal(err)
}
- if err = DecoderSetComplexity(dec, 10); err != nil {
+ if err = dec.SetComplexity(10); err != nil {
log.Fatal(err)
}
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
+// GNU Affero General Public License for more details.
//
-// You should have received a copy of the GNU General Public License
+// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package main
import (
"crypto/rand"
- "encoding/hex"
+ "encoding/base64"
"flag"
"fmt"
"io"
"os"
"github.com/flynn/noise"
+ vors "go.stargrave.org/vors/internal"
)
func main() {
- pub := flag.Bool("pub", false, "Print hexadecimal public key")
+ pub := flag.Bool("pub", false, "print Base64 public key")
+ version := flag.Bool("version", false, "print version")
+ warranty := flag.Bool("warranty", false, "print warranty information")
flag.Parse()
+ if *warranty {
+ fmt.Println(vors.Warranty)
+ return
+ }
+ if *version {
+ fmt.Println(vors.GetVersion())
+ return
+ }
if *pub {
data, err := io.ReadAll(os.Stdin)
if err != nil {
if len(data) != 2*32 {
log.Fatal("wrong length")
}
- fmt.Printf("%s\n", hex.EncodeToString(data[32:]))
+ fmt.Printf("%s\n", base64.RawURLEncoding.EncodeToString(data[32:]))
return
}
kp, err := noise.DH25519.GenerateKeypair(rand.Reader)
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
+// GNU Affero General Public License for more details.
//
-// You should have received a copy of the GNU General Public License
+// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package main
)
var (
- NoGUI = flag.Bool("tuiless", false, "No fancy TUI, only logs")
+ NoGUI = flag.Bool("tuiless", false, "no fancy TUI, only logs")
GUI *gocui.Gui
GUIReady bool
GUIReadyC = make(chan struct{})
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
+// GNU Affero General Public License for more details.
//
-// You should have received a copy of the GNU General Public License
+// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package main
"crypto/rand"
"crypto/subtle"
"crypto/tls"
+ "encoding/base64"
"encoding/hex"
"flag"
"fmt"
func main() {
bind := flag.String("bind", "[::1]:"+strconv.Itoa(vors.DefaultPort),
- "Host:TCP/UDP port to listen on")
- kpFile := flag.String("key", "key", "Path to keypair file")
+ "host:TCP/UDP port to listen on")
+ kpFile := flag.String("key", "key", "path to keypair file")
+ version := flag.Bool("version", false, "print version")
+ warranty := flag.Bool("warranty", false, "print warranty information")
flag.Parse()
log.SetFlags(log.Lmicroseconds | log.Lshortfile)
+ if *warranty {
+ fmt.Println(vors.Warranty)
+ return
+ }
+ if *version {
+ fmt.Println(vors.GetVersion())
+ return
+ }
+
{
data, err := os.ReadFile(*kpFile)
if err != nil {
go func() {
<-LoggerReady
- slog.Info("listening", "bind", *bind, "pub", hex.EncodeToString(Pub))
+ slog.Info("listening",
+ "bind", *bind,
+ "pub", base64.RawURLEncoding.EncodeToString(Pub))
for {
conn, err := lnTCP.AcceptTCP()
if err != nil {
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
+// GNU Affero General Public License for more details.
//
-// You should have received a copy of the GNU General Public License
+// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package main
+++ /dev/null
-#!/bin/sh -e
-
-opus=opus-1.5.2
-if ! [ -s $opus.tar.gz ] ; then
- wget --output-document=$opus.tar.gz.tmp \
- https://downloads.xiph.org/releases/opus/$opus.tar.gz
- command -v sha512 >/dev/null && SHA512="sha512" || SHA512="sha512sum --binary"
- hsh=$($SHA512 < $opus.tar.gz.tmp | { read hsh rem ; echo $hsh ; })
- [ "$hsh" = "78d963cd56d5504611f111e2b3606e236189a3585d65fae1ecdbec9bf4545632b1956f11824328279a2d1ea2ecf441ebc11e455fb598d20a458df15185e95da4" ]
- mv $opus.tar.gz.tmp $opus.tar.gz
-fi
-rm -fr $opus
-tar xf $opus.tar.gz
-cd $opus
-./configure --prefix=$(realpath ..)/libopus \
- --enable-deep-plc --enable-osce
-make -j8
-rm -fr ../libopus
-make install
-cd ..
-go_opus_commit=8dfbda309d77a0b97277d754b93fef44239abff9
-if ! [ -d go-opus ] ; then
- git clone --depth 1 git://git.stargrave.org/go-opus.git
- cd go-opus
- git fetch origin $go_opus_commit
- git checkout $go_opus_commit
- cd ..
-fi
-echo "replace gopkg.in/hraban/opus.v2 => $(realpath go-opus)" >> go.mod
-export PKG_CONFIG_PATH=$(realpath libopus/lib/pkgconfig)
-./mk-bin decodersetcomplexity
-echo Here you go:
-ls bin
--- /dev/null
+@multitable {XXXXX} {XXXX-XX-XX} {XXXX KiB} {meta4 tar ssh}
+@headitem Version @tab Date @tab Size @tab Tarball
+
+@end multitable
@include install.texi
@include usage.texi
@include vad.texi
-@include libopus.texi
@include proto.texi
@bye
@node Install
@unnumbered Install
-VoRS is written on @url{https://go.dev/, Go}, but depends on
-@url{https://github.com/hraban/opus, gopkg.in/hraban/opus.v2}
-library, that links it with C-written
-@url{https://opus-codec.org/, libopus} library.
-So you will need its development headers.
-
-@example
-$ git clone git://git.stargrave.org/vors.git
-$ cd vors
-$ ./mk-bin
-$ cp bin/vors-* $PATH/bin
-@end example
+VoRS is written on @url{https://go.dev/, Go}, but also uses wrapper on
+@url{https://opus-codec.org/, libopus} library. Provided tarballs
+include its source code
+(@url{https://wiki.hydrogenaud.io/index.php?title=Opus, look} how many
+improvements Opus got over the years) and a fork of the
+@url{https://github.com/hraban/opus, gopkg.in/hraban/opus.v2} with the
+added ability to use @code{Decoder.SetComplexity} call, that is required
+for @url{https://opus-codec.org/demo/opus-1.5/, ML-related} optimisations.
Audio recording and playback is done through external utilities, capable
of reading/writing raw audio samples from stdin/stdout.
@command{play} are used by default. You can use anything you want by
overriding them with @option{-rec} and @option{-play} options to
@command{vors-client}.
+
+@example
+$ [fetch|wget] http://www.vors.stargrave.org/download/vors-@value{VERSION}.tar.zst
+$ [fetch|wget] http://www.vors.stargrave.org/download/vors-@value{VERSION}.tar.zst.sig
+[verify signature]
+$ tar xf vors-@value{VERSION}.tar.zst
+$ cd vors-@value{VERSION}
+$ ./build
+$ mv bin/vors-* $PATH/bin
+@end example
+
+@include download.texi
+@include integrity.texi
+
+Also there is @url{https://yggdrasil-network.github.io/, Yggdrasil}
+accessible address: @url{http://y.www.vors.stargrave.org}.
--- /dev/null
+You @strong{have to} verify downloaded tarballs authenticity to be sure
+that you retrieved trusted and untampered software.
+@url{https://www.openssh.com/, OpenSSH} @file{.sig} signature
+@url{PUBKEY-SSH.pub, Public key} and its OpenPGP
+@url{PUBKEY-SSH.pub.asc, signature} made with the key above.
+Its fingerprint: @code{SHA256:qmlbyzvDRNXGJNxteapAWOmJRrBrZ7afLsEqr36M6kA}.
+
+@example
+$ ssh-keygen -Y verify -f PUBKEY-SSH.pub -I vors@@cypherpunks.ru -n file \
+ -s vors-@value{VERSION}.tar.zst.sig < vors-@value{VERSION}.tar.zst
+@end example
+++ /dev/null
-@node libopus
-@unnumbered libopus
-
-It is @strong{strongly} advisable to use the latest and much more
-advanced version of @code{libopus}.
-@url{https://wiki.hydrogenaud.io/index.php?title=Opus, Look} how many
-features and optimisations it gains from version to version.
-
-Current latest version @url{https://opus-codec.org/demo/opus-1.5/, brings}
-various ML-related enhancements for the decoder. Unfortunately Opus
-wrapper library does not provide @code{Decoder.SetComplexity} call.
-There is @url{git://git.stargrave.org/go-opus.git, fork} fork including
-it. Clone it somewhere, add Go module replacement in your current's
-@file{go.mod} file and build client with @code{decodersetcomplexity} tag
-specified:
-
-@example
-$ git clone git://git.stargrave.org/go-opus.git
-$ realpath go-opus | read pth
-$ echo "replace gopkg.in/hraban/opus.v2 => $pth" >> go.mod
-$ ./mk-bin decodersetcomplexity
-@end example
-
-Do not forget, that @code{libopus} must be built with
-@code{--enable-deep-plc} and @code{--enable-osce} to enable use of those
-advanced techniques.
#!/bin/sh -e
-makeinfo \
+version=$(perl -ne 'print "$1\n" if /Version.*"(.*)"$/' <../internal/version.go)
+makeinfo -D "VERSION $version" \
--set-customization-variable SECTION_NAME_IN_TITLE=1 \
--set-customization-variable TREE_TRANSFORMATIONS=complete_tree_nodes_menus \
--set-customization-variable ASCII_PUNCTUATION=1 \
@item
@option{-room} allows you to join non-root room.
- @option{-passwd} allows you to protect with provided password.
+ @option{-passwd} allows you protecting it with provided password.
+
+@item
+ @option{-mute-toggle} allows you to toggle mute by external
+ utilities. For example you can use suckless minimalistic
+ @url{https://github.com/baskerville/sxhkd, sxhkd} daemon to capture
+ X11 key events and execute commands:
+
+@example
+$ mkfifo /tmp/vors-mute-toggle.fifo
+$ cat >sxhkd.cfg <<EOF
+XF86AudioMute
+ herbe $(cat /tmp/vors-mute-toggle.fifo)
+EOF
+$ [run sxhkd]
+$ vors-client [...] -mute-toggle /tmp/vors-mute-toggle.fifo
+@end example
+
+ That will toggle mute on "audio mute" event and print its current
+ state as a @url{https://github.com/dudik/herbe, herbe} notification.
@end itemize
github.com/dustin/go-humanize v1.0.1
github.com/flynn/noise v1.1.0
github.com/jroimartin/gocui v0.5.0
+ go.stargrave.org/opus/v2 v2.1.0
golang.org/x/term v0.19.0
- gopkg.in/hraban/opus.v2 v2.0.0-20230925203106-0188a62cb302
)
require (
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/nsf/termbox-go v1.1.1 h1:nksUPLCb73Q++DwbYUBEglYBRPZyoXJdrj5L+TkjyZY=
github.com/nsf/termbox-go v1.1.1/go.mod h1:T0cTdVuOwf7pHQNtfhnEbzHbcNyCEcVU4YPpouCbVxo=
+go.stargrave.org/opus/v2 v2.1.0 h1:WwyMf76wcIWEPIQlU2UI5V9YkqXRHQhq6wfZGslcMFc=
+go.stargrave.org/opus/v2 v2.1.0/go.mod h1:Y57qgcaXH7jBvKW89fscWOT/Wd3MYfhXUbYUcOMV0A8=
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30=
golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
-gopkg.in/hraban/opus.v2 v2.0.0-20230925203106-0188a62cb302 h1:xeVptzkP8BuJhoIjNizd2bRHfq9KB9HfOLZu90T04XM=
-gopkg.in/hraban/opus.v2 v2.0.0-20230925203106-0188a62cb302/go.mod h1:/L5E7a21VWl8DeuCPKxQBdVG5cy+L0MRZ08B1wnqt7g=
--- /dev/null
+package internal
+
+import "runtime"
+
+const (
+ Version = "1.0.0"
+ Warranty = `Copyright (C) 2024 Sergey Matveev
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as
+published by the Free Software Foundation, version 3 of the License.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.`
+)
+
+func GetVersion() string {
+ return "VoRS version " + Version + " built with " + runtime.Version()
+}
--- /dev/null
+#!/bin/sh -ex
+
+cur=$(pwd)
+tmp=$(mktemp -d)
+release=$1
+[ -n "$release" ]
+
+git clone . $tmp/vors-$release
+cd $tmp/vors-$release
+git checkout v$release
+perl -ne 'print "$1\n" if /Version.*"(.*)"$/' <internal/version.go >VERSION
+
+########################################################################
+
+cd doc
+cat >download.texi <<EOF
+You can obtain releases source code prepared tarballs on
+@url{http://www.vors.stargrave.org}.
+EOF
+
+mkinfo() {
+ ${MAKEINFO:-makeinfo} --plaintext \
+ --set-customization-variable ASCII_PUNCTUATION=1 \
+ -D "VERSION `cat ../VERSION`" $@
+}
+
+texi=$(mktemp)
+
+cat >$texi <<EOF
+\input texinfo
+@documentencoding UTF-8
+@settitle INSTALL
+@include install.texi
+@bye
+EOF
+mkinfo --output INSTALL $texi
+
+rm $texi
+./mk-info
+mv vors.info INSTALL ..
+cd ..
+#
+########################################################################
+
+go mod vendor
+rm -rf vendor/golang.org/x/sys/windows
+find . \( -name .gitignore -o -name .travis.yml \) -delete
+
+########################################################################
+
+zstd -d <~/src/xiph/opus/opus-1.5.2.tar.zst >opus-1.5.2.tar
+rm -rf .git makedist
+find . -type d -exec chmod 755 {} +
+find . -type f -exec chmod 644 {} +
+chmod +x build
+
+cd ..
+tar cvf vors-"$release".tar --uid=0 --gid=0 --numeric-owner vors-"$release"
+zstd --ultra -22 -v vors-"$release".tar
+tarball=vors-"$release".tar.zst
+ssh-keygen -Y sign -f ~/.ssh/sign/vors@stargrave.org -n file $tarball
+meta4ra-create -fn "$tarball" -mtime "$tarball" \
+ -sig-ssh "$tarball".sig \
+ http://www.vors.stargrave.org/download/"$tarball" \
+ http://y.www.vors.stargrave.org/download/"$tarball" <"$tarball" >"$tarball".meta4
+
+size=$(( $(stat -f %z $tarball) / 1024 ))
+release_date=$(date "+%Y-%m-%d")
+
+release_underscored=`echo $release | tr . _`
+cat <<EOF
+An entry for documentation:
+@item $release @tab $release_date @tab $size KiB @tab
+ @url{download/$tarball.meta4, meta4}
+ @url{download/$tarball, tar}
+ @url{download/$tarball.sig, ssh}
+EOF
+
+mv $tmp/$tarball $tmp/"$tarball".sig $tarball.meta4 $cur/doc/vors.html/download
+++ /dev/null
-#!/bin/sh -e
-
-mkdir -p bin
-[ -d vendor ] && $vendor="-mod=vendor"
-strip=-ldflags=-s
-tags="nolibopusfile"
-[ -z "$1" ] || tags="$tags,$1"
-go build -C cmd/vad $strip $vendor -o ../../bin/vors-vad
-go build -C cmd/keygen $strip $vendor -o ../../bin/vors-keygen
-go build -C cmd/server $strip $vendor -o ../../bin/vors-server
-go build -C cmd/client -tags $tags $strip $vendor -o ../../bin/vors-client