Update documentation
This commit is contained in:
@@ -10,7 +10,6 @@ type (
|
||||
HTTPOpt struct {
|
||||
Addr string
|
||||
Logging bool
|
||||
Pretty bool
|
||||
Tracing bool
|
||||
|
||||
EnableVersionRoute bool
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package flags
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/cortezaproject/corteza-server/internal/rand"
|
||||
@@ -9,7 +11,7 @@ import (
|
||||
type (
|
||||
JWTOpt struct {
|
||||
Secret string
|
||||
Expiry int
|
||||
Expiry time.Duration
|
||||
}
|
||||
)
|
||||
|
||||
@@ -21,9 +23,9 @@ func JWT(cmd *cobra.Command) (o *JWTOpt) {
|
||||
"auth-jwt-secret", string(rand.Bytes(32)),
|
||||
"JWT Secret")
|
||||
|
||||
BindInt(cmd, &o.Expiry,
|
||||
"auth-jwt-expiry", 60*24*30,
|
||||
"JWT Expiration in minutes")
|
||||
BindDuration(cmd, &o.Expiry,
|
||||
"auth-jwt-expiry", time.Hour*24*30,
|
||||
"JWT Expiration")
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
+2
-1
@@ -3,6 +3,7 @@ package cli
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"go.uber.org/zap"
|
||||
|
||||
@@ -19,7 +20,7 @@ func InitGeneralServices(logOpt *flags.LogOpt, smtpOpt *flags.SMTPOpt, jwtOpt *f
|
||||
_ = logLevel.Set(logOpt.Level)
|
||||
logger.DefaultLevel.SetLevel(logLevel)
|
||||
|
||||
auth.SetupDefault(jwtOpt.Secret, jwtOpt.Expiry)
|
||||
auth.SetupDefault(jwtOpt.Secret, int(jwtOpt.Expiry/time.Minute))
|
||||
mail.SetupDialer(smtpOpt.Host, smtpOpt.Port, smtpOpt.User, smtpOpt.Pass, smtpOpt.From)
|
||||
http.SetupDefaults(
|
||||
httpClientOpt.HttpClientTimeout,
|
||||
|
||||
Reference in New Issue
Block a user