From ded3e4ae715c81de187017770803570bb1d381e1 Mon Sep 17 00:00:00 2001 From: Evan Hosinski Date: Wed, 21 May 2025 09:14:56 -0400 Subject: [PATCH] Altered Dehasher to CrowsNest ! WARNING ! This will break older versions of CrowsNest. The database file will no longer be compatible --- README.md | 2 +- crowsnest.go | 2 +- internal/sqlite/db.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index fce1627..1798089 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ go build crowsnest.go CrowsNest supports two database storage options: -1. **Default Path** (default): Stores the database at `~/.local/share/crowsnest/db/dehashed.sqlite` +1. **Default Path** (default): Stores the database at `~/.local/share/crowsnest/db/crowsnest.sqlite` 2. **Local Path**: Stores the database in the current directory as `./crowsnest.sqlite` The **Local Path** option allows for separate databases for different projects or engagements. diff --git a/crowsnest.go b/crowsnest.go index a7eb94f..91b11b7 100644 --- a/crowsnest.go +++ b/crowsnest.go @@ -82,7 +82,7 @@ func main() { useLocalDB := badger.GetUseLocalDB() if useLocalDB { // Use local database in current directory - dbPath = "./dehasher.sqlite" + dbPath = "./crowsnest.sqlite" zap.L().Info("Using local database", zap.String("path", dbPath)) } else { // Use default database path diff --git a/internal/sqlite/db.go b/internal/sqlite/db.go index 34f4468..16a71f7 100644 --- a/internal/sqlite/db.go +++ b/internal/sqlite/db.go @@ -29,7 +29,7 @@ func InitDB(dbPath string) (*gorm.DB, error) { zap.L().Error("Failed to create database directory", zap.Error(err)) return nil, fmt.Errorf("failed to create database directory: %w", err) } - finalDbPath = filepath.Join(dbPath, "dehashed.sqlite") + finalDbPath = filepath.Join(dbPath, "crowsnest.sqlite") } else { // Treat as file path // Ensure the directory exists