Installing a ngrok tunnel on your openag_brain will allow you to access it from anywhere in the world.
Follow these steps:
- Create an account at ngrok.com (it's free)
- Download ngrok onto your Raspberry Pi
wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-arm.zip
- Unzip the ngrok app in your home folder
unzip ngrok-stable-linux-arm.zip
- Move the ngrok app to /usr/local/bin
sudo mv ngrok /usr/local/bin/
- Test ngrok
ngrok http 80
- Type
ctrl-c
to stop ngrok - Install your ngrok auth token
- Go to https://dashboard.ngrok.com/auth and copy your auth token
ngrok authtoken XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
- Create the ngrok.yml config file
nano .ngrok2/ngrok.yml
- paste in the text from the ngrok.yml file below and press
ctrl-x
andY
to save- make sure to change "username:password" to your desired username and password to access your pi
- Create the run_after_boot.sh script
nano run_after_boot.sh
- paste in the text from the run_after_boot.sh file below and press
ctrl-x
andY
to save
- Add startup command in rc.local
sudo nano /etc/rc.local
- Add
sh /home/pi/run_after_boot.sh &
just before the line that containsexit 0
- press
ctrl-x
andY
to save
- Restart your Pi
sudo reboot
- See your new tunnels on ngrok.com
- https://dashboard.ngrok.com/status
- Copy your https tunnel url and add /_utils/ to it like this
https://XXXXXXXX.ngrok.io/_utils
- Enter your username and password (sometimes twice) and you are now viewing the Openag CouchDB
- You can also see openag_ui if you have it installed
https://XXXXXXXX.ngrok.io/app/_design/app/_rewrite
- You can ssh to your pi using this pattern:
ssh pi@1.tcp.ngrok.io -p21020
Paste in your url/port.
They have some great documentation. Check it out. https://ngrok.com/docs
With a paid account you can lock in a subdomain and even a consistent ssh routes