From 3e95309bafa2e8ed616615204ced21fd3a658331 Mon Sep 17 00:00:00 2001 From: Ivan Krutov Date: Fri, 27 Jan 2017 20:00:52 +0300 Subject: [PATCH] Renamed -port to -listen (unification with Selenoid) --- Dockerfile | 2 +- README.md | 2 +- main.go | 6 ++---- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index e6549d3..98d34b9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,4 +4,4 @@ MAINTAINER Ivan Krutov COPY ggr /usr/bin EXPOSE 4444 -ENTRYPOINT ["/usr/bin/ggr", "-port", "4444", "-users", "/etc/grid-router/users.htpasswd", "-quotaDir", "/etc/grid-router/quota"] +ENTRYPOINT ["/usr/bin/ggr", "-listen", ":4444", "-users", "/etc/grid-router/users.htpasswd", "-quotaDir", "/etc/grid-router/quota"] diff --git a/README.md b/README.md index 53ba9ba..ff23b88 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ We use [govendor](https://github.com/kardianos/govendor) for dependencies manage 4. Run compiled binary: ```$GOPATH/bin/ggr``` ## Running -To run Gridrouter type: ```$ ggr -port 4444 -quotaDir /path/to/quota/directory -users /path/to/.htpasswd```. See [example browsers.xml](https://github.com/aandryashin/ggr/blob/master/quota/browsers.xml) and [example .htpasswd](https://github.com/aandryashin/ggr/blob/master/.htpasswd). +To run Gridrouter type: ```$ ggr -listen :4444 -quotaDir /path/to/quota/directory -users /path/to/.htpasswd```. See [example browsers.xml](https://github.com/aandryashin/ggr/blob/master/quota/browsers.xml) and [example .htpasswd](https://github.com/aandryashin/ggr/blob/master/.htpasswd). ## Generating users file This implementation is using [htpasswd](https://httpd.apache.org/docs/2.4/misc/password_encryptions.html) files to store authentication data, i.e. password are normally stored in encrypted form. To create such file type: diff --git a/main.go b/main.go index a0111b1..ccb0330 100644 --- a/main.go +++ b/main.go @@ -16,10 +16,9 @@ import ( ) var ( - port int + listen string quotaDir string users string - listen string timeout time.Duration ) @@ -59,12 +58,11 @@ func updateQuota(quotaName string, browsers Browsers) { } func init() { - flag.IntVar(&port, "port", 4444, "port to bind to") + flag.StringVar(&listen, "listen", ":4444", "host and port to listen to") flag.StringVar("aDir, "quotaDir", "quota", "quota directory") flag.StringVar(&users, "users", ".htpasswd", "htpasswd auth file path") flag.DurationVar(&timeout, "timeout", 300*time.Second, "session creation timeout in time.Duration format, e.g. 300s or 500ms") flag.Parse() - listen = fmt.Sprintf(":%d", port) log.Printf("Users file is [%s]\n", users) if err := loadQuotaFiles(quotaDir); err != nil { log.Fatalf("%v\n", err)