Skip to content
Snippets Groups Projects

espresso

The web server behind chromabits.com. Espresso is built to serve static websites in a container cluster.

Object Storage

On boot, Espresso downloads the site its serving from a bucket on a object storage backend (S3 compatible). While running, Espresso will check for updates on the site bundle and download them as necessary.

Espresso expects the whole site to be stored in a single Gzipped TAR archive named bundle.tar.gz at the root of the bucket.

Requirements

  • S3-compatible: The object storage service should expose an S3-compatible interface. Tested backends are Ceph RGW and Minio.
  • ETag Support: Espresso uses ETags to detect changes to the site bundle. The backend service should support these.

Configuration

Espresso can be configured via a TOML configuration file. Simply create a config.toml file and place it on the working directory.

[server]
address = "127.0.0.1:8088"
run_dir = "run"
auto_cleanup = true

[stats]
address = "127.0.0.1:8089"

[bundle]
type = "LocalBundle"
dir = "/tmp/"

[unbundler]
poll_seconds = 10

Customization

While Espresso was built specifically for chromabits.com, it is able to serve other static sites as long as their requirements are simple.

Development

RUST_LOG=info cargo run to build and run the server.

RUST_LOG=info cargo test to run all tests.