Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ded3e4ae71 | |||
| fbe1eda8e9 | |||
| 63f302604f |
@@ -1,4 +1,4 @@
|
|||||||
# Makefile for Dehasher
|
# Makefile for CrowsNest
|
||||||
|
|
||||||
# Go command
|
# Go command
|
||||||
GO=go
|
GO=go
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ go build crowsnest.go
|
|||||||
|
|
||||||
CrowsNest supports two database storage options:
|
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`
|
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.
|
The **Local Path** option allows for separate databases for different projects or engagements.
|
||||||
|
|||||||
+1
-1
@@ -77,7 +77,7 @@ var (
|
|||||||
|
|
||||||
// Validate credentials
|
// Validate credentials
|
||||||
if key == "" {
|
if key == "" {
|
||||||
fmt.Println("API key is required. Set the key with the \"set-key\" command. [dehasher set-key <api_key>]")
|
fmt.Println("API key is required. Set the key with the \"set-key\" command. [crowsnest set-key <api_key>]")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -59,7 +59,7 @@ var (
|
|||||||
|
|
||||||
// Validate credentials
|
// Validate credentials
|
||||||
if key == "" {
|
if key == "" {
|
||||||
fmt.Println("API key is required. Set the key with the \"set-key\" command. [dehasher set-key <api_key>]")
|
fmt.Println("API key is required. Set the key with the \"set-key\" command. [crowsnest set-key <api_key>]")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -21,7 +21,7 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
basePath = filepath.Join(os.Getenv("HOME"), ".local", "share", "Dehasher")
|
basePath = filepath.Join(os.Getenv("HOME"), ".local", "share", "CrowsNest")
|
||||||
logPath = filepath.Join(basePath, "logs")
|
logPath = filepath.Join(basePath, "logs")
|
||||||
storePath = filepath.Join(basePath, "keystore")
|
storePath = filepath.Join(basePath, "keystore")
|
||||||
// dbPath will be set in main() after badger is initialized
|
// dbPath will be set in main() after badger is initialized
|
||||||
@@ -82,7 +82,7 @@ func main() {
|
|||||||
useLocalDB := badger.GetUseLocalDB()
|
useLocalDB := badger.GetUseLocalDB()
|
||||||
if useLocalDB {
|
if useLocalDB {
|
||||||
// Use local database in current directory
|
// Use local database in current directory
|
||||||
dbPath = "./dehasher.sqlite"
|
dbPath = "./crowsnest.sqlite"
|
||||||
zap.L().Info("Using local database", zap.String("path", dbPath))
|
zap.L().Info("Using local database", zap.String("path", dbPath))
|
||||||
} else {
|
} else {
|
||||||
// Use default database path
|
// Use default database path
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ func GetHardwareEntropy() []byte {
|
|||||||
username,
|
username,
|
||||||
osInfo,
|
osInfo,
|
||||||
// You could add a static salt here for additional security
|
// You could add a static salt here for additional security
|
||||||
"Dehasher-static-salt-value",
|
"CrowsNest-static-salt-value",
|
||||||
}, ":")
|
}, ":")
|
||||||
|
|
||||||
// Hash the fingerprint to get a 32-byte key
|
// Hash the fingerprint to get a 32-byte key
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ func InitDB(dbPath string) (*gorm.DB, error) {
|
|||||||
zap.L().Error("Failed to create database directory", zap.Error(err))
|
zap.L().Error("Failed to create database directory", zap.Error(err))
|
||||||
return nil, fmt.Errorf("failed to create database directory: %w", 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 {
|
} else {
|
||||||
// Treat as file path
|
// Treat as file path
|
||||||
// Ensure the directory exists
|
// Ensure the directory exists
|
||||||
|
|||||||
Reference in New Issue
Block a user