@@ -2,23 +2,29 @@ package cmd
2
2
3
3
import (
4
4
"github.com/spf13/cobra"
5
- "ssh-sentinel-server/app"
5
+ "github.com/st2projects/ssh-sentinel-server/app"
6
+ "github.com/st2projects/ssh-sentinel-server/model"
6
7
)
7
8
8
9
var devMode bool
9
10
11
+ var httpConfig = model.HTTPConfig {}.Default ()
12
+
10
13
// serveCmd represents the serve command
11
14
var serveCmd = & cobra.Command {
12
15
Use : "serve" ,
13
16
Short : "Start the CA server" ,
14
17
Run : func (cmd * cobra.Command , args []string ) {
15
- app .InitialiseApp (configPath , devMode )
18
+ app .InitialiseApp (configPath , devMode , httpConfig )
16
19
},
17
20
}
18
21
19
22
func init () {
23
+
20
24
rootCmd .AddCommand (serveCmd )
21
25
serveCmd .Flags ().StringVarP (& configPath , "config" , "c" , "" , "Config file" )
26
+ serveCmd .Flags ().IntVarP (& httpConfig .HttpsPort , "https-port" , "s" , 443 , "HTTPS Port" )
27
+ serveCmd .Flags ().IntVarP (& httpConfig .HttpPort , "http-port" , "i" , 80 , "HTTP Port" )
22
28
serveCmd .Flags ().BoolVarP (& devMode , "dev-mode" , "d" , false , "Run in DEV mode. See README for implications" )
23
29
24
30
serveCmd .MarkFlagRequired ("config" )
0 commit comments