Skip to content

Installation

Docker is the easiest and recommended way to run Rust-Srec.

See the Docker deployment guide for complete setup instructions.

Pre-built Binaries

Download pre-built binaries from the GitHub Releases page.

Available platforms:

  • Linux (x86_64, aarch64)
  • Windows (x86_64)
  • macOS (x86_64, aarch64)

From Source

Environment Requirements

Before building from source, ensure your system meets the following requirements:

Rust Toolchain

  • Minimum Version: Rust 1.83.0 (2024 edition)
  • Channel: Stable
  • Installation: Use rustup for easy installation and management
bash
# Install Rust using rustup
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Or on Windows, download and run rustup-init.exe from https://rustup.rs/

# Verify installation
rustc --version
cargo --version

System Requirements

  • RAM: Minimum 2GB available (4GB+ recommended for faster builds)
  • Disk Space: At least 2GB free space for dependencies and build artifacts
  • Network: Internet connection required for downloading dependencies

Build Prerequisites

Required Tools

  • Git: Version control system

    • Linux: sudo apt-get install git (Debian/Ubuntu) or sudo dnf install git (Fedora/RHEL)
    • Windows: Download Git
    • macOS: Included with Xcode Command Line Tools
  • CMake: Required for building aws-lc-rs (minimum version 3.12)

    • Versions 3.12 or later are required
  • C/C++ Compiler:

    • Linux: GCC 7.1+ or Clang 5.0+
    • Windows: MSVC (Visual Studio 2017 or later / Visual Studio Build Tools)
    • macOS: Xcode Command Line Tools (macOS 10.13+ SDK)

aws-lc-rs Requirements

Rust-Srec uses aws-lc-rs for cryptography.

For complete platform-specific requirements, see the official aws-lc-rs documentation.

Linux (Debian/Ubuntu):

bash
sudo apt-get install cmake build-essential

Linux (Fedora/RHEL):

bash
sudo dnf install cmake gcc g++

macOS:

bash
xcode-select --install
brew install cmake

Windows:

Build

bash
# Clone the repository
git clone https://github.com/hua0512/rust-srec.git
cd rust-srec

# Build release binary
cargo build --release -p rust-srec

# Binary will be at target/release/rust-srec

Environment Variables

When running from source, both the backend and frontend require separate environment configuration.

Generate Secure Secrets

You can generate secure random strings using:

  • Linux/macOS: openssl rand -hex 32
  • Windows (PowerShell): $bytes = New-Object Byte[] 32; [Security.Cryptography.RandomNumberGenerator]::Create().GetBytes($bytes); -join ($bytes | ForEach-Object { "{0:x2}" -f $_ })

Backend Configuration

Copy the example file and configure:

bash
cd rust-srec
cp .env.example .env

Required Variables:

VariableDescription
JWT_SECRETSecret key for JWT token signing (min 32 characters)

Key Optional Variables:

VariableDescriptionDefault
DATABASE_URLSQL database connection stringsqlite:./srec.db
API_PORTBackend API server port8080
API_BIND_ADDRESSAPI bind address0.0.0.0
OUTPUT_DIRDirectory for recordings./output
RUST_LOGLogging levelinfo
WEB_PUSH_VAPID_PUBLIC_KEYVAPID public key for browser push notifications-
WEB_PUSH_VAPID_PRIVATE_KEYVAPID private key for browser push notifications-

See .env.example for all available options.


Frontend Configuration

Copy the example file and configure:

bash
cd rust-srec/frontend
cp .env.example .env

Required Variables:

VariableDescription
SESSION_SECRETSecret for session encryption (min 32 characters)

Key Optional Variables:

VariableDescriptionDefault
VITE_API_BASE_URLBackend API URL (build-time)http://localhost:8080/api
BACKEND_URLBackend URL for SSR (runtime)http://localhost:8080
COOKIE_SECUREForce HTTPS-only cookiesauto

See .env.example for all available options.


Proxy Configuration

If you're behind a corporate proxy or in a region with restricted access, add these to the backend .env:

VariableDescriptionExample
HTTP_PROXYHTTP proxy server URLhttp://proxy.example.com:8080
HTTPS_PROXYHTTPS proxy server URLhttp://proxy.example.com:8080
NO_PROXYComma-separated hosts to bypass proxylocalhost,127.0.0.1

After starting the application, enable proxy in Global Settings > Downloader > Proxy.

Full Reference

For a complete list of all available environment variables, see the Configuration Reference.

Running the Application

Once built and configured:

1. Start the Backend:

bash
cd rust-srec
./target/release/rust-srec

2. Start the Frontend (Development):

bash
cd rust-srec/frontend
pnpm install
pnpm dev

3. Access the Application:

  • Frontend: http://localhost:3000
  • API: http://localhost:8080/api

Released under the MIT License.