-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
47 lines (42 loc) · 1.01 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package main
import (
"os"
"github.com/codegangsta/cli"
"github.com/divshot/gitling/server"
)
func main() {
app := cli.NewApp()
app.Name = "gitling"
app.Usage = "a smart git HTTP server with dynamic authentication."
app.Flags = []cli.Flag {
cli.StringFlag{
Name: "auth-url, a",
Value: "",
Usage: "A URL to which request information will be POST-ed for authentication",
EnvVar: "GITLING_AUTH_URL",
},
cli.StringFlag{
Name: "port, p",
Value: "8080",
Usage: "The port upon which to run the server",
EnvVar: "PORT",
},
cli.StringFlag{
Name: "root, r",
Value: "",
Usage: "The root directory for all git repositories.",
EnvVar: "PWD",
},
}
app.Action = func(c *cli.Context) {
config := server.Config{
ProjectRoot: c.String("root"),
Port: c.String("port"),
AuthURL: c.String("auth-url"),
UploadPack: true,
ReceivePack: true,
}
server.Start(config)
}
app.Run(os.Args)
}