wala-rust

Content-adressed HTTP file server
Info | Log | Files | Refs | README | LICENSE

lib.rs (2125B)


      1 #![crate_name = "wala"]
      2 
      3 //! wala is a content-adressed HTTP file server.
      4 //! When content is uploaded, the URL to the content is automatcally generated from the contents of the request body. The URL will always be the same for the same content.
      5 //! These will be referred to as _immutable references_.
      6 //! 
      7 //! The content of the URL is the SHA256 hash of the content, in hex, lowercase, without a 0x
      8 //! prefix.
      9 //!
     10 //! ## Content metadata
     11 //!
     12 //! If built with the `meta` feature, the content type specified in the `PUT` will be stored and used
     13 //! when the file is retrieved. `wala` will _not_ double-check the content type against the actual
     14 //! content.
     15 //!
     16 //! ## Mutable references
     17 //!
     18 //! wala also provides a way to generate URL aliases to content based on cryptographic identities.
     19 //! These will be referred to as _mutable references_.
     20 //! See the [wala::auth](crate::auth) module for more details. 
     21 //! 
     22 //! ## Running the daemon
     23 //!
     24 //! The wala daemon will listen to all ip addresses on port 8000 by default, aswell as store and
     25 //! serve uploaded files from the current directory. This behavior can be modified by the argument
     26 //! options. See `cargo run -- --help` for details.
     27 //!
     28 //! ## Uploading content
     29 //!
     30 //! Content is stored by making `PUT` requests to the server. With a server running on
     31 //! `localhost:8000` a `PUT` with the content body `foo` can in turn be retrieved at:
     32 //!
     33 //! ``` ignore,
     34 //! http://localhost:8000/2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae 
     35 //! ```
     36 //!
     37 //! A helper tool [wala_send](../wala_send/index.html) is provided to make mutable reference uploads more
     38 //! convenient.
     39 
     40 /// Handle the custom PUBSIG HTTP authentication scheme to generate mutable references.
     41 pub mod auth;
     42 
     43 /// Encapsulates an incoming remote request.
     44 pub mod request;
     45 
     46 /// Encapsulates an outgoing response to remote.
     47 pub mod response;
     48 
     49 /// Interfaces a single content record lookup.
     50 pub mod record;
     51 
     52 #[cfg(feature = "meta")]
     53 /// Store and serve MIME metadata for content.
     54 pub mod meta;
     55 
     56 #[cfg(feature = "trace")]
     57 /// Log all successful requests to spool directory
     58 pub mod trace;