Skip to content
/ crash Public

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

Notifications You must be signed in to change notification settings

ahaoboy/crash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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, Zashboard, 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 proxy core and UI components
crash install

# Force reinstallation
crash install -f

Configuration Management

# Set configuration file URL
crash url <config-url>

# Update configuration from URL
crash update-url -f

# Update configuration from saved URL
crash update

Service Control

# Start proxy service
crash start

# Stop proxy service
crash stop

# Check service status
crash status

GeoIP Database Management

# Update GeoIP databases
crash update-geo

# Force update
crash update-geo --force

Web UI Configuration

# Set Web UI type
crash ui metacubexd  # or zashboard, yacd

# Set Web controller host
crash host :9090

# Set Web controller secret
crash secret <your-secret>

Scheduled Tasks

# Install scheduled tasks (auto-update config and databases)
crash task

# Manually run scheduled task
crash run-task

# Remove scheduled tasks
crash remove-task

Proxy Settings

# Set GitHub download proxy
crash proxy github      # Direct connection
crash proxy gh-proxy    # gh-proxy mirror
crash proxy xget        # xget mirror
crash proxy jsdelivr    # jsdelivr CDN

Self-Upgrade

crash upgrade

Target Platform Configuration

Set the target platform for downloading proxy cores. Using musl targets is recommended for better compatibility across different Linux distributions:

# Recommended: Use musl for better compatibility
crash target x86_64-unknown-linux-musl

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

Why musl? musl-based binaries are statically linked and work across different Linux distributions without dependency issues, making them more portable than gnu-based builds.

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

Maximum Runtime

# Set maximum runtime before automatic restart
crash max-runtime 24

# Disable automatic restart (run indefinitely)
crash max-runtime 0

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

Using just Commands

The project includes a justfile. You can use just to simplify development:

# List available commands
just --list

# Build project
just build

# Run tests
just 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

No packages published