Git Product home page Git Product logo

docker-onedrive-sync's Introduction

Docker OneDrive Sync

This Docker image powered by fergusonds/onedrive allows you to sync a local volume with OneDrive.

Features:

  • State caching
  • File monitoring
  • Resumable uploads
  • Supports OneDrive for Business and OneDrive Personal

Setup - First Run

asciicast

When first launching the container you will need to authenticate with your Microsoft account. The procedure requires a web browser. You will be asked to open a specific link where you will have to login into your Microsoft Account and give the application the permission to access your files. After giving the permission, you will be redirected to a blank page. Copy the URI of the blank page into the application.

To allow you to copy the URI back into the docker container you need to launch it in interactive mode, this can be done using the -it flag.

docker run -it \
  -e PUID=$(id -u) -e PGID=$(id -g) \
  -v </path/to/config>:/config \
  -v </path/to/documents>:/documents \
  fergusonds/onedrive

Once authenticated you can stop the sync process and restart the container in non-interactive mode.

Usage

docker run \
  -e PUID=<UID> -e PGID=<GID> \
  -e TZ=<timezone> \
  -v </path/to/config>:/config \
  -v </path/to/documents>:/documents \
  fergusonds/onedrive

Parameters

The parameters are split into two halves, separated by a colon, the left hand side representing the host and the right the container side.

  • -v /config - This is where the OneDrive Client will store it's config. See fergusonds/onedrive#configuration
  • -v /documents - This is the folder that will be synced with OneDrive
  • -e TZ - for timezone information e.g. -e TZ=Europe/London
  • -e PGID - for GroupID - This should match the GID of the user who owns the local files
  • -e PUID - for UserID - This should match the UID of the user who owns the local files
  • -e DEBUG=1 - to enable verbose logging set DEBUG=1

Docker Compose

If you prefer to use Docker Compose:

version: '2'
services:
  onedrive:
    image: fergusonds/onedrive
    restart: always
    environment:
      - TZ=Australia/Sydney
      - PGID=911
      - PUID=911
    volumes:
      - ./config:/config
      - /home/fergusonds:/documents

To authenticate with your Microsoft account for the first time run (this will start the container in interactive mode):

docker-compose run onedrive

You can then start the container in non-interactive and run it as a background process:

docker-compose up -d

docker-onedrive-sync's People

Contributors

kukki avatar oznu avatar pmferg avatar

Watchers

 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.