-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.go
More file actions
82 lines (75 loc) · 1.94 KB
/
cli.go
File metadata and controls
82 lines (75 loc) · 1.94 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
package main
import (
"log"
"os"
"github.com/urfave/cli"
)
var (
version = "1.0.0"
)
func main() {
app := cli.NewApp()
app.Name = "SecNginX"
app.Usage = "Build and setup an secure and minimnal NginX webserver and submit your certificates to all of Chrome's CT log servers"
app.Version = version
app.Commands = []cli.Command{
{
Name: "install",
Usage: "Build and install NginX and create basic NginX file structure",
Action: start,
Flags: []cli.Flag{
cli.BoolFlag{
Name: "without-brotli-module",
Usage: "Compile NginX without the brotli module",
},
cli.BoolFlag{
Name: "without-cors-module",
Usage: "Compile NginX without the CORS filter module",
},
cli.BoolFlag{
Name: "without-dynamic-tls-records",
Usage: "Compile NginX without applying the Dynamic TLS Records patch",
},
cli.BoolFlag{
Name: "without-headers-more-module",
Usage: "Compile NginX without the headers-more module",
},
cli.BoolFlag{
Name: "without-ct-module",
Usage: "Compile NginX without the CT module",
},
cli.BoolFlag{
Name: "without-cookie-flag-module",
Usage: "Compile NginX without the cookie-flag module",
},
cli.BoolFlag{
Name: "upgrade",
Usage: "Only compile and install NginX, do not change the nginx data",
},
},
},
{
Name: "submit-ct",
Usage: "Submit the given public certificate to some of Chrome's Certificate Transparency Log Servers",
Action: submitCT,
Flags: []cli.Flag{
cli.StringFlag{
Name: "input",
Usage: "Path of the public certificate to submit",
},
cli.StringFlag{
Name: "output",
Usage: "Path of the folder to output all generated .sct files to",
},
cli.StringFlag{
Name: "filename",
Usage: "Optional filename for the created .sct files: <CT Log Server>.<filename>.sct",
},
},
},
}
err := app.Run(os.Args)
if err != nil {
log.Fatal(err)
}
}