Git Product home page Git Product logo

ssfs's Introduction

Secure Static File Server

Static Files HTTPs server with self signed embedded certificate

Installation

Install using cargo:

cargo install ssfs

Or build from source:

git clone https://github.com/0xor0ne/ssfs
cd ssfs
cargo build --release
# executable in target/release/ssfs

Usage

General usage:

ssfs [--port <listening_port>] [--ip <binding_ip_address>]

--port and --ip are optional and their default values are:

  • --port: 8443
  • --ip: 0.0.0.0

ssfs will serve files present in its current working directory and sub-directories.

Examples

The following examples assume ssfs is present in current $PATH. If this is not the case, run ssfs by specifying the full path to the executable or copy ssfs in the directory where the files to be served are located and run it with ./ssfs.

Run ssfs on port 9000:

ssfs --port 9000

You can use curl with the --insecure option to connect to the server:

curl --insecure https://<server_ip>:9000/

you can download a specific file by using the path to the file (e.g. path/to/file.txt):

curl --insecure https://<server_ip>:9000/path/to/file.txt

This is an example of log printed by the server:

Starting server at: https://0.0.0.0:9000
[2023-04-09T15:59:47Z INFO  actix_server::builder] starting 10 workers
[2023-04-09T15:59:47Z INFO  actix_server::server] Actix runtime found; starting in Actix runtime
[2023-04-09T15:59:54Z INFO  ssfs] 127.0.0.1 curl/7.79.1 GET /path/to/file.txt HTTP/2.0 /path/to/file.txt

You can also connect to the server using a standard web browser and set the browser to trust the self signed certificate.

Certificate and Key

ssfs comes with pre-generate server certificate and key. They are located in:

  • assets/cert.pem
  • assets/key.pem

These two files are embedded into the ssfs executable during build.

If you want to use different certificate and key the the ones provided, you can use run the following scripts for generating a new pair of certificate and key:

./scripts/generate_cert_and_key.sh

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

ssfs's People

Contributors

0xor0ne avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

ssghost dmore gavz

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.