mirror of
https://github.com/pommee/goaway.git
synced 2026-01-06 05:49:35 -06:00
fix: added futher logging
This commit is contained in:
@@ -132,6 +132,7 @@ func (api *API) updatePassword(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
logMsg := fmt.Sprintf("Password changed for user '%s'", existingUser.Username)
|
||||
api.DNSServer.Audits.CreateAudit(&audit.Entry{
|
||||
Topic: audit.TopicUser,
|
||||
Message: logMsg,
|
||||
@@ -141,7 +142,7 @@ func (api *API) updatePassword(c *gin.Context) {
|
||||
Content: logMsg,
|
||||
Severity: SeverityWarning,
|
||||
})
|
||||
log.Info("Password has been changed!")
|
||||
log.Warning(logMsg)
|
||||
c.Status(http.StatusOK)
|
||||
}
|
||||
|
||||
|
||||
@@ -127,6 +127,8 @@ func (m *ApiKeyManager) CreateKey(name string) (string, error) {
|
||||
m.keyCache[name] = ApiKey{Name: name, Key: apiKey, CreatedAt: createdAt}
|
||||
m.cacheMu.Unlock()
|
||||
|
||||
log.Info("Created new API key with name: %s", name)
|
||||
|
||||
return apiKey, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -302,7 +302,9 @@ func (api *API) importDatabase(c *gin.Context) {
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"error": "Critical error: restored database is not functional"})
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"error": "Imported database is not functional, restored from backup"})
|
||||
|
||||
log.Info("Database restored successfully from backup %s", backupPath)
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("Failed to use imported database, restored from backup %s", backupPath)})
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user