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