Skip to content
/ sthub Public

Your static and config hub, simplified. Enhance your CI/CD experience.

License

Notifications You must be signed in to change notification settings

shackerd/sthub

Repository files navigation

sthub

FOSSA Status

"(static)-hub" — Your static and config hub, simplified

Note: This project is under active development and not yet production-ready. For detailed documentation, see the docs/ folder or visit the documentation site.


What is it?

sthub is a lightweight, flexible static file server with built-in support for dynamic configuration via environment variables. It is ideal for serving static web applications (such as SPAs) and exposing runtime configuration at a dedicated endpoint.


Features

  • Serve static files from a configurable directory and URL prefix.
  • Expose environment variables as a structured JSON tree at a configurable endpoint (default /env).
  • Apache-style rewrite rules for advanced static file routing (e.g., SPA fallback).
  • Custom response headers for static file responses.
  • Configurable via YAML (conf.yaml), including network, static, and configuration hubs.
  • CLI support for specifying the configuration file path.

Quick Start

  1. Configure your server in conf.yaml (see docs/configuration.md for details).

  2. Run the server:

    cargo run --release -- --configuration-path conf.yaml

    Or use the built binary.

  3. Access your static files at the configured remote_path (e.g., /public).

  4. Fetch environment/configuration variables:

    curl http://localhost:8080/env

Configuration Overview

  • Network: Set host and port.
  • Static hub:
    • remote_path: URL prefix for static files (e.g., /public)
    • path: Directory to serve
    • rewrite_rules: Apache-style rules for routing (optional)
    • headers: Custom response headers (optional)
  • Configuration hub:
    • remote_path: URL for environment/config endpoint (default /env)
    • providers.env.prefix: Prefix for environment variables (must end with __)

See docs/configuration.md for full details and examples.


Environment Variable Notation


License

FOSSA Status

About

Your static and config hub, simplified. Enhance your CI/CD experience.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Contributors 2

  •  
  •  

Languages