Git Product home page Git Product logo

onedrivefs's Introduction

OneDriveFS

A FUSE driver for Microsoft OneDrive™.

Usage

Before you can mount your personal cloud drive:

  • create a config.json file in ~/.config/onedrivefs by copying config.json.template
  • set the client ID (also known as application ID) and authorization code
    • the client ID is obtained by registering the application here

    • the authorization code is obtained by opening a link like the following in your browser (notice the client_id token):

      https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=${client_id}&scope=files.readwrite.all%20offline_access&response_type=code&redirect_uri=https%3A%2F%2Flogin.microsoftonline.com%2Fcommon%2Foauth2%2Fnativeclient
      

      After signing in, look in the address bar for a string that looks something like Mcb1aa9bf-b777-911b-2719-fddeacda4713. Copy it in your config.json.

Once all the needed information has been collected and set, you can do:

$ onedrivefs <your-mount-point>

and if you want to remove the mount:

fusermount -u <your-mount-point>

Features

  • List the drive contents
  • Get the drive available space and total size
  • Read files
  • Delete files
  • Delete directories
  • Get the SHA1 hash of each file (if available) via xattr-s (see getfattr -d <file>)
  • Basic directory entry cache

Building

You will need:

  • gcc >= 4.8.1
  • libcurl >= 7.47
  • jsoncpp >= 1.7
  • fuse >= 2.9
  • meson
  • ninja

In order to build the executable do:

$ git clone https://github.com/mdontu/onedrivefs.git
$ cd onedrivefs
$ mkdir build
$ cd build
$ meson ..
$ ninja

Known Issues

  • In-application OAuth2 is not supported (hence the dance with the client ID and authorization code)
  • Only the root drive is exposed
  • Writes are not supported
  • Copying files is not very fast. Use dd with a large block size (1MiB or more) as each read() translates into an HTTPS request
  • Deleting files moves them to Recycle Bin
  • Directory listings are limited to 200 entries

Resources

onedrivefs's People

Contributors

mdontu 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.