An Acer ChromeBook network connected to a 1GB VPS. My local Acer Chromebook, converted to Ubuntu laptop by using MrChromeBox and GalliumOS, is network connected to a Digital Ocean 1GB Debian server. Easy Install production onto Debian, configure the username “frappe” for sudo privileges and Public Key ssh login, and now on Debian:
>sudo service nginx stop
>sudo service supervisor stop
>bench (create new sites, like in the Frappe tutorial)
On the laptop, also edit the file “/etc/hosts” to add site_names like from the Frappe tutorial:
127.0.0.1 site_name_1
Finally, execute this bash script on the laptop:
#!/bin/bash
# Save this file to frappe_tunnel.sh, and then "chmod 755 frappe_tunnel.sh"
ssh -f -q -N -M -S /tmp/session1 -L 8000:$2:8000 frappe@$1
ssh -f -q -N -M -S /tmp/session2 -L 9000:$2:9000 frappe@$1
(sleep 5; firefox http://$2:8000) &
ssh frappe@$1 -t 'cd frappe-bench && bench start && exec $SHELL -l'
ssh -S /tmp/session1 -O exit $1
ssh -S /tmp/session2 -O exit $1
chmod 755, then execute, using your own server domain name and development site name
>./frappe_tunnel.sh example.com site_name_1
In summary, “etc/hosts” on both machines resolve the site_name, and SSH tunnels ports 8000 and 9000. This script opens the tunnels, starts your test server, and opens firefox to your test site. When you control-C the test server, the tunnels close.
To restart production, SSH into Debian and:
>sudo service nginx start
>sudo service supervisor start
For editor, I’m using VSCode with Remote-SSH