Update documentation

This commit is contained in:
Denis Arh
2019-05-29 22:42:42 +02:00
parent 328bdeda07
commit ba1118eb4f
14 changed files with 346 additions and 39 deletions
-1
View File
@@ -10,7 +10,6 @@ type (
HTTPOpt struct {
Addr string
Logging bool
Pretty bool
Tracing bool
EnableVersionRoute bool
+6 -4
View File
@@ -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
View File
@@ -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,