format file

This commit is contained in:
yuli
2022-08-25 00:59:45 +03:00
parent 895bf94da6
commit e49a6b292e

View File

@@ -42,14 +42,14 @@ type dbcon struct {
// Config is u sed to store application configuration
type Config struct {
Generic struct {
CreateUserWithoutAccessToken bool `yaml:"create_user_without_access_token" default:"false"`
UseSeparateAppTables bool `yaml:"use_separate_app_tables" default:"false"`
UserRecordSchema string `yaml:"user_record_schema"`
AdminEmail string `yaml:"admin_email" envconfig:"ADMIN_EMAIL"`
ListUsers bool `yaml:"list_users" default:"false"`
CreateUserWithoutAccessToken bool `yaml:"create_user_without_access_token" default:"false"`
UseSeparateAppTables bool `yaml:"use_separate_app_tables" default:"false"`
UserRecordSchema string `yaml:"user_record_schema"`
AdminEmail string `yaml:"admin_email" envconfig:"ADMIN_EMAIL"`
ListUsers bool `yaml:"list_users" default:"false"`
}
SelfService struct {
ForgetMe bool `yaml:"forget_me" default:"false"`
ForgetMe bool `yaml:"forget_me" default:"false"`
UserRecordChange bool `yaml:"user_record_change" default:"false"`
AppRecordChange []string `yaml:"app_record_change"`
}
@@ -59,9 +59,9 @@ type Config struct {
MagicSyncToken string `yaml:"magic_sync_token"`
}
Policy struct {
MaxUserRetentionPeriod string `yaml:"max_user_retention_period" default:"1m"`
MaxAuditRetentionPeriod string `yaml:"max_audit_retention_period" default:"12m"`
MaxSessionRetentionPeriod string `yaml:"max_session_retention_period" default:"1h"`
MaxUserRetentionPeriod string `yaml:"max_user_retention_period" default:"1m"`
MaxAuditRetentionPeriod string `yaml:"max_audit_retention_period" default:"12m"`
MaxSessionRetentionPeriod string `yaml:"max_session_retention_period" default:"1h"`
MaxShareableRecordRetentionPeriod string `yaml:"max_shareable_record_retention_period" default:"1m"`
}
Ssl struct {
@@ -69,15 +69,15 @@ type Config struct {
SslCertificateKey string `yaml:"ssl_certificate_key" envconfig:"SSL_CERTIFICATE_KEY"`
}
Sms struct {
URL string `yaml:"url"`
From string `yaml:"from"`
Body string `yaml:"body"`
Token string `yaml:"token"`
Method string `yaml:"method"`
BasicAuth string `yaml:"basic_auth"`
ContentType string `yaml:"content_type"`
CustomHeader string `yaml:"custom_header"`
DefaultCountry string `yaml:"default_country"`
URL string `yaml:"url"`
From string `yaml:"from"`
Body string `yaml:"body"`
Token string `yaml:"token"`
Method string `yaml:"method"`
BasicAuth string `yaml:"basic_auth"`
ContentType string `yaml:"content_type"`
CustomHeader string `yaml:"custom_header"`
DefaultCountry string `yaml:"default_country"`
}
Server struct {
Port string `yaml:"port" envconfig:"BUNKER_PORT"`
@@ -91,11 +91,11 @@ type Config struct {
Sender string `yaml:"sender" envconfig:"SMTP_SENDER"`
} `yaml:"smtp"`
UI struct {
LogoLink string `yaml:"logo_link"`
CompanyTitle string `yaml:"company_title"`
CompanyVAT string `yaml:"company_vat"`
CompanyCity string `yaml:"company_city"`
CompanyLink string `yaml:"company_link"`
LogoLink string `yaml:"logo_link"`
CompanyTitle string `yaml:"company_title"`
CompanyVAT string `yaml:"company_vat"`
CompanyCity string `yaml:"company_city"`
CompanyLink string `yaml:"company_link"`
CompanyCountry string `yaml:"company_country"`
CompanyAddress string `yaml:"company_address"`
TermOfServiceTitle string `yaml:"term_of_service_title"`
@@ -103,7 +103,7 @@ type Config struct {
PrivacyPolicyTitle string `yaml:"privacy_policy_title"`
PrivacyPolicyLink string `yaml:"privacy_policy_link"`
CustomCSSLink string `yaml:"custom_css_link"`
MagicLookup bool `yaml:"magic_lookup"`
MagicLookup bool `yaml:"magic_lookup"`
} `yaml:"ui"`
}
@@ -448,8 +448,8 @@ func reqMiddleware(handler http.Handler) http.Handler {
if statusCounter < 2 {
log.Printf("%d %s %s\n", w2.Code, r.Method, r.URL)
} else if statusCounter == 2 {
log.Printf("%d %s %s 'ignore subsequent /status requests'\n", w2.Code, r.Method, r.URL)
}
log.Printf("%d %s %s 'ignore subsequent /status requests'\n", w2.Code, r.Method, r.URL)
}
statusCounter = statusCounter + 1
} else {
if statusErrorCounter < 2 {
@@ -636,7 +636,7 @@ func main() {
store, err := storage.OpenDB(dbPtr)
if err != nil {
log.Printf("Filed to open db: %s", err)
os.Exit(0)
os.Exit(0)
}
hash := md5.Sum(masterKey)
db := &dbcon{store, masterKey, hash[:]}