grumble
grumble copied to clipboard
Building and running on Raspberry Pi
Hi, trying to get Grumble up and running on the Pi so I can leverage the websockets functionality.
The install go get mumble.info/grumble/cmd/grumble
Fails on a $GOPATH not set error, even when $GOPATH is explicitly set before hand and can be seen in go env
Could someone let me know what I’ve missed?
What's the output of go env
?
Thank Tim,
GOARCH="arm"
GOBIN=""
GOEXE=""
GOHOSTARCH="arm"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/pi/gocode"
GORACE=""
GOROOT="/usr/lib/go-1.7"
GOTOOLDIR="/usr/lib/go-1.7/pkg/tool/linux_arm"
CC="gcc"
GOGCCFLAGS="-fPIC -marm -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-abuild589052819=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
Not sure why you're seeing that error, but Go 1.7 is a few versions behind. It might be worthwhile to upgrade to Go 1.10 and then try to build grumble.
Cancel last! Was running with sudo
so perhaps it was unhappy with the pi username?
Anyway, install out put gave this, is this a fail or information warnings: go get mumble.info/grumble/cmd/grumble
mumble.info/grumble/cmd/grumble
../pi/gocode/src/mumble.info/grumble/cmd/grumble/server.go:1457: unknown http.Server field 'IdleTimeout' in struct literal ../pi/gocode/src/mumble.info/grumble/cmd/grumble/server.go:1461: undefined: http.ErrServerClosed ../pi/gocode/src/mumble.info/grumble/cmd/grumble/server.go:1522: server.webhttp.Shutdown undefined (type *http.Server has no field or method Shutdown)`
Thanks for your quick help!
Those errors are related to the Go version. Upgrade to 1.10 and they should go away.
OK, will try that. Installing Go on the Pi is a pain!!
Awesome, perfect install. For anyone else going down this route, here are the instructions for GoLang 1.10 on Pi (lifted from elsewhere on Git)
To install golang 1.10 (or whatever the latest version is at the time anyone is reading this):
wget https://storage.googleapis.com/golang/go1.10.linux-armv6l.tar.gz
sudo tar -C /usr/local -xvf go1.10.linux-armv6l.tar.gz
cat >> ~/.bashrc << 'EOF'
export GOPATH=$HOME/go
export PATH=/usr/local/go/bin:$PATH:$GOPATH/bin
EOF
source ~/.bashrc
Run go version
to check and you should see output of: go version g1.10 linux/arm also this preserves /usr/bin/go is you installed it previously.
Now, excuse my blatant lack of knowledge, but what next? Does this sit on top of a mumble-server install or instead? I’ve just removed a working mumble and hope for grumble to take its place!
UPDATE:
Following reboot, setup GOPATH
$ export GOPATH=$HOME/gocode
$ mkdir -p $GOPATH
Then run the following line:
$ go get mumble.info/grumble/cmd/grumble
CD in to GOPATH/src/mumble.info/grumble/cmd/grumble and make any config changes you need before building the program: go build -o grumble mumble.info/grumble/cmd/grumble
And check ./grumble —help
this will expose the various command line switches, you will need to populate at least the following:
./grumble --datadir ~/gocode --log ~/gocode/log
Does this sit on top of a mumble-server install or instead?
The latter; grumble is a separate, standalone Mumble server. After starting grumble, you should be able to connect to your Pi from your Mumble client.
I thought so... That’s it!? So simple... Where is the configuration to add my password and define port etc?
Configuration is currently unmerged in PR #26. In the mean time, you can manually apply that patch to your local copy to enable configuration.
Wow, look like you guys have done a lot of work, and I’ve got a lot of learning to do! I wish someone had travelled this path before me (and documented it along the way!)
How do i start Grumble?
Thanks for being a trailblazer.
After building grumble (go build -o grumble mumble.info/grumble/cmd/grumble
), just run it (./grumble
). You may have to play around with the arguments (pass --help
to see available ones).
Thanks - I’m getting there... but you’re definitely right about the arguments!!
`go run grumble.go --help
command-line-arguments
./grumble.go:25:5: undefined: Args ./grumble.go:26:3: undefined: Usage ./grumble.go:31:26: undefined: Args ./grumble.go:33:56: undefined: Args ./grumble.go:39:34: undefined: Args ./grumble.go:41:62: undefined: Args ./grumble.go:48:41: undefined: Args ./grumble.go:56:27: undefined: Args ./grumble.go:68:26: undefined: Args ./grumble.go:69:25: undefined: Args ./grumble.go:69:25: too many errors `
The --help
flag is mean for the compiled grumble binary, not go run
.
You should also use go build
to compile grumble -- go run
isn't straightforward with respect to how grumbles files are organized.
Yep, go build
command seemed to execute without any issue. ./grumble
wasn’t working though so i tried grumble.go
but no dice.?
Does ./grumble
need to be from a specific directory?
if you passed -o grumble
to go build
, then the grumble binary will appear in your current working directory.
Yes, did that. Can see the binary, but ./grumble
gives Unable to open data directory (/home/pi/.grumble): open /home/pi/.grumble: no such file or directory
Worth noting home/pi/gocode
is current GOPATH
Variable
Those errors are what I was alluding to earlier: you'll have to pass some arguments to grumble
, specifically --datadir
and --log
.
Ok! Got the help text. Is there anywhere I can write this all up for the next Pi guy?
I'd just leave it in a comment in this thread. We should hopefully get some official docs together in the future.
Ok, well I’d be happy to help!
So here’s where I’m at:
./grumble --datadir ~/gocode --log ~/gocode/log [G] 2018/04/14 13:17:30.342856 Grumble [G] 2018/04/14 13:17:30.343374 Using data directory: /home/pi/gocode [G] 2018/04/14 13:17:30.343782 Generating 4096-bit RSA keypair for self-signed certificate... [G] 2018/04/14 13:19:49.679947 Certificate output to /home/pi/gocode/cert.pem [G] 2018/04/14 13:19:49.680261 Private key output to /home/pi/gocode/key.pem [1] 2018/04/14 13:19:49.695490 Started: listening on [::]:64738 and 0.0.0.0:443 [1] 2018/04/14 13:19:49.696451 Fatal HTTP server error: listen tcp 0.0.0.0:443: bind: permission denied
How can I set my IP or, more ideally, domain name
You can either:
- Modify the source code to bind your server on a specific IP address and port, or
- Locally merge the #26 branch to enable configuration file support where you can set configuration options
Ok, 26 sounds like more flexibility in the long run, but i don’t know how to merge the files in #26.
I can look through the source files and find where to set the IP. Thanks again for your support
Tried to merge the file changes on local machine and rebuild, once I fixed all my typos I’m still getting errors about a missing ini package “gopkg.in/ini.v1" from the new file_ini.go file . Do I need a template configuration in .ini format?
The config support adds a new external dependency, so you may have to go get gopkg.ini/ini.v1
to be able to build it. A template configuration should be automatically created on first run. However, the config support is still WIP and I recommend you merge the new changes in #26 to avoid a persistence issue before you set any config keys.
Thanks, I think I’ll keep an eye on the config support and d/l when it’s part of the git proper. In the meantime, can you tell me where I can set the domain of my machine, also webport 443 is in use by email SSL, so will need to rename that to be able to connect to websockets?
The reason the default webport is 443 is because that will be required for the planned Let's Encrypt support. Websockets works fine on any port otherwise. Setting the config key webport
(if you're on the config branch) or editing line 40 in server.go will do the trick. If you're connecting from a browser, make sure it trusts the certificate that Grumble sends, otherwise the connection will fail.
The default host should work fine in most cases but if you need to set it it's the config key host
or line 1384 in server.go.
On Linux you can only bind to port 443 (really, allow ports <= 1024) as root -- unless you set a capability on the binary.
See for example: https://unix.stackexchange.com/questions/10735/linux-allowing-an-user-to-listen-to-a-port-below-1024
Personally, I like this method: https://unix.stackexchange.com/a/10737
That looks pretty advanced. 443 isnt that much of an issue to me as I can reallocate the email port, and I’m not really sure it’s a problem.
Got the script to recognise my IP now, but still have a permission denied message ( Fatal HTTP server error: listen tcp 127.0.0.1:443: bind: address already in use
) for binding to 443. Will investigate and update
Update, 443 was in use by Apache2. Changed to 442 and rebuilt, and now:
Started: listening on 127.0.0.1:64738 and 127.0.0.1:442Started: listening on 127.0.0.1:64738 and 127.0.0.1:442
woop!! Just the TLS side of thing to sort out now
Hi All, Thanks again for the help so far. Is it possible to disable TLS/SSL for testing, I’m having difficulty getting the mumble client to connect with the Grumble generated cert.PEM file, once converted to PKCS12 format. Also, iOS Mumble app requires that certificates are imported from iTunes, which I’ve successfully avoided for nearly 5 years!! Any tips on clients that will use the generated certs, or can it be temporarily disabled?
openssl pkcs12 -export -out certificate.pfx -inkey privateKey.key -in certificate.crt -certfile CACert.crt