mirror of
https://github.com/abraunegg/onedrive
synced 2024-05-09 17:26:47 +02:00
docker guide fixes, add multiple account setup instructions (#729)
* docker guide fixes, add multiple account setup instructions
This commit is contained in:
parent
0445ae03d3
commit
34ed1608e8
|
@ -4,7 +4,7 @@ Thats right folks onedrive is now dockerized ;)
|
|||
|
||||
This container offers simple monitoring-mode service for 'Free Client for OneDrive on Linux'.
|
||||
|
||||
## Usage instructions
|
||||
## Basic Setup
|
||||
|
||||
### 0. Install docker under your own platform's instructions
|
||||
|
||||
|
@ -16,31 +16,25 @@ docker pull driveone/onedrive
|
|||
|
||||
**NOTE:** SELinux context needs to be configured or disabled for Docker, to be able to write to OneDrive host directory.
|
||||
|
||||
### 2. Prepare required stuff
|
||||
### 2. Prepare config volume
|
||||
|
||||
Onedrive needs two volumes. One of them is the config volume.
|
||||
|
||||
If you dont't need an extra config file, You can create a docker volume:
|
||||
Onedrive needs two volumes. One of them is the config volume. Create it with:
|
||||
|
||||
```bash
|
||||
docker volume create onedrive_conf
|
||||
```
|
||||
|
||||
This will create a docker volume labeled 'onedrive_conf', which we will use it later.
|
||||
This will create a docker volume labeled `onedrive_conf`, where all configuration of your onedrive account will be stored. You can add a custom config file and other things later.
|
||||
|
||||
The second one is your data folder that needs to sync with. Keep in mind that:
|
||||
The second docker volume is for your data folder and is created in the next step. It needs the path to a folder on your filesystem that you want to keep in sync with OneDrive. Keep in mind that:
|
||||
|
||||
- The owner of the folder must not be root
|
||||
- The owner of your specified folder must not be root
|
||||
|
||||
- The owner have permission to its parent directory
|
||||
(because onedrive will try to setup a monitor for the sync folder).
|
||||
- The owner of your specified folder must have permissions for its parent directory
|
||||
|
||||
### 3. First run
|
||||
|
||||
Onedrive also needs to be authorized with your account.
|
||||
This is done by running docker in interactive mode.
|
||||
|
||||
**make sure to change onedriveDir to your own.**
|
||||
Onedrive needs to be authorized with your Microsoft account. This is achieved by running docker in interactive mode. Run the docker image with the two commands below and **make sure to change `onedriveDir` to the onedrive data directory on your filesystem (e.g. `"/home/abraunegg/OneDrive"`)**
|
||||
|
||||
```bash
|
||||
onedriveDir="${HOME}/OneDrive"
|
||||
|
@ -48,15 +42,15 @@ docker run -it --restart unless-stopped --name onedrive -v onedrive_conf:/onedri
|
|||
```
|
||||
|
||||
- You will be asked to open a specific link using your web browser
|
||||
- login into your Microsoft Account and give the application the permission
|
||||
- Login to your Microsoft Account and give the application the permission
|
||||
- After giving the permission, you will be redirected to a blank page.
|
||||
- Copy the URI of the blank page into the application.
|
||||
|
||||
If your onedrive is working as expected, you can detach from the container with Ctrl+p, Ctrl+q.
|
||||
The onedrive monitor is configured to start with your host system. If your onedrive is working as expected, you can detach from the container with Ctrl+p, Ctrl+q.
|
||||
|
||||
### 4. Status, stop, and restart
|
||||
|
||||
Check if monitor service is running
|
||||
Check if the monitor service is running
|
||||
|
||||
```bash
|
||||
docker ps -f name=onedrive
|
||||
|
@ -80,27 +74,36 @@ Resume monitor
|
|||
docker start onedrive
|
||||
```
|
||||
|
||||
Unregister onedrive monitor
|
||||
Remove onedrive monitor
|
||||
|
||||
```bash
|
||||
docker rm -f onedrive
|
||||
```
|
||||
## Advanced Setup
|
||||
|
||||
### 5. Edit the config
|
||||
|
||||
Onedrive should run in default configuration, but however you can change your configuration.
|
||||
|
||||
First download the default config from [here](https://raw.githubusercontent.com/abraunegg/onedrive/master/config)
|
||||
Onedrive should run in default configuration, however you can change your configuration by placing a custom config file in the `onedrive_conf` docker volume. First download the default config from [here](https://raw.githubusercontent.com/abraunegg/onedrive/master/config)
|
||||
Then put it into your onedrive_conf volume path, which can be found with:
|
||||
|
||||
```bash
|
||||
docker volume inspect onedrive_conf
|
||||
```
|
||||
|
||||
Or you can map your own config folder to config volume (copy stuffs from docker volume first)
|
||||
Or you can map your own config folder to the config volume. Make sure to copy all files from the docker volume into your mapped folder first.
|
||||
|
||||
The detailed document for the config can be found here: [additional-configuration](https://github.com/abraunegg/onedrive#additional-configuration)
|
||||
|
||||
### 6. Sync multiple accounts
|
||||
|
||||
There are many ways to do this, the easiest is probably to
|
||||
1. Create a second docker config volume (replace `Work` with your desired name): `docker volume create onedrive_conf_Work`
|
||||
2. And start a second docker monitor container (again replace `Work` with your desired name):
|
||||
```
|
||||
onedriveDirWork="/home/abraunegg/OneDriveWork"
|
||||
docker run -it --restart unless-stopped --name onedrive_Work -v onedrive_conf_Work:/onedrive/conf -v "${onedriveDirWork}:/onedrive/data" driveone/onedrive
|
||||
```
|
||||
|
||||
## Run or update with one script
|
||||
|
||||
If you are experienced with docker and onedrive, you can use the following script:
|
||||
|
|
Loading…
Reference in a new issue