Skip to content

Installation

System Requirements

DependencyMinimum VersionNotes
Rust1.75+Recommended to manage via rustup
OpenSSL / aws-lc-rsTLS dependency, auto-compiled
CMake3.12+Required for aws-lc-rs (Linux/macOS)

Windows requires NASM and Visual C++ Build Tools.

Build from Source

bash
git clone https://github.com/ChuYao233/Sweety.git
cd Sweety

# Production build (all optimizations enabled)
cargo build --release

# Binary located at
./target/release/sweety

Cargo Features

FeatureDefaultDescription
jemallocOffUse jemalloc instead of system allocator (Linux/macOS), ~10% improvement under high concurrency
bash
# Enable jemalloc
cargo build --release --features jemalloc

Install to System

bash
# Copy to /usr/local/bin
sudo cp target/release/sweety /usr/local/bin/
sweety --version

systemd Service

Save the following as /etc/systemd/system/sweety.service:

ini
[Unit]
Description=Sweety Web Server
After=network.target

[Service]
Type=simple
User=www-data
ExecStart=/usr/local/bin/sweety run -c /etc/sweety/sweety.toml
ExecReload=/usr/local/bin/sweety reload -c /etc/sweety/sweety.toml
Restart=on-failure
LimitNOFILE=65535

[Install]
WantedBy=multi-user.target
bash
sudo systemctl daemon-reload
sudo systemctl enable --now sweety
/etc/sweety/
├── sweety.toml          # Main config
├── certs/               # Manual certificates (or ACME auto-managed)
│   ├── example.com.crt
│   └── example.com.key
└── acme/                # ACME certificate cache directory

Released under the Apache License 2.0