Quick Start Guide

Get Rusty Beam up and running in minutes!

Prerequisites

Installation

Option 1: Build from Source

# Clone the repository
git clone https://github.com/your-org/rusty-beam.git
cd rusty-beam

# Build the server and plugins
./build-plugins.sh

# Run the server
cargo run -- docs/config/index.html

Option 2: Docker

# Clone the repository
git clone https://github.com/your-org/rusty-beam.git
cd rusty-beam

# Create environment file
cat > .env << EOF
GOOGLE_CLIENT_ID=your-client-id
GOOGLE_CLIENT_SECRET=your-client-secret
GOOGLE_OAUTH2_CALLBACK=http://localhost:3000/auth/google/callback
EOF

# Run with Docker Compose
docker-compose up --build

Basic Configuration

Rusty Beam uses HTML files for configuration. Create a simple config:

<!DOCTYPE html>
<html>
<body itemscope itemtype="https://rustybeam.net/schema/ServerConfig">
    <table>
        <tr>
            <td>Bind Address</td>
            <td><span itemprop="bindAddress">127.0.0.1</span></td>
        </tr>
        <tr>
            <td>Port</td>
            <td><span itemprop="bindPort">3000</span></td>
        </tr>
    </table>

    <table itemscope itemtype="https://rustybeam.net/schema/HostConfig">
        <tr>
            <td>Hostname</td>
            <td><span itemprop="hostname">localhost</span></td>
        </tr>
        <tr>
            <td>Host Root</td>
            <td><span itemprop="hostRoot">./public</span></td>
        </tr>
        <tr>
            <td>File Handler</td>
            <td itemprop="plugin" itemscope itemtype="https://rustybeam.net/schema/FileHandlerPlugin">
                <span itemprop="library">file://./plugins/librusty_beam_file_handler.so</span>
            </td>
        </tr>
    </table>
</body>
</html>

Adding Plugins

Extend functionality by adding plugins to your configuration:

<!-- OAuth2 Authentication -->
<td itemprop="plugin" itemscope itemtype="https://rustybeam.net/schema/OAuth2Plugin">
    <span itemprop="library">file://./plugins/librusty_beam_oauth2.so</span>
    <span itemprop="clientIdEnv">GOOGLE_CLIENT_ID</span>
    <span itemprop="clientSecretEnv">GOOGLE_CLIENT_SECRET</span>
    <span itemprop="redirectUriEnv">GOOGLE_OAUTH2_CALLBACK</span>
    <span itemprop="loginPath">/auth/google/login</span>
</td>

<!-- Compression -->
<td itemprop="plugin" itemscope itemtype="https://rustybeam.net/schema/CompressionPlugin">
    <span itemprop="library">file://./plugins/librusty_beam_compression.so</span>
</td>
Plugin Order Matters! Plugins are executed in the order they appear in your configuration. Place authentication plugins before authorization, and handlers last.

CSS Selector API

Use Range headers to manipulate HTML content:

# Get only the title element
curl -H "Range: selector=title" http://localhost:3000/page.html

# Get all paragraphs
curl -H "Range: selector=p" http://localhost:3000/page.html

# Get element by ID
curl -H "Range: selector=#content" http://localhost:3000/page.html

Hot Configuration Reload

Update configuration without restarting:

# Find the server PID (shown on startup)
# Then send SIGHUP signal
kill -HUP <PID>

Next Steps

Production Deployment: For production use, ensure you: