New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compiling ngrok on raspberry pi 2 #237

Closed
pippo73 opened this Issue Apr 28, 2015 · 8 comments

Comments

Projects
None yet
4 participants
@pippo73
Copy link

pippo73 commented Apr 28, 2015

Hi,
I'm trying to compile ngrok on a raspberry pi with raspbian system.

but I'm haveing some problems with go.

$ GOOS="linux" GOARCH="arm" make
go fmt ngrok/...
GOOS="" GOARCH="" go get github.com/jteeuwen/go-bindata/go-bindata

github.com/jteeuwen/go-bindata

/usr/lib/go/src/pkg/github.com/jteeuwen/go-bindata/toc.go:47: function ends without a return statement
Makefile:22: set di istruzioni per l'obiettivo "bin/go-bindata" non riuscito
make: *** [bin/go-bindata] Errore 2

Could someone help me to compile it?

thank you

@inconshreveable

This comment has been minimized.

Copy link
Owner

inconshreveable commented Apr 28, 2015

You're using an older version of Go. You'll want to compile with at least Go 1.3

@pippo73

This comment has been minimized.

Copy link

pippo73 commented Apr 28, 2015

After a long dist-upgreade... nothing changed :(

$ go version
go version go1.3.3 linux/arm
$ GOOS="linux" GOARCH="arm" make
go fmt ngrok/...
GOOS="" GOARCH="" go get github.com/jteeuwen/go-bindata/go-bindata
go install github.com/jteeuwen/go-bindata: mkdir /usr/lib/go/pkg/linux_arm/github.com: permission denied
Makefile:22: set di istruzioni per l'obiettivo "bin/go-bindata" non riuscito
make: *** [bin/go-bindata] Errore 1

Any other idea?

@inconshreveable

This comment has been minimized.

Copy link
Owner

inconshreveable commented Apr 28, 2015

This is a different error now. For whatever reason, your filesystem permissions are stopping the build process: 'mkdir /usr/lib/go/pkg/linux_arm/github.com: permission denied'

@pippo73

This comment has been minimized.

Copy link

pippo73 commented Apr 28, 2015

ok, I've tryed to run it as root but still haveing some problems :(

cd /home/pi/Tmp/ngrok/

root@octopi:/home/pi/Tmp/ngrok# ls
assets contrib CONTRIBUTORS docs LICENSE Makefile README.md src
root@octopi:/home/pi/Tmp/ngrok# make
go fmt ngrok/...
GOOS="" GOARCH="" go get github.com/jteeuwen/go-bindata/go-bindata
bin/go-bindata -nomemcopy -pkg=assets -tags=debug
-debug=true
-o=src/ngrok/client/assets/assets_debug.go
assets/client/...
make: bin/go-bindata: comando non trovato
Makefile:25: set di istruzioni per l'obiettivo "client-assets" non riuscito
make: *** [client-assets] Errore 127

@inconshreveable

This comment has been minimized.

Copy link
Owner

inconshreveable commented Apr 28, 2015

I'm not entirely certain what's going on here. ngrok's Makefile sets up its own GOPATH environment variable so that it builds inside a contained environment. It's possible that's not getting set properly or is being overridden which is causing problems.

@pippo73

This comment has been minimized.

Copy link

pippo73 commented Apr 28, 2015

Could you then reopen my request? maybe someone else could help me.
tnx

@Doboo

This comment has been minimized.

Copy link

Doboo commented Sep 5, 2015

@pippo73
install go:

apt-get update
apt-get install mercurial git bzr subversion build-essential -y
if [ $(getconf WORD_BIT) = '32' ] && [ $(getconf LONG_BIT) = '64' ] ; then

wget https://storage.googleapis.com/golang/go1.4.1.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.4.1.linux-amd64.tar.gz

else

wget https://storage.googleapis.com/golang/go1.4.1.linux-386.tar.gz
tar -C /usr/local -xzf go1.4.1.linux-386.tar.gz

fi

mkdir $HOME/go
echo 'export GOROOT=/usr/local/go' >> ~/.bashrc
echo 'export GOPATH=$HOME/go' >> ~/.bashrc
echo 'export PATH=$PATH:$GOROOT/bin:$GOPATH/bin' >> ~/.bashrc
source $HOME/.bashrc

Compile ngrok for raspberry pi :

cd /usr/local/go/src
GOOS=linux GOARCH=arm CGO_ENABLED=0 ./make.bash
cd /root/ngrok
GOOS=linux GOARCH=arm make release-client
I have rebuilt ngrok for raspberry pi,but when I run it ,the server tell me:bad certificate
but there is no proble on my debian and windows!
I don't know why

@unnikked

This comment has been minimized.

Copy link

unnikked commented Sep 26, 2015

Don't know if it works on Raspberry Pi 2 but I've managed to install it on my Raspberry Pi B+.

I've wrote down the process.

TL:DR

sudo apt-get install -y bison git
bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
echo “[[ -s$HOME/.gvm/scripts/gvm” ]] && source$HOME/.gvm/scripts/gvm”” >> ~/.bashrc
source ~/.bashrc
gvm install go1.4
gvm use go1.4
export GOROOT_BOOTSTRAP=$GOROOT
sudo apt-get install build-essential mercurial
git clone https://github.com/inconshreveable/ngrok.git ngrok
cd ngrok
NGROK_DOMAIN=”example.com”
openssl genrsa -out rootCA.key 2048
openssl req -x509 -new -nodes -key rootCA.key -subj “/CN=$NGROK_DOMAIN” -days 5000 -out rootCA.pem
openssl genrsa -out device.key 2048
openssl req -new -key device.key -subj “/CN=$NGROK_DOMAIN” -out device.csr
openssl x509 -req -in device.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out device.crt -days 5000
cp rootCA.pem assets/client/tls/ngrokroot.crt
make release-server release-client
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment