geolite.go 580 B

1234567891011121314151617181920212223242526
  1. package self_check
  2. import (
  3. "github.com/0xJacky/Nginx-UI/internal/geolite"
  4. "github.com/0xJacky/Nginx-UI/settings"
  5. "github.com/uozi-tech/cosy"
  6. )
  7. func CheckGeoLiteDB() error {
  8. // Only check if log indexing is enabled
  9. if !settings.NginxLogSettings.IndexingEnabled {
  10. return nil
  11. }
  12. if !geolite.DBExists() {
  13. return cosy.WrapErrorWithParams(ErrGeoLiteDBNotFound, geolite.GetDBPath())
  14. }
  15. return nil
  16. }
  17. func FixGeoLiteDB() error {
  18. // This is a placeholder function to mark the task as fixable
  19. // The actual fix is handled by the frontend modal
  20. return ErrTaskNotFixable
  21. }