I have developed a (beta) account-linking concept which allows for
*auto-updating* changed ngrok tunnel details when your ngrok machine
reboots. It even supports multiple tunnels potentially used with
multiple LMS servers (as deployed in the latest beta version of my
-Squeeze- test-skill). When you account-link for the first time, the
account-linking page displays a unique *cryptographic key* that you can
copy in order to subsequently refer to 'your' skills (both LMS-Lite and
MediaServer). This key is pasted into a small Python3 script that uses
the requests library to retrieve your current ngrok tunnel(s) from the
:4040 web portal for ngrok. Via that unique key, the skill then updates
with your latest tunnel details -without- having to re-link the skill.
Yaay! That script can be set to run on a cron schedule or upon reboot
(which is actually sufficient). For security, it only updates the tunnel
subdomain and _not_ your -auth details so an assumption is made that you
maintain the same -auth when your server reboots (which is a safe bet).
If you do not want to use this new feature, a check-box can be unticked
at the time of linking the skill and the current scheme is then used
unmodified. That makes Alexa responses a tiny fraction faster (100ms)
due to slightly less latency in the skill flow.

I'm in the process of writing the docs for this but I have a question
for the LMS community. Is it a problem that the companion script is
written in Python3 (and needs two Pip3 installs) ? Wouldn't Python be
pretty standard on the machines people are using as ngrok proxy? Or
would it be better to have a version in Perl with 2 CPAN installs
(WWW:Mechanize or LWP::UserAgent and JSON::XS) ? I know Perl is standard
on the LMS machine but if people are using RPi's for ngrok then Python
is likely more popular on the Pi. It could also be done in nodejs with
no extra npm modules but I guess nobody has that installed as standard
...

Thoughts?


------------------------------------------------------------------------
philchillbill's Profile: http://forums.slimdevices.com/member.php?userid=68920
View this thread: http://forums.slimdevices.com/showthread.php?t=111443

_______________________________________________
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/plugins

Reply via email to