Skip to content

Commit b3fefbd

Browse files
committed
Handling auto ssl key file generation properly
1 parent 00c2c6a commit b3fefbd

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

start.go

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func cmdStartRun(cmd *cobra.Command, args []string) {
5858
configureLogging()
5959

6060
// Build service
61-
service := mustPrepareService(false)
61+
service := mustPrepareService(true)
6262

6363
// Find executable
6464
exePath, err := os.Executable()
@@ -70,14 +70,22 @@ func cmdStartRun(cmd *cobra.Command, args []string) {
7070
childArgs := make([]string, 0, len(os.Args))
7171
cmd.InheritedFlags().VisitAll(func(f *pflag.Flag) {
7272
if f.Changed {
73-
a := "--" + f.Name
74-
value := f.Value.String()
75-
if value != "" {
76-
a = a + "=" + value
73+
switch f.Name {
74+
case "ssl.auto-key", "ssl.auto-server-name", "ssl.auto-organization", "ssl.keyfile":
75+
// Do not pass these along
76+
default:
77+
a := "--" + f.Name
78+
value := f.Value.String()
79+
if value != "" {
80+
a = a + "=" + value
81+
}
82+
childArgs = append(childArgs, a)
7783
}
78-
childArgs = append(childArgs, a)
7984
}
8085
})
86+
if service.SslKeyFile != "" {
87+
childArgs = append(childArgs, "--ssl.keyfile="+service.SslKeyFile)
88+
}
8189

8290
log.Debugf("Found child args: %#v", childArgs)
8391

0 commit comments

Comments
 (0)