mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-12 19:55:14 +02:00
Renamed project from "Nano" to "Nyx" across codebase and configuration files.
This commit is contained in:
parent
7bfce3ad7f
commit
0b465bdacb
5 changed files with 41 additions and 43 deletions
|
|
@ -1,7 +1,7 @@
|
|||
use clap::{Parser, Subcommand};
|
||||
|
||||
#[derive(Parser)]
|
||||
#[command(name = "nano")]
|
||||
#[command(name = "nyx")]
|
||||
#[command(about = "A fast vulnerability scanner with project indexing")]
|
||||
#[command(version)]
|
||||
pub struct Cli {
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ use tracing_subscriber::fmt::time;
|
|||
// use tracing_appender::non_blocking;
|
||||
|
||||
fn init_tracing() {
|
||||
// let file_appender = RollingFileAppender::new(Rotation::HOURLY, "logs", "nano-scanner.log");
|
||||
// let file_appender = RollingFileAppender::new(Rotation::HOURLY, "logs", "nyx-scanner.log");
|
||||
// let (file_writer, guard) = non_blocking(file_appender);
|
||||
|
||||
let fmt_layer = fmt::layer()
|
||||
|
|
@ -44,7 +44,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
tracing::debug!("CLI starting up");
|
||||
let cli = Cli::parse();
|
||||
|
||||
let proj_dirs = ProjectDirs::from("dev", "ecpeter23", "nano")
|
||||
let proj_dirs = ProjectDirs::from("dev", "ecpeter23", "nyx")
|
||||
.ok_or("Unable to determine project directories")?;
|
||||
|
||||
let config_dir = proj_dirs.config_dir();
|
||||
|
|
|
|||
|
|
@ -176,12 +176,12 @@ impl Config {
|
|||
) -> Result<Self, Box<dyn std::error::Error>> {
|
||||
let mut config = Config::default();
|
||||
|
||||
let default_config_path = config_dir.join("nano.conf");
|
||||
let default_config_path = config_dir.join("nyx.conf");
|
||||
if !default_config_path.exists() {
|
||||
create_example_config(config_dir)?;
|
||||
}
|
||||
|
||||
let user_config_path = config_dir.join("nano.local");
|
||||
let user_config_path = config_dir.join("nyx.local");
|
||||
if user_config_path.exists() {
|
||||
let user_config_content = fs::read_to_string(&user_config_path)?;
|
||||
let user_config: Config = toml::from_str(&user_config_content)?;
|
||||
|
|
@ -200,16 +200,16 @@ impl Config {
|
|||
fn create_example_config(
|
||||
config_dir: &Path,
|
||||
) -> Result<(), Box<dyn std::error::Error>> {
|
||||
let example_path = config_dir.join("nano.conf");
|
||||
let example_path = config_dir.join("nyx.conf");
|
||||
|
||||
let default_config = Config::default();
|
||||
let toml_content = toml::to_string_pretty(&default_config)?;
|
||||
|
||||
// Add comments to make it user-friendly
|
||||
let commented_content = format!(
|
||||
"# Nano Vulnerability Scanner Configuration\n\
|
||||
"# nnyx Vulnerability Scanner Configuration\n\
|
||||
# YOU SHOULD NOT MODIFY THIS FILE.\n\
|
||||
# Create/modify 'nano.local' to set configs\n\
|
||||
# Create/modify 'nyx.local' to set configs\n\
|
||||
# Only include the sections you want to override\n\n{}",
|
||||
toml_content
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue