If you want to autostart ngrok when your system boots, this will explain
the steps involved. It's been added to the online help too.
Sign in to your (free) ngrok account from a browser and note the
authtoken that appears on your dashboard. Next, at a command prompt on
your ngrok host machine, type:
NGROK AUTHTOKEN YOUR_AUTHTOKEN
This will have created a file called ngrok.yml in a hidden folder
.ngrok2 in your home directory (e.g. /home/pi if on raspbian). Edit that
file using e.g.* nano ~/.ngrok2/ngrok.yml *so that it looks as follows
(note the indentation is required):
Code:
--------------------
authtoken: 6hR173iJMYTfypshaexbe_8xgopkz39Cx2aqkz4Z7OT <-- your authtoken
web_addr: 0.0.0.0:4040
inspect: false
region: eu
tunnels:
mediaserver:
proto: http
addr: 192.168.1.10:9000
auth: "username:password"
--------------------
Explanation: 'web_addr' allows you to use a browser to check the
configuration from any machine in your local network, not just from
localhost; 'inspect' when set to false reduces logging and increases
responsiveness once you're all set up; 'region' defaults to 'us' if you
don't override it to e.g. eu. The 'tunnels' command allows us to
pre-define the parameters for a tunnel so that it can then be started
using the start command the addr and auth should match your particular
setup.
Now, we need to create the config file needed to start ngrok as a
service. Type the command *sudo nano /etc/systemd/system/ngrok.service*
and give it the following content:
Code:
--------------------
[Unit]
Description=ngrok autostart
Wants=network.target
After=network.target
[Service]
Type=simple
WorkingDirectory=/tmp
ExecStart=/usr/local/bin/ngrok start -config=/home/pi/.ngrok2/ngrok.yml
mediaserver
RestartSec=30
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=ngrok
[Install]
WantedBy=multi-user.target
--------------------
With that file successfully created, type:
SUDO SYSTEMCTL DAEMON-RELOAD
SUDO SYSTEMCTL ENABLE NGROK
SUDO SYSTEMCTL START NGROK
If all is well, ngrok is now running as a service. You can check its
status using *sudo systemctl status ngrok* and more importantly from
any machine in your local network, you can watch what ngrok is doing by
browsing to the IP address of the ngrok host machine on port 4040, e.g.
http://192.168.1.1:4040. The *status *tab there will show you the ngrok
subdomain you were assigned and which you will use in linking the skill.
If you reboot the ngrok pi, just revisit that web page to see the
newly-assigned subdomain for re-linking the skill.
------------------------------------------------------------------------
philchillbill's Profile: http://forums.slimdevices.com/member.php?userid=68920
View this thread: http://forums.slimdevices.com/showthread.php?t=111016
_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins