Giter Club home page Giter Club logo

rustan's Introduction

RustAn

Spartan server written in Rust.

Short info

Small server that will cover all basic needs.

It supports:

  • Serving static files
  • Serving file lists
  • CGI-like scripts(all input data will be send to stdin of process)
  • Basic configuration

Configuration

Log level always fetched via enviroment.

Use RUST_LOG variable for setting log level(info, debug, trace etc).

There two ways of configuration of server:

  • Via enviroment
  • Via toml-file
  • Nothing - will be used default configuration

Configuration via enviroment

Just setup next variables:

  • RUSTAN_HOST(for example RUSTAN_HOST="127.0.0.1:3001" ./rustan)
  • RUSTAN_SERVER_ROOT (for example RUSTAN_SERVER_ROOT="/var/spartan ./rustan")
  • RUSTAN_MAX_UPLOAD_SIZE (for example RUSTAN_MAX_UPLOAD_SIZE=1024)

Entire command can look like this:

RUST_LOG=info RUSTAN_HOST="127.0.0.1:3001" RUSTAN_SERVER_ROOT="/var/spartan" RUSTAN_MAX_UPLOAD_SIZE=1 ./rustan

TOML-configuration

There example file settings.toml.example that can be used as template.

When RustAn starting it looking for settings.toml in current directory and in /etc/rustan/.

Settings can be overrided via enviroment configuration.

Serving directories

To serve directory you should create .listfiles file.

If it have some contents - it will be used as gemini header.

Building

You'll need cargo tool.

It can be installed via rustup.

For development you can run it just via RUST_LOG=debug cargo run.

For building release version use cargo build --release. Compiled binary will be in target/release directory.

ToDo

  • Add redirects support
  • Handle directories without slashes on end
  • Windows support(may be it will work out of the box, not tested)
  • Maybe something else?

License

I've licensed project by Nihirash's Coffeeware License.

Please respect it - it isn't hard.

rustan's People

Contributors

nihirash avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

rustan's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.