Open zencitta opened 7 years ago
//for ubuntu curl -O https://storage.googleapis.com/golang/go1.6.linux-amd64.tar.gz tar -xvf go1.6.linux-amd64.tar.gz mv go /usr/local nano ~/.profile export PATH=$PATH:/usr/local/go/bin source ~/.profile
apt-get install git git clone https://github.com/inconshreveable/ngrok.git ngrok`
$ cd ngrok $ openssl genrsa -out rootCA.key 2048 $ openssl req -x509 -new -nodes -key rootCA.key -subj "/CN=base_url" -days 5000 -out rootCA.pem $ openssl genrsa -out device.key 2048 $ openssl req -new -key device.key -subj "/CN=base_url" -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 cp device.crt assets/server/tls/snakeoil.crt cp device.key assets/server/tls/snakeoil.key
make release-server make release-client
ngrokd -domain="base_url" -httpAddr=":8088"
server_addr: "base_url:4443" trust_host_root_certs: false tunnels: http: proto: http: 80 subdomain: test https: proto: https: 443 subdomain: test2 ssh: remote_port: 5000 proto: tcp: 22
edit /etc/rc.local, add follow commands before exit 0 (sleep 3; /home/pi/proj/ngrok/ngrok -config /home/pi/proj/ngrok/ngrok.cfg start http ssh) &
scree -S session_name
ctrl+A D
screen -r session_name
screen -ls
install golang version after 1.6
get source code
generate ssl cert and key
copy keys to folder
complie source code
start server
edit ngrok.cfg for client
autostart client when powered on