Ngrok
If you would like to expose the Pioreactor UI to view remotely, you can use a service like Ngrok to do so.
This exposes your Pioreactor UI and therefore your Raspberry Pi over the internet. You should have a strong password on your Raspberry Pi leader, and use a strong password for basic-auth (below). We make our best security effort in our products, however we are not responsible for any damages as a result of exposing your Raspberry Pi online.
The following are the steps to take:
- Sign up for Ngrok - the free plan is all we need. Make sure to confirm your account through your email.
- Download the app onto the Raspberry Pi:
wget -O ngrok.tgz https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-arm.tgz
- Unzip:
tar zxvf ngrok.tgz
- Make a new folder for the program:
sudo mkdir /opt/ngrok
- Move
ngrok
file there:sudo mv ngrok /opt/ngrok
- Make a config folder:
mkdir ~/.ngrok
- Fill in the following:
nano ~/.ngrok/ngrok.yml
. We advise changing the basic auth credentials below to something more secure
authtoken: <add your ngrok auth token here, find in nrgok dashboard>
tunnels:
ui:
proto: http
addr: 80
inspect: false
basic_auth: ["pioreactor:vogue-awesome-brag"] #change this
schemes:
- http
ws:
proto: http
addr: 9001
inspect: false
schemes:
- http
version: "2"
region: us
- Run in background:
nohup /opt/ngrok/ngrok start ui ws --config ~/.ngrok/ngrok.yml &
Alternatively, if you wish to set this up as a service that will launch on start up, the following sudo systemctl enable ngrok
- At dashboard.ngrok.com, you'll see two urls. One of the unique urls should link to your Pioreactor dashboard (when asked for a name and password, use the user name and the password used in the config above). However, the UI will crash - this is expected. Continue on.
- The other url is added to your config.ini. While SSH'd into your leader, open the config.ini:
nano ~/.pioreactor/config.ini
And edit the following section (but put in your unique url)
[mqtt]
...
# this should not have any https:// infront:
ws_url=<your url>.ngrok-free.app
ws_protocol=wss
...
-
Deploy your config with
pios sync-configs
, and refresh your UI that previously crashed. -
You're all done! You can now access the Pioreactor UI anywhere. The username and password are the same you added to your yaml file above.