Giter VIP home page Giter VIP logo

graph_fs's Introduction

GraphFS

GraphFS is a GrapQL interface for interfacing with a file system. It works with both remote or local file system

Local setup

To setup with a local filesystem

  • Run cargo build followed by :
./target/debug/graph_fs -p <port> -h <host> --auth_path <authorized path>

The authorized path is for security measures. Once it is specified eg home/Pictures no operation would be carried out outside this directory. Allowing you to expose just a segment of your computer directory and not your entire file system.

To define workers you can add the flag -w <number of workers> this is optional and would default to 2 workers

To read file and upload file, we use the REST API endpoint (I decided to use API here for optimization reasons and limitations from juniper GraphQL)

Read endpoint /get_local_file?path=<path to read> Upload endpoint /add_local_file?path=<directory to upload> Graphql playground: /graphiql (GraphQL doc exist here)

Remote setup

Please note that the remote FS only works with a unix based or linux FS

To setup with a remote filesystem

  • Run cargo build followed by :

To use user password auth option to authorize remote file system

./target/debug/graph_fs -p <port> -h <host> --remote true --auth_option user_password --remote_host <remote fs host> --remote_port <remote fs port> --username <name> --password <pass> --auth_path <authorized path>

To use username

./target/debug/graph_fs -p <port> -h <host> --remote true --auth_option user_agent --remote_host <remote fs host> --remote_port <remote fs port> --username <name> --auth_path <authorized path>

To use public key

./target/debug/graph_fs -p <port> -h <host> --remote true --auth_option user_pub_key --remote_host <remote fs host> --remote_port <remote fs port> --username <name> --public_key <public key path> --private_key <private key path> --passphrase <passphrase> --auth_path <authorized path>

To define workers you can add the flag -w <number of workers> this is optional and would default to 2 workers

You should be able to access the local fs api and graphql endpoints while in remote mode.

Read endpoint /get_remote_file?path=<path to read> Upload endpoint /add_remote_file?path=<directory to upload> Graphql playground: /graphiql (GraphQL doc exist here)

graph_fs's People

Contributors

valentine-mario avatar

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.