# Utilities Commands Module # Commands for setup, configuration, monitoring, and maintenance utilities # Set shell for commands set shell := ["bash", "-c"] # ============================================================================= # SETUP COMMANDS # ============================================================================= # Complete project setup (default) setup: @echo "๐Ÿ”ง Setting up project..." {{justfile_directory()}}/scripts/setup/setup_dev.sh # Setup with custom name setup-name name: @echo "๐Ÿ”ง Setting up project with name: {{name}}..." {{justfile_directory()}}/scripts/setup/setup_dev.sh --name {{name}} # Setup for production setup-prod: @echo "๐Ÿ”ง Setting up project for production..." {{justfile_directory()}}/scripts/setup/setup_dev.sh --env prod # Install system dependencies setup-deps: @echo "๐Ÿ”ง Installing system dependencies..." {{justfile_directory()}}/scripts/setup/install-dev.sh # Setup wizard setup-wizard: @echo "๐Ÿ”ง Setting configuration wizard..." {{justfile_directory()}}/scripts/setup/run_wizard.sh # Setup configuration setup-config: @echo "๐Ÿ”ง Setting up configuration..." {{justfile_directory()}}/scripts/setup/setup-config.sh # Setup encryption setup-encryption: @echo "๐Ÿ”ง Setting up encryption..." {{justfile_directory()}}/scripts/setup/setup_encryption.sh # Generate TLS certificates setup-tls: @echo "๐Ÿ”ง Generating TLS certificates..." {{justfile_directory()}}/scripts/utils/generate_certs.sh # ============================================================================= # MONITORING COMMANDS # ============================================================================= # Check application health health: @echo "๐Ÿฅ Checking application health..." curl -f http://localhost:3030/health || echo "Health check failed" # Check readiness ready: @echo "๐Ÿฅ Checking application readiness..." curl -f http://localhost:3030/health/ready || echo "Readiness check failed" # Check liveness live: @echo "๐Ÿฅ Checking application liveness..." curl -f http://localhost:3030/health/live || echo "Liveness check failed" # View metrics metrics: @echo "๐Ÿ“Š Viewing metrics..." curl -s http://localhost:3030/metrics # View logs logs: @echo "๐Ÿ“‹ Viewing logs..." tail -f logs/app.log # ============================================================================= # CONFIGURATION COMMANDS # ============================================================================= # Show configuration config: @echo "โš™๏ธ Configuration:" @cat .env 2>/dev/null || echo "No .env file found" # Encrypt configuration value encrypt value: @echo "๐Ÿ”’ Encrypting value..." cargo run --bin config_crypto_tool encrypt "{{value}}" # Decrypt configuration value decrypt value: @echo "๐Ÿ”“ Decrypting value..." cargo run --bin config_crypto_tool decrypt "{{value}}" # Test encryption test-encryption: @echo "๐Ÿ”’ Testing encryption..." {{justfile_directory()}}/scripts/utils/test_encryption.sh # ============================================================================= # UTILITY COMMANDS # ============================================================================= # Install Node.js dependencies npm-install: @echo "๐Ÿ“ฆ Installing Node.js dependencies..." npm install # Install Rust dependencies (check) cargo-check: @echo "๐Ÿ“ฆ Checking Rust dependencies..." cargo check # Update dependencies update: @echo "๐Ÿ“ฆ Updating dependencies..." cargo update npm update # Show project information info: @echo "โ„น๏ธ Project Information:" @echo " Rust version: $(rustc --version)" @echo " Cargo version: $(cargo --version)" @echo " Node.js version: $(node --version)" @echo " npm version: $(npm --version)" @echo " Project root: $(pwd)" # Show disk usage disk-usage: @echo "๐Ÿ’พ Disk usage:" @echo " Target directory: $(du -sh target/ 2>/dev/null || echo 'N/A')" @echo " Node modules: $(du -sh node_modules/ 2>/dev/null || echo 'N/A')" # Check system requirements check-requirements: @echo "โœ… Checking system requirements..." @echo "Rust: $(rustc --version 2>/dev/null || echo 'rust Not installed')" @echo "Cargo: $(cargo --version 2>/dev/null || echo 'cargo Not installed')" @echo "Node.js: $(node --version 2>/dev/null || echo 'node Not installed')" @echo "pnpm: $(pnpm --version 2>/dev/null || echo 'pnpm Not installed')" @echo "mdbook: $(mdbook --version 2>/dev/null || echo 'mdbook Not installed')" @echo "Docker: $(docker --version 2>/dev/null || echo 'docker Not installed')" @echo "PostgreSQL: $(psql --version 2>/dev/null || echo 'psql for PostgreSQL Not installed')" @echo "SQLite: $(sqlite3 --version 2>/dev/null || echo 'sqlite3 Not installed')" # ============================================================================= # SCRIPT MANAGEMENT COMMANDS # ============================================================================= # Make all scripts executable scripts-executable: @echo "๐Ÿ”ง Making all scripts executable..." {{justfile_directory()}}/scripts/others/make-executable.sh # Make all scripts executable with verbose output scripts-executable-verbose: @echo "๐Ÿ”ง Making all scripts executable (verbose)..." {{justfile_directory()}}/scripts/others/make-executable.sh --verbose # List all available scripts scripts-list: @echo "๐Ÿ“‹ Available scripts:" @echo "" @echo "๐Ÿ—„๏ธ Database Scripts:" @ls -la scripts/databases/*.sh 2>/dev/null || echo " No database scripts found" @echo "" @echo "๐Ÿ”ง Setup Scripts:" @ls -la scripts/setup/*.sh 2>/dev/null || echo " No setup scripts found" @echo "" @echo "๐Ÿ› ๏ธ Tool Scripts:" @ls -la scripts/tools/*.sh 2>/dev/null || echo " No tool scripts found" @echo "" @echo "๐Ÿ”ง Utility Scripts:" @ls -la scripts/utils/*.sh 2>/dev/null || echo " No utility scripts found" # Check script permissions scripts-check: @echo "๐Ÿ” Checking script permissions..." @find scripts -name "*.sh" -type f ! -executable -exec echo "โŒ Not executable: {}" \; || echo "โœ… All scripts are executable" # ============================================================================= # MAINTENANCE COMMANDS # ============================================================================= # Clean everything clean-all: @echo "๐Ÿงน Cleaning everything..." @just ../build::clean rm -rf logs/ rm -rf backups/ docker system prune -f # Backup project backup: @echo "๐Ÿ’พ Creating project backup..." @just ../database::backup tar -czf backup-$(date +%Y%m%d-%H%M%S).tar.gz \ --exclude=target \ --exclude=node_modules \ --exclude=.git \ . # Show comprehensive system overview overview: @echo "๐Ÿ” Running system overview..." {{justfile_directory()}}/scripts/setup/overview.sh