remove the email smtp config and logs location moved to admin section
This commit is contained in:
@@ -46,14 +46,6 @@ type Config struct {
|
||||
RequireEmailConfirmation bool
|
||||
MFAEnabledByDefault bool
|
||||
|
||||
// Email (SMTP) settings
|
||||
SMTPHost string
|
||||
SMTPPort int
|
||||
SMTPUsername string
|
||||
SMTPPassword string
|
||||
SMTPSender string
|
||||
SMTPUseTLS bool
|
||||
|
||||
// Security settings (failed-login thresholds and auto-ban config)
|
||||
PwdFailuresThreshold int
|
||||
MFAFailuresThreshold int
|
||||
@@ -94,17 +86,9 @@ var defaultConfig = map[string]map[string]string{
|
||||
},
|
||||
"AUTH": {
|
||||
"REQUIRE_ADMIN_ACTIVATION": "true",
|
||||
"REQUIRE_EMAIL_CONFIRMATION": "true",
|
||||
"REQUIRE_EMAIL_CONFIRMATION": "false",
|
||||
"MFA_ENABLED_BY_DEFAULT": "false",
|
||||
},
|
||||
"EMAIL": {
|
||||
"SMTP_HOST": "",
|
||||
"SMTP_PORT": "587",
|
||||
"SMTP_USERNAME": "",
|
||||
"SMTP_PASSWORD": "",
|
||||
"SMTP_SENDER": "",
|
||||
"SMTP_USE_TLS": "true",
|
||||
},
|
||||
"SECURITY": {
|
||||
"PWD_FAILURES_THRESHOLD": "5",
|
||||
"MFA_FAILURES_THRESHOLD": "10",
|
||||
@@ -228,15 +212,6 @@ func Load() (*Config, error) {
|
||||
config.RequireEmailConfirmation, _ = authSection.Key("REQUIRE_EMAIL_CONFIRMATION").Bool()
|
||||
config.MFAEnabledByDefault, _ = authSection.Key("MFA_ENABLED_BY_DEFAULT").Bool()
|
||||
|
||||
// Load EMAIL (SMTP) section
|
||||
emailSection := cfg.Section("EMAIL")
|
||||
config.SMTPHost = emailSection.Key("SMTP_HOST").String()
|
||||
config.SMTPPort, _ = emailSection.Key("SMTP_PORT").Int()
|
||||
config.SMTPUsername = emailSection.Key("SMTP_USERNAME").String()
|
||||
config.SMTPPassword = emailSection.Key("SMTP_PASSWORD").String()
|
||||
config.SMTPSender = emailSection.Key("SMTP_SENDER").String()
|
||||
config.SMTPUseTLS, _ = emailSection.Key("SMTP_USE_TLS").Bool()
|
||||
|
||||
// Load SECURITY section
|
||||
secSection := cfg.Section("SECURITY")
|
||||
config.PwdFailuresThreshold, _ = secSection.Key("PWD_FAILURES_THRESHOLD").Int()
|
||||
@@ -408,23 +383,6 @@ func (c *Config) SaveSetting(section, key, value string) error {
|
||||
case "MFA_ENABLED_BY_DEFAULT":
|
||||
c.MFAEnabledByDefault = value == "true"
|
||||
}
|
||||
case "EMAIL":
|
||||
switch key {
|
||||
case "SMTP_HOST":
|
||||
c.SMTPHost = value
|
||||
case "SMTP_PORT":
|
||||
if v, err := strconv.Atoi(value); err == nil {
|
||||
c.SMTPPort = v
|
||||
}
|
||||
case "SMTP_USERNAME":
|
||||
c.SMTPUsername = value
|
||||
case "SMTP_PASSWORD":
|
||||
c.SMTPPassword = value
|
||||
case "SMTP_SENDER":
|
||||
c.SMTPSender = value
|
||||
case "SMTP_USE_TLS":
|
||||
c.SMTPUseTLS = value == "true"
|
||||
}
|
||||
case "SECURITY":
|
||||
switch key {
|
||||
case "PWD_FAILURES_THRESHOLD":
|
||||
|
||||
@@ -11,6 +11,22 @@
|
||||
</div>
|
||||
|
||||
<div class="space-y-8">
|
||||
<!-- Quick Actions -->
|
||||
<div class="bg-gray-800 rounded-lg p-6">
|
||||
<div class="flex items-center justify-between">
|
||||
<div>
|
||||
<h2 class="text-xl font-semibold text-white mb-1">
|
||||
<i class="fas fa-tools mr-2"></i>Admin Tools
|
||||
</h2>
|
||||
<p class="text-gray-400">Access logs and security controls</p>
|
||||
</div>
|
||||
<div class="flex items-center gap-3">
|
||||
<a href="{{url "/editor/admin/logs"}}" class="btn-secondary inline-flex items-center">
|
||||
<i class="fas fa-list mr-2"></i>View Logs
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Users -->
|
||||
<div class="bg-gray-800 rounded-lg p-6">
|
||||
<h2 class="text-xl font-semibold text-white mb-4">
|
||||
|
||||
@@ -12,22 +12,6 @@
|
||||
|
||||
<!-- Settings Sections -->
|
||||
<div class="space-y-8">
|
||||
<!-- Quick Actions -->
|
||||
<div class="bg-gray-800 rounded-lg p-6">
|
||||
<div class="flex items-center justify-between">
|
||||
<div>
|
||||
<h2 class="text-xl font-semibold text-white mb-1">
|
||||
<i class="fas fa-tools mr-2"></i>Admin Tools
|
||||
</h2>
|
||||
<p class="text-gray-400">Access logs and security controls</p>
|
||||
</div>
|
||||
<div class="flex items-center gap-3">
|
||||
<a href="{{url "/editor/admin/logs"}}" target="_blank" class="btn-secondary inline-flex items-center">
|
||||
<i class="fas fa-list mr-2"></i>View Logs
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Image Storage Settings -->
|
||||
<div class="bg-gray-800 rounded-lg p-6">
|
||||
<h2 class="text-xl font-semibold text-white mb-4">
|
||||
|
||||
Reference in New Issue
Block a user