From ddaffea16bfe20db48bf151a471159ee829572ec Mon Sep 17 00:00:00 2001 From: Jonathan Date: Mon, 9 Oct 2017 18:34:49 +0100 Subject: [PATCH] Create an ngrok config file that allows access to the web inspection feature. (#685) --- scripts/create-ngrok.sh | 10 ++++++++++ scripts/homestead.rb | 8 ++++++++ 2 files changed, 18 insertions(+) create mode 100644 scripts/create-ngrok.sh diff --git a/scripts/create-ngrok.sh b/scripts/create-ngrok.sh new file mode 100644 index 000000000..a14137f38 --- /dev/null +++ b/scripts/create-ngrok.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +PATH_NGROK="/home/vagrant/.ngrok2" +PATH_CONFIG="${PATH_NGROK}/ngrok.yml" + +# Only create a ngrok config file if there isn't one already there. +if [ ! -f $PATH_CONFIG ] +then +mkdir -p $PATH_NGROK && echo "web_addr: $1:4040" > $PATH_CONFIG +fi \ No newline at end of file diff --git a/scripts/homestead.rb b/scripts/homestead.rb index 063b757df..188446924 100644 --- a/scripts/homestead.rb +++ b/scripts/homestead.rb @@ -78,6 +78,7 @@ def Homestead.configure(config, settings) 80 => 8000, 443 => 44300, 3306 => 33060, + 4040 => 4040, 5432 => 54320, 8025 => 8025, 27017 => 27017 @@ -347,5 +348,12 @@ def Homestead.configure(config, settings) ] end end + + # Add config file for ngrok + config.vm.provision "shell" do |s| + s.path = scriptDir + "/create-ngrok.sh" + s.args = [settings["ip"]] + s.privileged = false + end end end