Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Commit

Permalink
Merge pull request #41 from vania-pooh/master
Browse files Browse the repository at this point in the history
Renamed -port to -listen (unification with Selenoid)
  • Loading branch information
aandryashin authored Jan 28, 2017
2 parents 3c9fe2e + 3e95309 commit 5d5b507
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ MAINTAINER Ivan Krutov <[email protected]>
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"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 2 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ import (
)

var (
port int
listen string
quotaDir string
users string
listen string
timeout time.Duration
)

Expand Down Expand Up @@ -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(&quotaDir, "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)
Expand Down

0 comments on commit 5d5b507

Please sign in to comment.