Skip to content

ahaoboy/crash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

184 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crash

A Rust-based proxy core management tool supporting Clash/Mihomo/SingBox and other proxy cores. This is a Rust port of ShellCrash.

Features

  • 🚀 Cross-platform support (Linux, macOS, Windows, Android)
  • 📦 Automatic download and installation of proxy cores
  • 🔄 Automatic configuration and GeoIP database updates
  • 🌐 Multiple Web UI support (Metacubexd, Yacd)
  • ⏰ Scheduled task support (automatic config and database updates)
  • 🔧 Flexible configuration management
  • 🪞 Multiple GitHub mirror support for accelerated downloads
crash

Installation

Quick Install

Install with a single command using the installation script:

bash <(curl -fsSL https://raw.githubusercontent.com/ahaoboy/crash/main/install.sh)

Using Proxy for Faster Downloads

If GitHub access is slow, use a mirror:

# Using gh-proxy mirror
bash <(curl -fsSL https://raw.githubusercontent.com/ahaoboy/crash/main/install.sh) --proxy gh-proxy

curl -fsSL https://gh-proxy.com/https://github.com/ahaoboy/crash/blob/main/install.sh | sh -s -- --proxy gh-proxy
curl -fsSL https://xget.xi-xu.me/gh/ahaoboy/crash/raw/refs/heads/main/install.sh | sh -s -- --proxy xget

# Using xget mirror
bash <(curl -fsSL https://raw.githubusercontent.com/ahaoboy/crash/main/install.sh) --proxy xget

# Using jsdelivr CDN
bash <(curl -fsSL https://raw.githubusercontent.com/ahaoboy/crash/main/install.sh) --proxy jsdelivr

crash-assets

https://github.com/ahaoboy/crash-assets

curl -fsSL https://cdn.jsdelivr.net/gh/ahaoboy/crash-assets@main/install.sh | sh -s -- --proxy jsdelivr

curl -fsSL https://gh-proxy.com/https://github.com/ahaoboy/crash-assets/blob/main/install.sh | sh -s -- --proxy gh-proxy

curl -fsSL https://cdn.statically.io/gh/ahaoboy/crash-assets/main/install.sh  | sh -s -- --proxy statically

curl -fsSL https://xget.xi-xu.me/gh/ahaoboy/crash-assets/raw/refs/heads/main/install.sh  | sh -s -- --proxy xget

asusrouter

curl -fsSL https://gh-proxy.com/https://github.com/ahaoboy/crash-assets/blob/main/install.sh | sh -s -- --proxy gh-proxy --dir /jffs

Custom Installation Directory

export EI_DIR=~/.local/bin
bash <(curl -fsSL https://raw.githubusercontent.com/ahaoboy/crash/main/install.sh)

Build from Source

# Clone the repository
git clone https://github.com/ahaoboy/crash.git
cd crash

# Build
cargo build --release

# Install
cargo install --path .

Usage

Initialize and Install

# Install all components (core, ui, geo, task)
crash install

# Force reinstallation of all
crash install -f

# Install specific components
crash install core        # Install proxy core only
crash install ui          # Install web UI only
crash install geo         # Install GeoIP databases only
crash install task        # Install scheduled tasks only

# Force install specific component
crash install -f core

Service Control

# Start proxy service
crash start

# Stop proxy service
crash stop

# Check service status
crash status

Configuration Management (config subcommand)

All configuration options are now unified under the config subcommand:

# View all configuration as JSON
crash config

# Configuration URL
crash config url                # Show current URL
crash config url <config-url>   # Set configuration URL (support URL or local path)

# GitHub download proxy
crash config proxy              # Show current proxy
crash config proxy gh-proxy     # Set proxy (direct, gh-proxy, xget, jsdelivr, etc.)

# Web UI type
crash config ui                 # Show current UI
crash config ui metacubexd      # Set UI (metacubexd, yacd)
# Web controller host
crash config host               # Show current host
crash config host :9090         # Set host

# Web controller secret
crash config secret             # Show current secret
crash config secret <secret>    # Set secret

# Target platform
crash config target             # Show current target
crash config target x86_64-unknown-linux-musl  # Set target

# Other common targets
crash config target aarch64-unknown-linux-musl    # ARM64 Linux (musl)
crash config target x86_64-unknown-linux-gnu      # x86_64 Linux (gnu)
crash config target aarch64-unknown-linux-gnu     # ARM64 Linux (gnu)
crash config target x86_64-pc-windows-msvc        # Windows x64
crash config target aarch64-apple-darwin          # macOS Apple Silicon
crash config target x86_64-apple-darwin           # macOS Intel

# Maximum runtime (hours, 0 = disabled)
crash config max-runtime        # Show current max-runtime
crash config max-runtime 24     # Set max-runtime to 24 hours
crash config max-runtime 0      # Disable automatic restart

Scheduled Tasks

# Install scheduled tasks (via install subcommand)
crash install task

# Manually run scheduled task
crash run-task

# Remove scheduled tasks
crash remove-task

Self-Upgrade

crash upgrade

Shell Completions

Generate shell completion scripts for auto-completion:

# Bash - Add to your shell profile
crash completions bash > ~/.local/share/bash-completion/completions/crash
# Or source directly
source <(crash completions bash)

# Fish - Install to fish completions directory
crash completions fish > ~/.config/fish/completions/crash.fish

# Zsh
crash completions zsh > "${fpath[1]}/_crash"

# PowerShell
crash completions powershell >> $PROFILE

# Elvish
crash completions elvish > ~/.config/elvish/lib/crash.elv

ei

crash ei ahaoboy/coreutils-build --name mktemp

crash ei ilai-deutel/kibi --proxy gh-proxy

Configuration File

Configuration file location:

  • Linux/macOS: ~/.crash/config.json
  • Windows: %USERPROFILE%\.crash\config.json

Example configuration:

{
  "url": "https://example.com/config.yaml",
  "proxy": "Direct",
  "web": {
    "ui": "Metacubexd",
    "host": ":9090",
    "secret": "your-secret"
  }
}

Supported Platforms

  • Linux (x86_64, aarch64, armv7, i686) - musl/gnu
  • macOS (x86_64, aarch64/Apple Silicon)
  • Windows (x86_64, i686, aarch64)
  • Android (aarch64, armv7, x86_64, i686)

Scheduled Tasks

After installing scheduled tasks, the system will automatically:

  • Every Wednesday at 3:00 AM: Update configuration files and GeoIP databases
  • Every 10 minutes: Check and start proxy service (if not running)

Linux/macOS (crontab)

0 3 * * 3 ~/.crash/crash run-task
*/10 * * * * ~/.crash/crash start

Windows (Task Scheduler)

  • CrashRunTask: Runs every Wednesday at 03:00
  • CrashStart: Runs every 10 minutes

Logging

Log files location:

  • Linux/macOS: ~/.crash/logs/
  • Windows: %USERPROFILE%\.crash\logs\

Logs are automatically rotated, keeping the last 5 files with a maximum size of 10MB each.

Development

Building

# Development build
cargo build

# Release build
cargo build --release

# Run tests
cargo test

License

MIT License - see LICENSE file for details

Acknowledgments

Contributing

Issues and Pull Requests are welcome!

Links

About

A Rust-based proxy core management tool supporting Clash/Mihomo/SingBox and other proxy cores. This is a Rust port of ShellCrash.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors