From ac86d687c3f930c900d46dbf290a1cd58dff17c1 Mon Sep 17 00:00:00 2001 From: "Gerasimos (Makis) Maropoulos" Date: Fri, 19 Jul 2019 12:55:57 +0300 Subject: [PATCH] able to fetch the ngrok executable path through a 'NGROK' env variable as well, and humanize the returned error Former-commit-id: 8a61ed64b64e18bd2beb938ccb38150f2090ec54 --- FAQ.md | 4 ++-- README.md | 21 +++++++-------------- configuration.go | 13 ++++++++++++- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/FAQ.md b/FAQ.md index 89b19fc4..451f584a 100644 --- a/FAQ.md +++ b/FAQ.md @@ -24,7 +24,7 @@ Add a `badge` to your open-source projects powered by [Iris](https://iris-go.com go get -u github.com/kataras/iris ``` -Go installed version 1.12 and above is required. +Go version 1.12 and above is required. ## Learning @@ -60,4 +60,4 @@ Yes, https://chat.iris-go.com By normal people, like you, who help us by donating small or large amounts of money. -Help this project deliver awesome and unique features with the highest possible code quality by donating any amount via [PayPal](https://www.paypal.me/kataras). Your name will be published [here](https://iris-go.com/donate) after your approval via e-mail. +Help this project deliver awesome and unique features with the highest possible code quality by donating any amount via [PayPal](https://www.paypal.me/kataras). Your name will be published [here](https://iris-go.com) after your approval via e-mail. diff --git a/README.md b/README.md index c35bd7a4..b5ae7669 100644 --- a/README.md +++ b/README.md @@ -47,28 +47,21 @@ Iris does not force you to use any specific ORM or template engine. With support The only requirement is the [Go Programming Language](https://golang.org/dl/), version 1.12 and above. ```sh -$ go get github.com/kataras/iris +$ go get github.com/kataras/iris@v11.2.0 ``` -
-Known issues for code editors and IDEs at general +Or inside your `go.mod` file: -### VS Code +```sh +module your_project_name -For some reason the latest [vscode-go language extension](https://github.com/Microsoft/vscode-go) does not provide enough intelligence for the `iris.Context` type alias (input parameters documentation and definition navigation). -Probably you have already experienced this issue with other Go libraries too, it is not an iris-specific issue, it is a general issue for all Golang type aliases. +go 1.12 -Therefore if you use [VS Code](https://code.visualstudio.com/) and you need these editor's features, import the original path; add an extra import statement of the original path of the `Context`, that will do it: - -```go -import ( - "github.com/kataras/iris" - "github.com/kataras/iris/context" // <- HERE +require ( + github.com/kataras/iris v11.2.0 ) ``` -
- ## Quick start ```sh diff --git a/configuration.go b/configuration.go index 8901827c..e4bc892f 100644 --- a/configuration.go +++ b/configuration.go @@ -461,7 +461,18 @@ func (tc TunnelingConfiguration) startTunnel(t Tunnel, publicAddr *string) error if !tc.isNgrokRunning() { ngrokBin := "ngrok" // environment binary. - if tc.Bin != "" { + + if tc.Bin == "" { + _, err := exec.LookPath(ngrokBin) + if err != nil { + ngrokEnvVar, found := os.LookupEnv("NGROK") + if !found { + return fmt.Errorf(`"ngrok" executable not found, please install it from: https://ngrok.com/download`) + } + + ngrokBin = ngrokEnvVar + } + } else { ngrokBin = tc.Bin }