mirror of
https://github.com/lordmathis/lemma.git
synced 2025-11-06 07:54:22 +00:00
Delete more debug logs
This commit is contained in:
@@ -19,10 +19,10 @@ type Config struct {
|
||||
RootURL string
|
||||
Domain string
|
||||
CORSOrigins []string
|
||||
AdminEmail string `log:"redact"`
|
||||
AdminPassword string `log:"redact"`
|
||||
EncryptionKey string `log:"redact"`
|
||||
JWTSigningKey string `log:"redact"`
|
||||
AdminEmail string
|
||||
AdminPassword string
|
||||
EncryptionKey string
|
||||
JWTSigningKey string
|
||||
RateLimitRequests int
|
||||
RateLimitWindow time.Duration
|
||||
IsDevelopment bool
|
||||
@@ -56,6 +56,16 @@ func (c *Config) validate() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Redact redacts sensitive fields from a Config instance
|
||||
func (c *Config) Redact() *Config {
|
||||
redacted := *c
|
||||
redacted.AdminPassword = "[REDACTED]"
|
||||
redacted.AdminEmail = "[REDACTED]"
|
||||
redacted.EncryptionKey = "[REDACTED]"
|
||||
redacted.JWTSigningKey = "[REDACTED]"
|
||||
return &redacted
|
||||
}
|
||||
|
||||
// LoadConfig creates a new Config instance with values from environment variables
|
||||
func LoadConfig() (*Config, error) {
|
||||
config := DefaultConfig()
|
||||
|
||||
Reference in New Issue
Block a user