From 3b2b3dbd5deaffb94f48613e6b6d096f99ae4974 Mon Sep 17 00:00:00 2001 From: Alex Holmberg Date: Sat, 7 Jun 2025 00:45:37 +0200 Subject: [PATCH 1/3] HOTFIX - hoping auto update becomes available --- README.md | 30 +++ examples/security_analysis.rs | 4 +- src/analyzer/security_analyzer.rs | 392 +++++++++++++++++++++++++++++- src/cli.rs | 4 + src/main.rs | 136 +++++++++-- test_update_check.sh | 20 ++ 6 files changed, 556 insertions(+), 30 deletions(-) create mode 100755 test_update_check.sh diff --git a/README.md b/README.md index e04438e6..179dce2a 100644 --- a/README.md +++ b/README.md @@ -247,6 +247,7 @@ $ sync-ctl analyze ./fastapi-service --json ] } ``` + ### Example: Security Analysis ```bash @@ -294,6 +295,35 @@ max_file_size = 2097152 # 2MB format = "json" # or "yaml", "toml" ``` +## ๐Ÿ”„ Automatic Update Checks + +Syncable CLI automatically checks for updates once per day when you run any command. When a new version is available, you'll see a notification: + +``` +๐Ÿ”” A new version of sync-ctl is available: 0.5.0 (current: 0.4.1) +Run `cargo install syncable-cli` or download from https://github.com/syncable-dev/syncable-cli/releases/tag/v0.5.0 +``` + +### Troubleshooting Update Checks + +If you're not seeing update notifications: + +```bash +# Force an update check by clearing the cache +sync-ctl --clear-update-cache analyze . + +# Enable debug logging to see what's happening +SYNC_CTL_DEBUG=1 sync-ctl analyze . +``` + +The update check: +- Only runs once per day (cached in `~/.cache/syncable-cli/`) +- Queries GitHub releases API to find the latest version +- Works behind corporate proxies (uses system proxy settings) +- Has a 5-second timeout to avoid slowing down commands + +To disable update checks, you can set the `SYNC_CTL_NO_UPDATE_CHECK` environment variable (coming in next release). + ## ๐Ÿงช Comprehensive Technology Support (260+ Technologies) ### ๐Ÿ“Š Coverage by Language diff --git a/examples/security_analysis.rs b/examples/security_analysis.rs index 78895925..aa49ceb1 100644 --- a/examples/security_analysis.rs +++ b/examples/security_analysis.rs @@ -37,9 +37,11 @@ fn main() -> Result<(), Box> { ".git".to_string(), "target".to_string(), ], + skip_gitignored_files: true, + downgrade_gitignored_severity: false, }; - let security_analyzer = SecurityAnalyzer::with_config(security_config)?; + let mut security_analyzer = SecurityAnalyzer::with_config(security_config)?; // Perform security analysis println!("\n๐Ÿ›ก๏ธ Running comprehensive security analysis..."); diff --git a/src/analyzer/security_analyzer.rs b/src/analyzer/security_analyzer.rs index 1094783d..ce3929b1 100644 --- a/src/analyzer/security_analyzer.rs +++ b/src/analyzer/security_analyzer.rs @@ -11,10 +11,11 @@ use std::collections::HashMap; use std::path::{Path, PathBuf}; use std::fs; use std::time::Instant; +use std::process::Command; use regex::Regex; use serde::{Deserialize, Serialize}; use thiserror::Error; -use log::{info, debug}; +use log::{info, debug, warn}; use rayon::prelude::*; use indicatif::{ProgressBar, ProgressStyle, MultiProgress}; @@ -123,6 +124,10 @@ pub struct SecurityAnalysisConfig { pub check_compliance: bool, pub frameworks_to_check: Vec, pub ignore_patterns: Vec, + /// Whether to skip scanning files that are gitignored + pub skip_gitignored_files: bool, + /// Whether to downgrade severity for gitignored files instead of skipping + pub downgrade_gitignored_severity: bool, } impl Default for SecurityAnalysisConfig { @@ -152,6 +157,8 @@ impl Default for SecurityAnalysisConfig { "*_sample.*".to_string(), // Exclude sample files "*audit*".to_string(), // Exclude audit reports ], + skip_gitignored_files: true, // Default to skipping gitignored files + downgrade_gitignored_severity: false, // Skip entirely by default } } } @@ -160,6 +167,8 @@ pub struct SecurityAnalyzer { config: SecurityAnalysisConfig, secret_patterns: Vec, security_rules: HashMap>, + git_ignore_cache: std::sync::Mutex>, + project_root: Option, } /// Pattern for detecting secrets and sensitive data @@ -195,14 +204,19 @@ impl SecurityAnalyzer { config, secret_patterns, security_rules, + git_ignore_cache: std::sync::Mutex::new(HashMap::new()), + project_root: None, }) } /// Perform comprehensive security analysis with appropriate progress for verbosity level - pub fn analyze_security(&self, analysis: &ProjectAnalysis) -> Result { + pub fn analyze_security(&mut self, analysis: &ProjectAnalysis) -> Result { let start_time = Instant::now(); info!("Starting comprehensive security analysis"); + // Set project root for gitignore checking + self.project_root = Some(analysis.project_root.clone()); + // Check if we're in verbose mode by checking log level let is_verbose = log::max_level() >= log::LevelFilter::Info; @@ -362,6 +376,217 @@ impl SecurityAnalyzer { }) } + /// Check if a file is gitignored using git check-ignore command + fn is_file_gitignored(&self, file_path: &Path) -> bool { + // Return false if we don't have project root set + let project_root = match &self.project_root { + Some(root) => root, + None => return false, + }; + + // Use cache to avoid repeated git calls + if let Ok(cache) = self.git_ignore_cache.lock() { + if let Some(&cached_result) = cache.get(file_path) { + return cached_result; + } + } + + // Check if this is a git repository + if !project_root.join(".git").exists() { + debug!("Not a git repository, treating all files as tracked"); + return false; + } + + // First, try git check-ignore for the most accurate result + let git_result = Command::new("git") + .args(&["check-ignore", "--quiet"]) + .arg(file_path) + .current_dir(project_root) + .output() + .map(|output| output.status.success()) + .unwrap_or(false); + + // If git check-ignore says it's ignored, trust it + if git_result { + if let Ok(mut cache) = self.git_ignore_cache.lock() { + cache.insert(file_path.to_path_buf(), true); + } + return true; + } + + // Fallback: Parse .gitignore files manually for common patterns + // This helps when git check-ignore might not work perfectly in all scenarios + let manual_result = self.check_gitignore_patterns(file_path, project_root); + + // Cache the result (prefer git result, fallback to manual) + let final_result = git_result || manual_result; + if let Ok(mut cache) = self.git_ignore_cache.lock() { + cache.insert(file_path.to_path_buf(), final_result); + } + + final_result + } + + /// Manually check gitignore patterns as a fallback + fn check_gitignore_patterns(&self, file_path: &Path, project_root: &Path) -> bool { + // Get relative path from project root + let relative_path = match file_path.strip_prefix(project_root) { + Ok(rel) => rel, + Err(_) => return false, + }; + + let path_str = relative_path.to_string_lossy(); + let file_name = relative_path.file_name() + .and_then(|n| n.to_str()) + .unwrap_or(""); + + // Read .gitignore file + let gitignore_path = project_root.join(".gitignore"); + if let Ok(gitignore_content) = fs::read_to_string(&gitignore_path) { + for line in gitignore_content.lines() { + let pattern = line.trim(); + if pattern.is_empty() || pattern.starts_with('#') { + continue; + } + + // Check if this pattern matches our file + if self.matches_gitignore_pattern(pattern, &path_str, file_name) { + debug!("File {} matches gitignore pattern: {}", path_str, pattern); + return true; + } + } + } + + // Also check global gitignore patterns for common .env patterns + self.matches_common_env_patterns(file_name) + } + + /// Check if a file matches a specific gitignore pattern + fn matches_gitignore_pattern(&self, pattern: &str, path_str: &str, file_name: &str) -> bool { + // Handle different types of patterns + if pattern.contains('*') { + // Wildcard patterns + if let Ok(glob_pattern) = glob::Pattern::new(pattern) { + // Try matching both full path and just filename + if glob_pattern.matches(path_str) || glob_pattern.matches(file_name) { + return true; + } + } + } else if pattern.starts_with('/') { + // Absolute path from repo root + let abs_pattern = &pattern[1..]; + if path_str == abs_pattern { + return true; + } + } else { + // Simple pattern - could match anywhere in path + if path_str == pattern || + file_name == pattern || + path_str.ends_with(&format!("/{}", pattern)) { + return true; + } + } + + false + } + + /// Check against common .env file patterns that should typically be ignored + fn matches_common_env_patterns(&self, file_name: &str) -> bool { + let common_env_patterns = [ + ".env", + ".env.local", + ".env.development", + ".env.production", + ".env.staging", + ".env.test", + ".env.example", // Usually committed but should be treated carefully + ]; + + // Exact matches + if common_env_patterns.contains(&file_name) { + return file_name != ".env.example"; // .env.example is usually committed + } + + // Pattern matches + if file_name.starts_with(".env.") || + file_name.ends_with(".env") || + (file_name.starts_with(".") && file_name.contains("env")) { + // Be conservative - only ignore if it's clearly a local/environment specific file + return !file_name.contains("example") && + !file_name.contains("sample") && + !file_name.contains("template"); + } + + false + } + + /// Check if a file is actually tracked by git + fn is_file_tracked(&self, file_path: &Path) -> bool { + let project_root = match &self.project_root { + Some(root) => root, + None => return true, // Assume tracked if no project root + }; + + // Check if this is a git repository + if !project_root.join(".git").exists() { + return true; // Not a git repo, treat as tracked + } + + // Use git ls-files to check if file is tracked + Command::new("git") + .args(&["ls-files", "--error-unmatch"]) + .arg(file_path) + .current_dir(project_root) + .output() + .map(|output| output.status.success()) + .unwrap_or(true) // Default to tracked if git command fails + } + + /// Determine the appropriate severity for a secret finding based on git status + fn determine_secret_severity(&self, file_path: &Path, original_severity: SecuritySeverity) -> (SecuritySeverity, Vec) { + let mut additional_remediation = Vec::new(); + + // Check if file is gitignored + if self.is_file_gitignored(file_path) { + if self.config.skip_gitignored_files { + // Return Info level to indicate this should be skipped + return (SecuritySeverity::Info, vec!["File is properly gitignored".to_string()]); + } else if self.config.downgrade_gitignored_severity { + // Downgrade severity for gitignored files + let downgraded = match original_severity { + SecuritySeverity::Critical => SecuritySeverity::Medium, + SecuritySeverity::High => SecuritySeverity::Low, + SecuritySeverity::Medium => SecuritySeverity::Low, + SecuritySeverity::Low => SecuritySeverity::Info, + SecuritySeverity::Info => SecuritySeverity::Info, + }; + additional_remediation.push("Note: File is gitignored, reducing severity".to_string()); + return (downgraded, additional_remediation); + } + } + + // Check if file is tracked by git + if !self.is_file_tracked(file_path) { + additional_remediation.push("Ensure this file is added to .gitignore to prevent accidental commits".to_string()); + } else { + // File is tracked - this is a serious issue + additional_remediation.push("โš ๏ธ CRITICAL: This file is tracked by git! Secrets may be in version history.".to_string()); + additional_remediation.push("Consider using git-filter-branch or BFG Repo-Cleaner to remove from history".to_string()); + additional_remediation.push("Rotate any exposed secrets immediately".to_string()); + + // Upgrade severity for tracked files + let upgraded = match original_severity { + SecuritySeverity::High => SecuritySeverity::Critical, + SecuritySeverity::Medium => SecuritySeverity::High, + SecuritySeverity::Low => SecuritySeverity::Medium, + other => other, + }; + return (upgraded, additional_remediation); + } + + (original_severity, additional_remediation) + } + /// Initialize secret detection patterns fn initialize_secret_patterns() -> Result, SecurityError> { let patterns = vec![ @@ -970,27 +1195,54 @@ impl SecurityAnalyzer { for (line_num, line) in content.lines().enumerate() { for pattern in &self.secret_patterns { - if let Some(captures) = pattern.pattern.find(line) { + if let Some(_captures) = pattern.pattern.find(line) { // Skip if it looks like a placeholder or example if self.is_likely_placeholder(line) { continue; } + // Determine severity based on git status + let (severity, additional_remediation) = self.determine_secret_severity(file_path, pattern.severity.clone()); + + // Skip if severity is Info (indicates gitignored and should be skipped) + if self.config.skip_gitignored_files && severity == SecuritySeverity::Info { + debug!("Skipping secret in gitignored file: {}", file_path.display()); + continue; + } + + // Build base remediation steps + let mut remediation = vec![ + "Remove sensitive data from source code".to_string(), + "Use environment variables for secrets".to_string(), + "Consider using a secure secret management service".to_string(), + ]; + + // Add git-specific remediation based on file status + remediation.extend(additional_remediation); + + // Add generic gitignore advice if not already covered + if !self.is_file_gitignored(file_path) && !self.is_file_tracked(file_path) { + remediation.push("Add this file to .gitignore to prevent accidental commits".to_string()); + } + + // Create enhanced finding with git-aware severity and remediation + let mut description = pattern.description.clone(); + if self.is_file_tracked(file_path) { + description.push_str(" (โš ๏ธ WARNING: File is tracked by git - secrets may be in version history!)"); + } else if self.is_file_gitignored(file_path) { + description.push_str(" (โ„น๏ธ Note: File is gitignored)"); + } + findings.push(SecurityFinding { id: format!("secret-{}-{}", pattern.name.to_lowercase().replace(' ', "-"), line_num), title: format!("Potential {} Exposure", pattern.name), - description: pattern.description.clone(), - severity: pattern.severity.clone(), + description, + severity, category: SecurityCategory::SecretsExposure, file_path: Some(file_path.to_path_buf()), line_number: Some(line_num + 1), evidence: Some(format!("Line: {}", line.trim())), - remediation: vec![ - "Remove sensitive data from source code".to_string(), - "Use environment variables for secrets".to_string(), - "Consider using a secure secret management service".to_string(), - "Add this file to .gitignore if it contains secrets".to_string(), - ], + remediation, references: vec![ "https://owasp.org/www-project-top-ten/2021/A05_2021-Security_Misconfiguration/".to_string(), ], @@ -1362,4 +1614,122 @@ mod tests { assert!(!analyzer.is_sensitive_env_var("PORT")); assert!(!analyzer.is_sensitive_env_var("NODE_ENV")); } + + #[test] + fn test_gitignore_aware_severity() { + use tempfile::TempDir; + use std::fs; + use std::process::Command; + + let temp_dir = TempDir::new().unwrap(); + let project_root = temp_dir.path(); + + // Initialize a real git repo + let git_init = Command::new("git") + .args(&["init"]) + .current_dir(project_root) + .output(); + + // Skip test if git is not available + if git_init.is_err() { + println!("Skipping gitignore test - git not available"); + return; + } + + // Create .gitignore file + fs::write(project_root.join(".gitignore"), ".env\n.env.local\n").unwrap(); + + // Stage and commit .gitignore to make it effective + let _ = Command::new("git") + .args(&["add", ".gitignore"]) + .current_dir(project_root) + .output(); + let _ = Command::new("git") + .args(&["config", "user.email", "test@example.com"]) + .current_dir(project_root) + .output(); + let _ = Command::new("git") + .args(&["config", "user.name", "Test User"]) + .current_dir(project_root) + .output(); + let _ = Command::new("git") + .args(&["commit", "-m", "Add gitignore"]) + .current_dir(project_root) + .output(); + + let mut analyzer = SecurityAnalyzer::new().unwrap(); + analyzer.project_root = Some(project_root.to_path_buf()); + + // Test file that would be gitignored + let env_file = project_root.join(".env"); + fs::write(&env_file, "API_KEY=sk-1234567890abcdef").unwrap(); + + // Test severity determination for gitignored file + let (severity, remediation) = analyzer.determine_secret_severity(&env_file, SecuritySeverity::High); + + // With default config, gitignored files should be marked as Info (skipped) + assert_eq!(severity, SecuritySeverity::Info); + assert!(remediation.iter().any(|r| r.contains("gitignored"))); + } + + #[test] + fn test_gitignore_config_options() { + let mut config = SecurityAnalysisConfig::default(); + + // Test default configuration + assert!(config.skip_gitignored_files); + assert!(!config.downgrade_gitignored_severity); + + // Test downgrade mode + config.skip_gitignored_files = false; + config.downgrade_gitignored_severity = true; + + let analyzer = SecurityAnalyzer::with_config(config).unwrap(); + // Additional test logic could be added here for downgrade behavior + } + + #[test] + fn test_gitignore_pattern_matching() { + let analyzer = SecurityAnalyzer::new().unwrap(); + + // Test wildcard patterns - *.env matches files ending with .env + assert!(!analyzer.matches_gitignore_pattern("*.env", ".env.local", ".env.local")); // Doesn't end with .env + assert!(analyzer.matches_gitignore_pattern("*.env", "production.env", "production.env")); // Ends with .env + assert!(analyzer.matches_gitignore_pattern(".env*", ".env.production", ".env.production")); // Starts with .env + assert!(analyzer.matches_gitignore_pattern("*.log", "app.log", "app.log")); + + // Test exact patterns + assert!(analyzer.matches_gitignore_pattern(".env", ".env", ".env")); + assert!(!analyzer.matches_gitignore_pattern(".env", ".env.local", ".env.local")); + + // Test directory patterns + assert!(analyzer.matches_gitignore_pattern("/config.json", "config.json", "config.json")); + assert!(!analyzer.matches_gitignore_pattern("/config.json", "src/config.json", "config.json")); + + // Test common .env patterns that should work + assert!(analyzer.matches_gitignore_pattern(".env*", ".env", ".env")); + assert!(analyzer.matches_gitignore_pattern(".env*", ".env.local", ".env.local")); + assert!(analyzer.matches_gitignore_pattern(".env.*", ".env.production", ".env.production")); + } + + #[test] + fn test_common_env_patterns() { + let analyzer = SecurityAnalyzer::new().unwrap(); + + // Should match common .env files + assert!(analyzer.matches_common_env_patterns(".env")); + assert!(analyzer.matches_common_env_patterns(".env.local")); + assert!(analyzer.matches_common_env_patterns(".env.production")); + assert!(analyzer.matches_common_env_patterns(".env.development")); + assert!(analyzer.matches_common_env_patterns(".env.test")); + + // Should NOT match example/template files (usually committed) + assert!(!analyzer.matches_common_env_patterns(".env.example")); + assert!(!analyzer.matches_common_env_patterns(".env.sample")); + assert!(!analyzer.matches_common_env_patterns(".env.template")); + + // Should not match non-env files + assert!(!analyzer.matches_common_env_patterns("config.json")); + assert!(!analyzer.matches_common_env_patterns("package.json")); + } } diff --git a/src/cli.rs b/src/cli.rs index ce23eafd..36a9813f 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -25,6 +25,10 @@ pub struct Cli { /// Output in JSON format where applicable #[arg(long, global = true)] pub json: bool, + + /// Clear the update check cache and force a new check + #[arg(long, global = true)] + pub clear_update_cache: bool, } #[derive(Subcommand)] diff --git a/src/main.rs b/src/main.rs index 53c07b11..9dee05be 100644 --- a/src/main.rs +++ b/src/main.rs @@ -25,9 +25,16 @@ async fn main() { } async fn run() -> syncable_cli::Result<()> { - check_for_update(); let cli = Cli::parse(); + // Handle update cache clearing + if cli.clear_update_cache { + clear_update_cache(); + println!("โœ… Update cache cleared. Checking for updates now..."); + } + + check_for_update(); + // Initialize logging cli.init_logging(); @@ -107,6 +114,25 @@ async fn run() -> syncable_cli::Result<()> { Ok(()) } +fn clear_update_cache() { + let cache_file = cache_dir() + .unwrap_or_else(|| PathBuf::from(".")) + .join("syncable-cli/last_update_check"); + + if cache_file.exists() { + match fs::remove_file(&cache_file) { + Ok(_) => { + if std::env::var("SYNC_CTL_DEBUG").is_ok() { + eprintln!("๐Ÿ—‘๏ธ Removed update cache file: {}", cache_file.display()); + } + } + Err(e) => { + eprintln!("โš ๏ธ Failed to remove update cache: {}", e); + } + } + } +} + fn check_for_update() { let cache_file = cache_dir() .unwrap_or_else(|| PathBuf::from(".")) @@ -117,30 +143,79 @@ fn check_for_update() { if let Ok(metadata) = fs::metadata(&cache_file) { if let Ok(modified) = metadata.modified() { if now.duration_since(modified).unwrap_or(Duration::ZERO) < Duration::from_secs(60 * 60 * 24) { + // Debug logging to understand cache behavior + if std::env::var("SYNC_CTL_DEBUG").is_ok() { + eprintln!("๐Ÿ” Update check skipped - checked within last 24 hours"); + } return; } } } - // Query GitHub releases API instead of crates.io + // Debug logging + if std::env::var("SYNC_CTL_DEBUG").is_ok() { + eprintln!("๐Ÿ” Checking for updates..."); + } + + // Query GitHub releases API let client = reqwest::blocking::Client::builder() - .user_agent(format!("syncable-cli/{} ({})", env!("CARGO_PKG_VERSION"), env!("CARGO_PKG_REPOSITORY"))) + .user_agent(format!("syncable-cli/{}", env!("CARGO_PKG_VERSION"))) + .timeout(std::time::Duration::from_secs(5)) // Add timeout .build(); - if let Ok(client) = client { - let resp = client - .get("https://api.github.com/repos/syncable-dev/syncable-cli/releases/latest") - .send() - .and_then(|r| r.json::()); - - if let Ok(json) = resp { - let latest = json["tag_name"].as_str().unwrap_or("") - .trim_start_matches('v'); // Remove 'v' prefix if present - let current = env!("CARGO_PKG_VERSION"); - if latest != "" && latest != current { - println!( - "\x1b[33m๐Ÿ”” A new version of sync-ctl is available: {latest} (current: {current})\nRun `cargo install --git https://github.com/syncable-dev/syncable-cli --tag v{latest}` to update.\x1b[0m" - ); + match client { + Ok(client) => { + let result = client + .get("https://api.github.com/repos/syncable-dev/syncable-cli/releases/latest") + .send(); + + match result { + Ok(response) => { + if !response.status().is_success() { + if std::env::var("SYNC_CTL_DEBUG").is_ok() { + eprintln!("โš ๏ธ GitHub API returned status: {}", response.status()); + } + return; + } + + match response.json::() { + Ok(json) => { + let latest = json["tag_name"].as_str().unwrap_or("") + .trim_start_matches('v'); // Remove 'v' prefix if present + let current = env!("CARGO_PKG_VERSION"); + + if std::env::var("SYNC_CTL_DEBUG").is_ok() { + eprintln!("๐Ÿ“ฆ Current version: {}, Latest version: {}", current, latest); + } + + // Parse and compare versions properly + if latest != "" && latest != current { + // Only show update message if latest is actually newer + if is_version_newer(current, latest) { + println!( + "\x1b[33m๐Ÿ”” A new version of sync-ctl is available: {} (current: {})\nRun `cargo install syncable-cli` or download from https://github.com/syncable-dev/syncable-cli/releases/tag/v{}\x1b[0m", + latest, current, latest + ); + } + } + } + Err(e) => { + if std::env::var("SYNC_CTL_DEBUG").is_ok() { + eprintln!("โš ๏ธ Failed to parse GitHub API response: {}", e); + } + } + } + } + Err(e) => { + if std::env::var("SYNC_CTL_DEBUG").is_ok() { + eprintln!("โš ๏ธ Failed to check for updates: {}", e); + } + } + } + } + Err(e) => { + if std::env::var("SYNC_CTL_DEBUG").is_ok() { + eprintln!("โš ๏ธ Failed to create HTTP client: {}", e); } } } @@ -150,6 +225,29 @@ fn check_for_update() { let _ = fs::write(&cache_file, ""); } +// Helper function to compare semantic versions +fn is_version_newer(current: &str, latest: &str) -> bool { + let current_parts: Vec = current.split('.') + .filter_map(|s| s.parse().ok()) + .collect(); + let latest_parts: Vec = latest.split('.') + .filter_map(|s| s.parse().ok()) + .collect(); + + for i in 0..3 { + let current_part = current_parts.get(i).unwrap_or(&0); + let latest_part = latest_parts.get(i).unwrap_or(&0); + + if latest_part > current_part { + return true; + } else if latest_part < current_part { + return false; + } + } + + false +} + fn handle_analyze( path: std::path::PathBuf, json: bool, @@ -935,13 +1033,15 @@ fn handle_security( ".next".to_string(), "dist".to_string(), ], + skip_gitignored_files: true, + downgrade_gitignored_severity: false, }; thread::sleep(Duration::from_millis(300)); // Step 3: Security Scanner Initialization progress.set_message("Initializing security analyzer..."); progress.set_position(30); - let security_analyzer = SecurityAnalyzer::with_config(config) + let mut security_analyzer = SecurityAnalyzer::with_config(config) .map_err(|e| syncable_cli::error::IaCGeneratorError::Analysis( syncable_cli::error::AnalysisError::InvalidStructure( format!("Failed to create security analyzer: {}", e) diff --git a/test_update_check.sh b/test_update_check.sh new file mode 100755 index 00000000..f793d035 --- /dev/null +++ b/test_update_check.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +echo "๐Ÿงช Testing Syncable CLI Update Check" +echo "====================================" + +# Test 1: Clear cache and check with debug +echo -e "\n๐Ÿ“‹ Test 1: Clear cache and check with debug mode" +SYNC_CTL_DEBUG=1 cargo run -- --clear-update-cache analyze . 2>&1 | grep -E "(Checking for updates|Current version|Latest version|Update check skipped)" + +# Test 2: Check if cache works +echo -e "\n๐Ÿ“‹ Test 2: Second run should use cache" +sleep 1 +SYNC_CTL_DEBUG=1 cargo run -- analyze . 2>&1 | grep -E "(Update check skipped|Checking for updates)" + +# Test 3: Force check again +echo -e "\n๐Ÿ“‹ Test 3: Force check with --clear-update-cache" +SYNC_CTL_DEBUG=1 cargo run -- --clear-update-cache analyze . 2>&1 | grep -E "(Update cache cleared|Checking for updates)" + +echo -e "\nโœ… Test complete!" +echo "To test with a real update notification, the GitHub release needs to have a newer version than 0.4.1" \ No newline at end of file From 8ab4a8ffdcea384fbf16adcfd6ee5be97234255d Mon Sep 17 00:00:00 2001 From: Alex Holmberg Date: Sat, 7 Jun 2025 12:42:03 +0200 Subject: [PATCH 2/3] feat: improved README.md --- README.md | 488 ++++++++++------------------------------ src/analyzer/display.rs | 216 +++++++++--------- 2 files changed, 227 insertions(+), 477 deletions(-) diff --git a/README.md b/README.md index 179dce2a..c8c0771f 100644 --- a/README.md +++ b/README.md @@ -1,444 +1,202 @@ # ๐Ÿš€ Syncable IaC CLI -> AI-powered Infrastructure-as-Code generator that analyzes your codebase and automatically creates optimized Docker, Docker Compose, and Terraform configurations. +> Automatically generate optimized Docker, Kubernetes, and cloud infrastructure configurations by analyzing your codebase. [![Rust](https://img.shields.io/badge/rust-%23000000.svg?style=for-the-badge&logo=rust&logoColor=white)](https://www.rust-lang.org/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) -![Crates.io Downloads](https://img.shields.io/crates/d/syncable-cli) - -## ๐ŸŽฏ **260+ Technologies Supported** -**The most comprehensive project analyzer supporting 5 major languages and their complete ecosystems:** -- โ˜• **Java/JVM**: 98 technologies (13 Spring components + enterprise stack) -- ๐Ÿ **Python**: 76 technologies (Django, FastAPI, ML/Data Science) -- ๐ŸŸจ **JavaScript/TypeScript**: 46 technologies (React, Next.js, Node.js) -- ๐Ÿน **Go**: 21 technologies (cloud-native & microservices) -- ๐Ÿฆ€ **Rust**: 20 technologies (high-performance web & systems) - -## ๐ŸŒŸ Help Other Developers Discover This Tool - -**If this tool saves you time, please consider giving it a โญ on GitHub!** - -Stars help other developers find Syncable CLI, and the more builders who discover it early, the better we can make it for everyone. Every star helps us reach developers who could benefit from automated infrastructure analysis and generation. - -[โญ **Star on GitHub**](https://github.com/syncable-dev/syncable-cli) - - -## โœจ Features - -### ๐Ÿ” Comprehensive Project Analysis -- **Language Detection**: Automatically detects JavaScript/TypeScript, Python, Rust, Go, Java/Kotlin with precise version detection -- **Framework Recognition**: Identifies **260+ technologies** across all major ecosystems including complete Spring, Django, React, and Express families -- **Dependency Analysis**: Parses all package managers (npm/yarn/pnpm, pip/poetry, cargo, go mod, maven/gradle) and extracts version constraints -- **Vulnerability Scanning**: Integrates with security databases for each language ecosystem -- **Security Analysis**: Basic secret detection and environment variable security checks -- **Context Extraction**: Discovers entry points, ports, environment variables, and build scripts - -### ๐ŸŽฏ Current Capabilities (Phase 1 Complete โœ…) -- โœ… Multi-language project analysis -- โœ… Framework and library detection with confidence scoring -- โœ… Comprehensive dependency parsing -- โœ… Security vulnerability checking -- โœ… **Basic security analysis with secret detection** -- โœ… Project context analysis (ports, env vars, build scripts) -- โœ… Project type classification - -### ๐Ÿšง Coming Soon (Phase 2+) -- ๐Ÿค– AI-powered Dockerfile generation -- ๐Ÿณ Intelligent Docker Compose creation -- โ˜๏ธ Cloud-ready Terraform configurations -- ๐Ÿ”’ **Advanced security analysis** (infrastructure, framework-specific, compliance) -- ๐Ÿ“Š Performance optimization suggestions - -### ๐Ÿณ Docker Infrastructure Analysis -**NEW**: Comprehensive Docker infrastructure analysis and understanding: - -- **Dockerfile Analysis**: - - Supports all Dockerfile variants (`Dockerfile`, `dockerfile.dev`, `dockerfile.prod`, etc.) - - Extracts base images, exposed ports, environment variables, and build stages - - Detects multi-stage builds and complexity metrics - - Environment-specific configuration detection - -- **Docker Compose Analysis**: - - Supports all compose file variants (`docker-compose.yml`, `docker-compose.dev.yaml`, etc.) - - Service dependency mapping and network topology analysis - - Port mapping analysis (external/internal, host/container) - - Volume mount analysis and data persistence patterns - -- **Service Discovery & Networking**: - - Internal DNS and service communication patterns - - Custom network analysis and service isolation - - Load balancer detection (nginx, traefik, haproxy, kong) - - API gateway identification and ingress patterns - -- **Orchestration Pattern Detection**: - - Single Container applications - - Docker Compose multi-service setups - - Microservices architecture patterns - - Event-driven architecture (with message queues) - - Service mesh detection (Istio, Linkerd, Envoy) - -- **Monorepo Docker Support**: - - Analyzes Docker configurations across multiple projects - - Maps services to their respective project contexts - - Handles compose files at repository root with project-specific Dockerfiles - -## ๐Ÿ“ฆ Installation - -### โšก Quick Install - -The fastest way to get started: +[![Crates.io Downloads](https://img.shields.io/crates/d/syncable-cli)](https://crates.io/crates/syncable-cli) -```bash -cargo install syncable-cli -``` - -Or see below for building from source. - -### From Source (Recommended) - -```bash -# Prerequisites: Rust 1.70+ and Git - -# Clone the repository -git clone https://github.com/syncable-dev/syncable-cli.git -cd syncable-cli - -# Build and install -cargo install --path . - -# Verify installation -sync-ctl --version -``` - -### Pre-built Binaries +**Syncable IaC CLI** analyzes your project and automatically generates production-ready infrastructure configurations. Supporting **260+ technologies** across 5 major language ecosystems, it understands your stack and creates optimized IaC files tailored to your specific needs. -Coming soon! Check the [releases page](https://github.com/syncable-dev/syncable-cli/releases). - -## ๐Ÿš€ Quick Start - -### Analyze a Project +## โšก Quick Start ```bash -# Analyze current directory -sync-ctl analyze +# Install +cargo install syncable-cli -# Analyze specific project +# Analyze any project sync-ctl analyze /path/to/your/project -# Get JSON output -sync-ctl analyze --json > analysis.json +# Check for vulnerabilities +sync-ctl vulnerabilities -# Use different display modes (NEW!) -sync-ctl analyze --display matrix # Modern dashboard view (default) -sync-ctl analyze --display summary # Brief summary only -sync-ctl analyze --display detailed # Legacy verbose output -sync-ctl analyze -d # Shorthand for detailed +# Run security analysis +sync-ctl security ``` -### ๐Ÿ“Š Display Modes (NEW!) +That's it! The CLI will detect your languages, frameworks, dependencies, and provide detailed insights about your project structure. -The analyze command now offers multiple display formats: +## ๐ŸŽฏ What It Does -- **Matrix View** (default): A modern, compact dashboard with side-by-side project comparison -- **Summary View**: Brief overview perfect for CI/CD pipelines -- **Detailed View**: Traditional verbose output with all project details -- **JSON**: Machine-readable format for integration with other tools +Syncable IaC CLI is like having a DevOps expert analyze your codebase: -See the [Display Modes Documentation](docs/cli-display-modes.md) for visual examples and more details. +1. **๐Ÿ“Š Analyzes** - Detects languages, frameworks, dependencies, ports, and architecture patterns +2. **๐Ÿ” Audits** - Checks for security vulnerabilities and configuration issues +3. **๐Ÿš€ Generates** - Creates optimized Dockerfiles, Compose files, and Terraform configs (coming soon) -### Check for Vulnerabilities +### Example Output ```bash -# Run vulnerability scan -sync-ctl vulnerabilities /path/to/project - -# Check only high severity and above -sync-ctl vulnerabilities --severity high +$ sync-ctl analyze ./my-express-app -# Export vulnerability report -sync-ctl vulnerabilities --format json --output vuln-report.json +โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• +๐Ÿ“Š PROJECT ANALYSIS DASHBOARD +โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• + +โ”Œโ”€ Architecture Overview โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” +โ”‚ Type: Single Project โ”‚ +โ”‚ Pattern: Fullstack โ”‚ +โ”‚ Full-stack app with frontend/backend separation โ”‚ +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ + +โ”Œโ”€ Technology Stack โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” +โ”‚ Languages: JavaScript, TypeScript โ”‚ +โ”‚ Frameworks: Express, React, Tailwind CSS โ”‚ +โ”‚ Databases: PostgreSQL, Redis โ”‚ +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ ``` -### Security Analysis - -```bash -# Basic security analysis with secret detection -sync-ctl security /path/to/project +## ๐Ÿ“‹ Key Features -# Include low severity findings -sync-ctl security --include-low +### ๐Ÿ” Comprehensive Analysis +- **Multi-language support** - JavaScript/TypeScript, Python, Rust, Go, Java/Kotlin +- **260+ technologies** - From React to Spring Boot, Django to Actix-web +- **Architecture detection** - Monolithic, microservices, serverless, and more +- **Monorepo support** - Analyzes complex multi-project repositories -# Skip specific analysis types -sync-ctl security --no-secrets --no-code-patterns +### ๐Ÿ›ก๏ธ Security & Compliance +- **Vulnerability scanning** - Integrated security checks for all dependencies +- **Secret detection** - Finds exposed API keys and credentials +- **Security scoring** - Get actionable security recommendations +- **Compliance checks** - SOC2, GDPR, HIPAA support (coming soon) -# Generate security report -sync-ctl security --format json --output security-report.json +### ๐Ÿณ Docker Intelligence +- **Dockerfile analysis** - Understand existing Docker configurations +- **Multi-stage detection** - Identifies build optimization patterns +- **Service mapping** - Traces dependencies between containers +- **Network topology** - Visualizes service communication -# Fail CI/CD pipeline on security findings -sync-ctl security --fail-on-findings -``` - -**Current Security Features:** -- โœ… Secret detection (API keys, tokens, passwords) -- โœ… Environment variable security analysis -- โœ… Basic code pattern analysis (limited rules) -- โœ… Security scoring and risk assessment -- ๐Ÿšง Infrastructure security analysis (coming soon) -- ๐Ÿšง Framework-specific security checks (coming soon) -- ๐Ÿšง Compliance framework validation (coming soon) - -## ๐Ÿ“– Usage Examples - -### Example: Node.js Express Application +## ๐Ÿ› ๏ธ Installation +### Via Cargo (Recommended) ```bash -$ sync-ctl analyze ./my-express-app - -๐Ÿ” Analyzing project at: ./my-express-app -============================================================ - -๐Ÿ“Š PROJECT ANALYSIS RESULTS -============================================================ - -๐ŸŽฏ Languages: JavaScript (Node.js 18) -๐Ÿ”ง Frameworks: Express, React -๐Ÿ“ฆ Dependencies: 23 production, 15 development - -๐Ÿ”Œ Exposed Ports: - - 3000 (Express server) - - 9090 (Metrics endpoint) - -๐Ÿ” Environment Variables: - Required: DATABASE_URL, SECRET_KEY - Optional: PORT, NODE_ENV, LOG_LEVEL - -๐Ÿ”จ Build Scripts: - - npm start - - npm run dev - - npm test - - npm run build - -โœ… Project Type: Web Application +cargo install syncable-cli ``` -### Example: Python FastAPI Service - +### From Source ```bash -$ sync-ctl analyze ./fastapi-service --json +git clone https://github.com/syncable-dev/syncable-cli.git +cd syncable-cli +cargo install --path . ``` -```json -{ - "project_type": "ApiService", - "languages": [{ - "name": "Python", - "version": "3.11", - "confidence": 0.95 - }], - "frameworks": [{ - "name": "FastAPI", - "category": "Web", - "confidence": 0.92 - }], - "ports": [{ "number": 8000, "protocol": "Http" }], - "environment_variables": [ - { "name": "DATABASE_URL", "required": true }, - { "name": "REDIS_URL", "required": false } - ] -} -``` +## ๐Ÿ“– Usage Guide -### Example: Security Analysis +### Basic Commands ```bash -$ sync-ctl security ./my-project - -๐Ÿ›ก๏ธ Finalizing analysis... [00:00:01] โ–ฐโ–ฐโ–ฐโ–ฐโ–ฐโ–ฐโ–ฐโ–ฐโ–ฐโ–ฐโ–ฐโ–ฐโ–ฐโ–ฐโ–ฐโ–ฐโ–ฐโ–ฐโ–ฐโ–ฐ 100/100 100% - -๐Ÿ›ก๏ธ Security Analysis Results -============================================================ - -๐Ÿ“Š SECURITY SUMMARY -โœ… Security Score: 100.0/100 +# Analyze with different display formats +sync-ctl analyze # Matrix view (default) +sync-ctl analyze --display detailed # Detailed view +sync-ctl analyze --json # JSON output + +# Security & vulnerability checks +sync-ctl security # Comprehensive security analysis +sync-ctl vulnerabilities # Dependency vulnerability scan + +# Dependency analysis +sync-ctl dependencies --licenses # Show license information +sync-ctl dependencies --vulnerabilities # Check for known CVEs +``` -๐Ÿ” ANALYSIS SCOPE -โœ… Secret Detection (5 files analyzed) -โœ… Environment Variables (3 variables checked) -โ„น๏ธ Code Security Patterns (no applicable files found) -๐Ÿšง Infrastructure Security (coming soon) -๐Ÿšง Compliance Frameworks (coming soon) +### Display Modes -๐ŸŽฏ FINDINGS BY CATEGORY -๐Ÿ” Secret Detection: 0 findings -๐Ÿ”’ Code Security: 0 findings -๐Ÿ—๏ธ Infrastructure: 0 findings -๐Ÿ“‹ Compliance: 0 findings +Choose the output format that works best for you: -๐Ÿ’ก RECOMMENDATIONS -โ€ข Enable dependency vulnerability scanning in CI/CD -โ€ข Consider implementing rate limiting for API endpoints -โ€ข Review environment variable security practices -``` +- **Matrix** (default) - Compact dashboard view +- **Detailed** - Comprehensive vertical layout +- **Summary** - Brief overview for CI/CD +- **JSON** - Machine-readable format -## ๐Ÿ› ๏ธ Advanced Configuration +### Advanced Configuration -Create a `.syncable.toml` in your project: +Create `.syncable.toml` in your project root: ```toml [analysis] include_dev_dependencies = true -deep_analysis = true ignore_patterns = ["vendor", "node_modules", "target"] -max_file_size = 2097152 # 2MB -[output] -format = "json" # or "yaml", "toml" +[security] +fail_on_high_severity = true +check_secrets = true ``` -## ๐Ÿ”„ Automatic Update Checks +## ๐ŸŒŸ Technology Coverage -Syncable CLI automatically checks for updates once per day when you run any command. When a new version is available, you'll see a notification: +
+View Supported Technologies (260+) -``` -๐Ÿ”” A new version of sync-ctl is available: 0.5.0 (current: 0.4.1) -Run `cargo install syncable-cli` or download from https://github.com/syncable-dev/syncable-cli/releases/tag/v0.5.0 -``` +### By Language -### Troubleshooting Update Checks +- **JavaScript/TypeScript** (46) - React, Vue, Angular, Next.js, Express, Nest.js, and more +- **Python** (76) - Django, Flask, FastAPI, NumPy, TensorFlow, PyTorch, and more +- **Java/JVM** (98) - Spring Boot, Micronaut, Hibernate, Kafka, Elasticsearch, and more +- **Go** (21) - Gin, Echo, Fiber, gRPC, Kubernetes client, and more +- **Rust** (20) - Actix-web, Axum, Rocket, Tokio, SeaORM, and more -If you're not seeing update notifications: +### Package Managers +- npm, yarn, pnpm, bun (JavaScript) +- pip, poetry, pipenv, conda (Python) +- Maven, Gradle (Java) +- Cargo (Rust) +- Go modules (Go) -```bash -# Force an update check by clearing the cache -sync-ctl --clear-update-cache analyze . +
-# Enable debug logging to see what's happening -SYNC_CTL_DEBUG=1 sync-ctl analyze . -``` +## ๐Ÿš€ Roadmap -The update check: -- Only runs once per day (cached in `~/.cache/syncable-cli/`) -- Queries GitHub releases API to find the latest version -- Works behind corporate proxies (uses system proxy settings) -- Has a 5-second timeout to avoid slowing down commands - -To disable update checks, you can set the `SYNC_CTL_NO_UPDATE_CHECK` environment variable (coming in next release). - -## ๐Ÿงช Comprehensive Technology Support (260+ Technologies) - -### ๐Ÿ“Š Coverage by Language -- **โ˜• Java/JVM**: **98 technologies** - The most comprehensive JVM ecosystem coverage -- **๐Ÿ Python**: **76 technologies** - Complete Python web, data, and ML stack -- **๐ŸŸจ JavaScript/TypeScript**: **46 technologies** - Full-stack web development ecosystem -- **๐Ÿน Go**: **21 technologies** - Modern cloud-native and microservices tools -- **๐Ÿฆ€ Rust**: **20 technologies** - High-performance systems and web frameworks - -### ๐ŸŒŸ Major Ecosystem Coverage - -#### โ˜• **Java/JVM Ecosystem** (98 technologies) -**Spring Family** (13 technologies): -- Spring Boot, Spring Framework, Spring Security, Spring Data -- Spring Cloud (Gateway, Config, Netflix), Spring WebFlux, Spring MVC -- Spring Batch, Spring Integration, Spring AOP, and more - -**Enterprise & Microservices**: Quarkus, Micronaut, Dropwizard, Jakarta EE -**Database & ORM**: Hibernate, MyBatis, JPA, JDBI, MongoDB Driver, Redis Jedis -**Message Brokers**: Apache Kafka, RabbitMQ, ActiveMQ, Apache Pulsar -**Search & Big Data**: Elasticsearch, Apache Solr, Apache Spark, Apache Flink -**Security**: Apache Shiro, Keycloak, Bouncy Castle, JWT, OAuth2 -**Build Tools**: Maven, Gradle, Ant -**Testing**: JUnit, TestNG, Mockito, Selenium, Cucumber, Testcontainers -**Web Servers**: Tomcat, Jetty, Undertow, Netty - -#### ๐Ÿ **Python Ecosystem** (76 technologies) -**Web Frameworks**: Django, Flask, FastAPI, Pyramid, CherryPy, Tornado, Falcon -**Django Family**: Django REST Framework, Django ORM, Django-allauth -**Data & ML**: NumPy, Pandas, Scikit-learn, TensorFlow, PyTorch, Keras -**Database & ORM**: SQLAlchemy, Alembic, psycopg2, PyMongo, Redis-py -**Async & Messaging**: Celery, asyncio, aiohttp, Dramatiq -**Scientific**: Matplotlib, Seaborn, Jupyter, SciPy -**WSGI/ASGI Servers**: Gunicorn, Uvicorn, Hypercorn, Daphne, Waitress -**Testing**: pytest, unittest, nose2, behave, Robot Framework - -#### ๐ŸŸจ **JavaScript/TypeScript Ecosystem** (46 technologies) -**Meta-Frameworks**: Next.js, Nuxt.js, SvelteKit, Astro, SolidStart, Tanstack Start -**Frontend**: React, Vue.js, Angular, Svelte, SolidJS -**Mobile**: React Native, Expo -**Backend**: Express.js, Nest.js, Fastify, Hono, Elysia -**Database/ORM**: Prisma, Drizzle ORM, TypeORM, Mongoose, Sequelize -**Build Tools**: Vite, Webpack, Rollup, Parcel -**Runtimes**: Node.js, Bun, Deno, Cloudflare Workers, Vercel Edge -**Testing**: Jest, Vitest, Cypress, Playwright - -#### ๐Ÿน **Go Ecosystem** (21 technologies) -**Web Frameworks**: Gin, Echo, Fiber, Chi, Gorilla Mux, Beego -**Microservices**: gRPC, go-kit, go-micro -**Database**: GORM, sqlx, pgx -**Cloud Native**: Kubernetes client, Docker, Consul -**Testing**: Testify, Ginkgo, GoConvey - -#### ๐Ÿฆ€ **Rust Ecosystem** (20 technologies) -**Web Frameworks**: Actix-web, Axum, Rocket, Warp, Tide -**Async Runtimes**: Tokio, async-std -**Database/ORM**: SeaORM, Diesel, SQLx -**Serialization**: Serde -**Testing**: Built-in test framework, criterion (benchmarking) - -### ๐Ÿ“ฆ **Package Manager Support** -- **JavaScript**: npm, yarn, pnpm, bun -- **Python**: pip, poetry, pipenv, conda, pdm -- **Java**: Maven, Gradle -- **Rust**: Cargo -- **Go**: go mod -- **PHP**: Composer -- **Ruby**: Bundler +### โœ… Phase 1: Analysis Engine (Complete) +- Project analysis and technology detection +- Vulnerability scanning +- Basic security analysis + +### ๐Ÿ”„ Phase 2: AI-Powered Generation (In Progress) +- Smart Dockerfile generation +- Intelligent Docker Compose creation +- Cloud-optimized configurations + +### ๐Ÿ“… Future Phases +- Kubernetes manifests & Helm charts +- Terraform modules for AWS/GCP/Azure +- CI/CD pipeline generation +- Real-time monitoring setup ## ๐Ÿค Contributing -We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details. +We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines. ```bash # Run tests cargo test -# Run with debug logging -RUST_LOG=debug cargo run -- analyze ./test-project +# Check code quality +cargo clippy # Format code cargo fmt - -# Run linter -cargo clippy ``` -## ๐Ÿ“Š Project Status - -### Phase 1: Core Analysis Engine โœ… -- [x] Language Detection -- [x] Framework Detection -- [x] Dependency Parsing -- [x] Vulnerability Checking -- [x] **Basic Security Analysis** (secret detection, env vars) -- [x] Project Context Analysis - -### Phase 2: AI Integration ๐Ÿšง -- [ ] AI Provider Integration -- [ ] Smart Dockerfile Generation -- [ ] Intelligent Docker Compose -- [ ] Cloud-Ready Terraform - -See [ROADMAP.md](ROADMAP.md) for detailed progress. - ## ๐Ÿ“„ License -This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. +MIT License - see [LICENSE](LICENSE) for details. ## ๐Ÿ™ Acknowledgments -- Built with [Rust](https://www.rust-lang.org/) ๐Ÿฆ€ -- Uses [clap](https://github.com/clap-rs/clap) for CLI parsing -- Integrates with various security databases +Built with Rust ๐Ÿฆ€ and powered by the open-source community. --- -**Built with โค๏ธ by the Syncable team** +**Need help?** Check our [documentation](https://github.com/syncable-dev/syncable-cli/wiki) or [open an issue](https://github.com/syncable-dev/syncable-cli/issues). + +[![Star on GitHub](https://img.shields.io/github/stars/syncable-dev/syncable-cli?style=social)](https://github.com/syncable-dev/syncable-cli) diff --git a/src/analyzer/display.rs b/src/analyzer/display.rs index 605d4258..18b6cb42 100644 --- a/src/analyzer/display.rs +++ b/src/analyzer/display.rs @@ -61,7 +61,7 @@ impl BoxDrawer { title: title.to_string(), lines: Vec::new(), min_width: 60, - max_width: 150, // Increased to accommodate longer content + max_width: 120, // Reduced from 150 for better terminal compatibility } } @@ -96,49 +96,33 @@ impl BoxDrawer { max_content_width = max_content_width.max(rendered_width); } - // Use exact content width with minimal buffer for safety - let content_width_with_buffer = max_content_width + 2; // Minimal buffer for safety + // Add reasonable buffer for content + let content_width_with_buffer = max_content_width + 4; // More buffer for safety // Box needs padding: "โ”‚ " + content + " โ”‚" = content + 4 let needed_width = content_width_with_buffer + 4; - // Use the maximum of title width and content width, with a reasonable minimum - let min_reasonable_width = 50; - let optimal_width = title_width.max(needed_width).max(min_reasonable_width); - optimal_width.clamp(self.min_width, self.max_width) + // Use the maximum of title width and content width + let optimal_width = title_width.max(needed_width).max(self.min_width); + optimal_width.min(self.max_width) } /// Calculate the actual rendered width of a line as it will appear fn calculate_rendered_line_width(&self, line: &ContentLine) -> usize { - // Calculate actual display widths without formatting - let label_display_width = visual_width(&line.label); - let mut value_display_width = visual_width(&line.value); - - // Be more conservative for values that could grow significantly - if !line.value.is_empty() { - // Add extra space for values that are likely numeric and could grow - if line.label.contains("Files") || line.label.contains("Duration") || - line.label.contains("Dependencies") || line.label.contains("Ports") || - line.label.contains("Services") || line.label.contains("Total") { - value_display_width = value_display_width.max(8); // Reserve space for larger numbers - } - } + let label_width = visual_width(&line.label); + let value_width = visual_width(&line.value); if !line.label.is_empty() && !line.value.is_empty() { - // Both label and value - they need space between them - // For colored labels, ensure minimum spacing but use actual width - let actual_label_width = if line.label_colored { - label_display_width.max(20) // At least 20, but can be longer - } else { - label_display_width - }; - actual_label_width + 1 + value_display_width + // Label + value: need space between them + // For colored labels, ensure minimum spacing + let min_label_space = if line.label_colored { 25 } else { label_width }; + min_label_space + 2 + value_width // 2 spaces minimum between label and value } else if !line.value.is_empty() { // Value only - value_display_width + value_width } else if !line.label.is_empty() { // Label only - label_display_width + label_width } else { // Empty line 0 @@ -202,95 +186,71 @@ impl BoxDrawer { } fn draw_content_line(&self, line: &ContentLine, content_width: usize) -> String { - // Format the label with color if needed, but calculate width dynamically + // Format the label with color if needed let formatted_label = if line.label_colored && !line.label.is_empty() { line.label.bright_white().to_string() } else { line.label.clone() }; - let formatted_value = line.value.clone(); - // Calculate actual display widths - let label_display_width = visual_width(&line.label); // Use original label for width calculation - let value_display_width = visual_width(&formatted_value); - - // For colored labels, ensure minimum spacing but allow longer labels - let effective_label_width = if line.label_colored && !line.label.is_empty() { - label_display_width.max(20) // At least 20, but can be longer if needed - } else { - label_display_width - }; + // Calculate actual display widths (use original label for width) + let label_display_width = visual_width(&line.label); + let value_display_width = visual_width(&line.value); - // Determine content layout + // Build the content let content = if !line.label.is_empty() && !line.value.is_empty() { - // Both label and value - right-align the value - let available_space = content_width; - let min_space_between = 1; // Minimum space between label and value - - // Calculate how much space we need and have - let label_width = visual_width(&formatted_label); - let value_width = visual_width(&formatted_value); - let total_needed = label_width + min_space_between + value_width; + // Both label and value - ensure proper spacing + let min_label_space = if line.label_colored { 25 } else { label_display_width }; + let label_padding = min_label_space.saturating_sub(label_display_width); + let remaining_space = content_width.saturating_sub(min_label_space + 2); // 2 for spacing - if total_needed <= available_space { - // Everything fits - right-align the value - let padding_needed = available_space.saturating_sub(label_width).saturating_sub(value_width); - format!("{}{}{}", formatted_label, " ".repeat(padding_needed), formatted_value) + if value_display_width <= remaining_space { + // Value fits - right align it + let value_padding = remaining_space.saturating_sub(value_display_width); + format!("{}{: content_width { truncate_to_width(&content, content_width) + } else { + content }; format!("โ”‚ {} โ”‚", final_content) @@ -376,39 +336,71 @@ fn char_width(ch: char) -> usize { } } -/// Truncate string to specified visual width, preserving color codes when possible +/// Truncate string to specified visual width, preserving color codes fn truncate_to_width(s: &str, max_width: usize) -> String { - if visual_width(s) <= max_width { + let current_visual_width = visual_width(s); + if current_visual_width <= max_width { return s.to_string(); } + // For strings with ANSI codes, we need to be more careful + if s.contains('\x1b') { + // Simple approach: strip ANSI codes, truncate, then re-apply if needed + let stripped = strip_ansi_codes(s); + if visual_width(&stripped) <= max_width { + return s.to_string(); + } + + // Truncate the stripped version + let mut result = String::new(); + let mut width = 0; + for ch in stripped.chars() { + let ch_width = char_width(ch); + if width + ch_width > max_width.saturating_sub(3) { + result.push_str("..."); + break; + } + result.push(ch); + width += ch_width; + } + return result; + } + + // No ANSI codes - simple truncation + let mut result = String::new(); + let mut width = 0; + + for ch in s.chars() { + let ch_width = char_width(ch); + if width + ch_width > max_width.saturating_sub(3) { + result.push_str("..."); + break; + } + result.push(ch); + width += ch_width; + } + + result +} + +/// Strip ANSI escape codes from a string +fn strip_ansi_codes(s: &str) -> String { let mut result = String::new(); - let mut current_width = 0; let mut chars = s.chars().peekable(); while let Some(ch) = chars.next() { if ch == '\x1b' { - // Preserve ANSI escape sequence - result.push(ch); + // Skip ANSI escape sequence if chars.peek() == Some(&'[') { - result.push(chars.next().unwrap()); // consume '[' + chars.next(); // consume '[' while let Some(c) = chars.next() { - result.push(c); if c.is_ascii_alphabetic() { break; // End of escape sequence } } } - } else { - let char_width = char_width(ch); - if current_width + char_width > max_width { - if max_width >= 3 { - result.push_str("..."); - } - break; - } + } else { result.push(ch); - current_width += char_width; } } From 3610b6fee55c65fbf9dd80bc10aafe2df9fab359 Mon Sep 17 00:00:00 2001 From: Alex Holmberg Date: Sat, 7 Jun 2025 14:02:15 +0200 Subject: [PATCH 3/3] feat: Updating auto update rules, and general experience --- README.md | 11 +++- src/analyzer/display.rs | 12 ++-- src/main.rs | 141 +++++++++++++++++++++++++++++++--------- test_update_check.sh | 42 +++++++++--- 4 files changed, 159 insertions(+), 47 deletions(-) diff --git a/README.md b/README.md index c8c0771f..5799c32b 100644 --- a/README.md +++ b/README.md @@ -22,9 +22,12 @@ sync-ctl vulnerabilities # Run security analysis sync-ctl security + +# Force update check (clears cache) +sync-ctl --clear-update-cache analyze . ``` -That's it! The CLI will detect your languages, frameworks, dependencies, and provide detailed insights about your project structure. +That's it! The CLI will detect your languages, frameworks, dependencies, and provide detailed insights about your project structure. The tool includes smart update notifications to keep you on the latest version. ## ๐ŸŽฏ What It Does @@ -76,6 +79,12 @@ $ sync-ctl analyze ./my-express-app - **Service mapping** - Traces dependencies between containers - **Network topology** - Visualizes service communication +### ๐Ÿ”„ Smart Update System +- **Intelligent caching** - Checks every 2 hours when no update available +- **Immediate notifications** - Shows updates instantly when available +- **Clear instructions** - Provides multiple update methods with step-by-step guidance +- **Zero-maintenance** - Automatically keeps you informed of new releases + ## ๐Ÿ› ๏ธ Installation ### Via Cargo (Recommended) diff --git a/src/analyzer/display.rs b/src/analyzer/display.rs index 18b6cb42..7c2e0ddb 100644 --- a/src/analyzer/display.rs +++ b/src/analyzer/display.rs @@ -48,7 +48,7 @@ impl ContentLine { } /// Box drawer that pre-calculates optimal dimensions -struct BoxDrawer { +pub struct BoxDrawer { title: String, lines: Vec, min_width: usize, @@ -56,7 +56,7 @@ struct BoxDrawer { } impl BoxDrawer { - fn new(title: &str) -> Self { + pub fn new(title: &str) -> Self { Self { title: title.to_string(), lines: Vec::new(), @@ -65,15 +65,15 @@ impl BoxDrawer { } } - fn add_line(&mut self, label: &str, value: &str, label_colored: bool) { + pub fn add_line(&mut self, label: &str, value: &str, label_colored: bool) { self.lines.push(ContentLine::new(label, value, label_colored)); } - fn add_value_only(&mut self, value: &str) { + pub fn add_value_only(&mut self, value: &str) { self.lines.push(ContentLine::new("", value, false)); } - fn add_separator(&mut self) { + pub fn add_separator(&mut self) { self.lines.push(ContentLine::separator()); } @@ -130,7 +130,7 @@ impl BoxDrawer { } /// Draw the complete box - fn draw(&self) -> String { + pub fn draw(&self) -> String { let box_width = self.calculate_optimal_width(); let content_width = box_width - 4; // Available space for content diff --git a/src/main.rs b/src/main.rs index 9dee05be..aa6c9ce3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,7 +8,7 @@ use syncable_cli::{ config, generator, }; -use syncable_cli::analyzer::display::{display_analysis, DisplayMode}; +use syncable_cli::analyzer::display::{display_analysis, DisplayMode, BoxDrawer}; use std::process; use std::collections::HashMap; use std::fs; @@ -33,7 +33,7 @@ async fn run() -> syncable_cli::Result<()> { println!("โœ… Update cache cleared. Checking for updates now..."); } - check_for_update(); + check_for_update().await; // Initialize logging cli.init_logging(); @@ -115,9 +115,10 @@ async fn run() -> syncable_cli::Result<()> { } fn clear_update_cache() { - let cache_file = cache_dir() + let cache_dir_path = cache_dir() .unwrap_or_else(|| PathBuf::from(".")) - .join("syncable-cli/last_update_check"); + .join("syncable-cli"); + let cache_file = cache_dir_path.join("version_cache.json"); if cache_file.exists() { match fs::remove_file(&cache_file) { @@ -130,26 +131,61 @@ fn clear_update_cache() { eprintln!("โš ๏ธ Failed to remove update cache: {}", e); } } + } else { + if std::env::var("SYNC_CTL_DEBUG").is_ok() { + eprintln!("๐Ÿ—‘๏ธ No update cache file found at: {}", cache_file.display()); + } } } -fn check_for_update() { - let cache_file = cache_dir() +async fn check_for_update() { + let cache_dir_path = cache_dir() .unwrap_or_else(|| PathBuf::from(".")) - .join("syncable-cli/last_update_check"); + .join("syncable-cli"); + let cache_file = cache_dir_path.join("version_cache.json"); let now = SystemTime::now(); - // Only check once per day - if let Ok(metadata) = fs::metadata(&cache_file) { + // Smart cache system: only cache when no update is available + // Check every 2 hours when no update was found, immediately when an update might be available + let should_check = if let Ok(metadata) = fs::metadata(&cache_file) { if let Ok(modified) = metadata.modified() { - if now.duration_since(modified).unwrap_or(Duration::ZERO) < Duration::from_secs(60 * 60 * 24) { - // Debug logging to understand cache behavior - if std::env::var("SYNC_CTL_DEBUG").is_ok() { - eprintln!("๐Ÿ” Update check skipped - checked within last 24 hours"); + let cache_duration = now.duration_since(modified).unwrap_or(Duration::ZERO); + + // Read cached data to determine cache strategy + if let Ok(cache_content) = fs::read_to_string(&cache_file) { + if let Ok(cache_data) = serde_json::from_str::(&cache_content) { + let cached_latest = cache_data["latest_version"].as_str().unwrap_or(""); + let current = env!("CARGO_PKG_VERSION"); + + // If cached version is newer than current, check immediately + if !cached_latest.is_empty() && is_version_newer(current, cached_latest) { + if std::env::var("SYNC_CTL_DEBUG").is_ok() { + eprintln!("๐Ÿ” Update available in cache, showing immediately"); + } + show_update_notification(current, cached_latest); + return; + } + + // If no update in cache, check every 2 hours + cache_duration >= Duration::from_secs(60 * 60 * 2) + } else { + true // Invalid cache, check now } - return; + } else { + true // Can't read cache, check now } + } else { + true // Can't get modified time, check now } + } else { + true // No cache file, check now + }; + + if !should_check { + if std::env::var("SYNC_CTL_DEBUG").is_ok() { + eprintln!("๐Ÿ” Update check skipped - checked recently and no update available"); + } + return; } // Debug logging @@ -158,16 +194,17 @@ fn check_for_update() { } // Query GitHub releases API - let client = reqwest::blocking::Client::builder() + let client = reqwest::Client::builder() .user_agent(format!("syncable-cli/{}", env!("CARGO_PKG_VERSION"))) - .timeout(std::time::Duration::from_secs(5)) // Add timeout + .timeout(std::time::Duration::from_secs(5)) .build(); match client { Ok(client) => { let result = client .get("https://api.github.com/repos/syncable-dev/syncable-cli/releases/latest") - .send(); + .send() + .await; match result { Ok(response) => { @@ -178,7 +215,7 @@ fn check_for_update() { return; } - match response.json::() { + match response.json::().await { Ok(json) => { let latest = json["tag_name"].as_str().unwrap_or("") .trim_start_matches('v'); // Remove 'v' prefix if present @@ -188,15 +225,20 @@ fn check_for_update() { eprintln!("๐Ÿ“ฆ Current version: {}, Latest version: {}", current, latest); } - // Parse and compare versions properly - if latest != "" && latest != current { - // Only show update message if latest is actually newer - if is_version_newer(current, latest) { - println!( - "\x1b[33m๐Ÿ”” A new version of sync-ctl is available: {} (current: {})\nRun `cargo install syncable-cli` or download from https://github.com/syncable-dev/syncable-cli/releases/tag/v{}\x1b[0m", - latest, current, latest - ); - } + // Update cache with latest version info + let cache_data = serde_json::json!({ + "latest_version": latest, + "current_version": current, + "checked_at": now.duration_since(SystemTime::UNIX_EPOCH).unwrap().as_secs(), + "update_available": is_version_newer(current, latest) + }); + + let _ = fs::create_dir_all(&cache_dir_path); + let _ = fs::write(&cache_file, serde_json::to_string_pretty(&cache_data).unwrap_or_default()); + + // Show update notification if newer version is available + if !latest.is_empty() && latest != current && is_version_newer(current, latest) { + show_update_notification(current, latest); } } Err(e) => { @@ -219,10 +261,49 @@ fn check_for_update() { } } } +} - // Update cache file - let _ = fs::create_dir_all(cache_file.parent().unwrap()); - let _ = fs::write(&cache_file, ""); +fn show_update_notification(current: &str, latest: &str) { + use colored::*; + + let mut box_drawer = BoxDrawer::new(&"UPDATE AVAILABLE".bright_red().bold().to_string()); + + // Version info line with prominent colors + let version_info = format!("New version: {} | Current: {}", + latest.bright_green().bold(), + current.bright_red()); + box_drawer.add_value_only(&version_info); + + // Empty line for spacing + box_drawer.add_value_only(""); + + // Instructions header with emphasis + box_drawer.add_value_only(&"To update, run one of these commands:".bright_cyan().bold().to_string()); + box_drawer.add_value_only(""); + + // Recommended method - highlighted as primary option + box_drawer.add_line(&"RECOMMENDED".bright_green().bold().to_string(), &"(via Cargo)".green().to_string(), false); + let cargo_cmd = "cargo install syncable-cli".bright_white().on_blue().bold().to_string(); + box_drawer.add_value_only(&format!(" {}", cargo_cmd)); + box_drawer.add_value_only(""); + + // Alternative method - neutral coloring + box_drawer.add_line(&"ALTERNATIVE".yellow().bold().to_string(), &"(direct download)".yellow().to_string(), false); + let github_url = format!(" Visit: {}", + format!("github.com/syncable-dev/syncable-cli/releases/v{}", latest).bright_blue().underline()); + box_drawer.add_value_only(&github_url); + box_drawer.add_value_only(""); + + // Install script method - secondary option + box_drawer.add_line(&"SCRIPT".magenta().bold().to_string(), &"(automated installer)".magenta().to_string(), false); + let script_cmd = "curl -sSL install.syncable.dev | sh".bright_white().on_magenta().bold().to_string(); + box_drawer.add_value_only(&format!(" {}", script_cmd)); + + // Add a helpful note + box_drawer.add_value_only(""); + box_drawer.add_value_only(&"Tip: The Cargo method is fastest for existing Rust users".dimmed().italic().to_string()); + + println!("\n{}", box_drawer.draw()); } // Helper function to compare semantic versions diff --git a/test_update_check.sh b/test_update_check.sh index f793d035..ed082ddf 100755 --- a/test_update_check.sh +++ b/test_update_check.sh @@ -1,20 +1,42 @@ #!/bin/bash -echo "๐Ÿงช Testing Syncable CLI Update Check" -echo "====================================" +echo "๐Ÿงช Testing Syncable CLI Smart Update Check" +echo "===========================================" # Test 1: Clear cache and check with debug echo -e "\n๐Ÿ“‹ Test 1: Clear cache and check with debug mode" -SYNC_CTL_DEBUG=1 cargo run -- --clear-update-cache analyze . 2>&1 | grep -E "(Checking for updates|Current version|Latest version|Update check skipped)" +SYNC_CTL_DEBUG=1 cargo run -- --clear-update-cache analyze . 2>&1 | grep -E "(Checking for updates|Current version|Latest version|Update check skipped|Update available in cache)" -# Test 2: Check if cache works -echo -e "\n๐Ÿ“‹ Test 2: Second run should use cache" +# Test 2: Check if intelligent cache works +echo -e "\n๐Ÿ“‹ Test 2: Second run should use smart cache (2-hour window)" sleep 1 -SYNC_CTL_DEBUG=1 cargo run -- analyze . 2>&1 | grep -E "(Update check skipped|Checking for updates)" +SYNC_CTL_DEBUG=1 cargo run -- analyze . 2>&1 | grep -E "(Update check skipped|Checking for updates|Update available in cache)" -# Test 3: Force check again -echo -e "\n๐Ÿ“‹ Test 3: Force check with --clear-update-cache" -SYNC_CTL_DEBUG=1 cargo run -- --clear-update-cache analyze . 2>&1 | grep -E "(Update cache cleared|Checking for updates)" +# Test 3: Show cache contents +echo -e "\n๐Ÿ“‹ Test 3: Examining cache contents" +if [[ "$OSTYPE" == "darwin"* ]]; then + CACHE_FILE="$HOME/Library/Caches/syncable-cli/version_cache.json" +else + CACHE_FILE="$HOME/.cache/syncable-cli/version_cache.json" +fi + +if [ -f "$CACHE_FILE" ]; then + echo "Cache file found at: $CACHE_FILE" + echo "Cache contents:" + cat "$CACHE_FILE" | jq . 2>/dev/null || cat "$CACHE_FILE" +else + echo "No cache file found at: $CACHE_FILE" +fi + +# Test 4: Force check again +echo -e "\n๐Ÿ“‹ Test 4: Force check with --clear-update-cache" +SYNC_CTL_DEBUG=1 cargo run -- --clear-update-cache analyze . 2>&1 | grep -E "(Update cache cleared|Checking for updates|Removed update cache)" echo -e "\nโœ… Test complete!" -echo "To test with a real update notification, the GitHub release needs to have a newer version than 0.4.1" \ No newline at end of file +echo "Smart update system features:" +echo " โ€ข Checks every 2 hours when no update available" +echo " โ€ข Shows update immediately if cached version is newer" +echo " โ€ข Stores detailed version info in JSON cache" +echo " โ€ข Enhanced notification with clear update instructions" +echo " โ€ข Multiple update methods (Cargo, direct download, install script)" +echo " โ€ข To test with a real update notification, the GitHub release needs to have a newer version than 0.5.0" \ No newline at end of file