BVersluis Posted December 17, 2022 Share Posted December 17, 2022 (edited) I am a new user of Unraid and Docker and was looking for an alternative to Synology Cloud Sync, which I used to keep all my family's Onedrive files as harcopy on my previous NAS (multiple accounts). I was therefor not looking for an app like Duplicati/Duplicay to spread my files even further over the cloud, but to get my files back from the cloud and keep them synchronized. For this purpose I decided to run the Onedrive Client for Linux in a separate docker container for different Onedrive accounts on my Unraid install, which seems to work quite well. Below my beginners guide for how to set this up with docker compose following this guide. Requirements: Docker compose installed Dynamix File Manager installed (helpful) Step 1: In the Unraid WebUI open the terminal and type ‘id username’ for every user with onedrive account you want to install a Onedrive container for and write down the UID and GID for these users. Step 2: Add a share called ‘onedrive’ (or choose your own name). Optionally enable cache, select preferred disk(s) and decide if you want to export the share. Step 3: If you are planning to use multiple containers/accounts, create subfolders for every user as well in the just created onedrive folder (/onedrive/userA, /onedrive/userB, etc.). Do this before running the container later on. Step 4: Create a ‘onedrive’ folder under /mnt/user/appdata/ and again create subfolders (userA, userB etc.) for different users Step 5: Go to the Docker tab, scroll down to Compose and press ‘Add new stack’ Step 6: Type a project name (for example Onedrive-userA) and press ‘OK’ and again ‘OK’ after success Step 7: Click on the cog-wheel of the new created stack and press ‘Edit stack’ followed by ‘Compose file’ Step 8: Past in the composer file below: version: "3.7" services: onedrive: image: driveone/onedrive:latest container_name: Onedrive-userA stdin_open: true # docker run -i tty: true # docker run -t restart: unless-stopped environment: - ONEDRIVE_UID=1001 - ONEDRIVE_GID=100 volumes: - /mnt/user/appdata/onedrive/userA:/onedrive/conf/ - /mnt/user/onedrive/userA:/onedrive/data Step 9: Before saving, make the following changes to the composer file: · Change the container name in a name of your liking, for example Onedrive_UserA, Onedrive_UserB. · Change the UID and GID to the correct values for the user, as found in step 1 · Under volumes change the path left from the colon to the correct config and data folder (so ‘/mnt/user/appdata/onedrive/userA’ and ‘/mnt/user/onedrive/userA’ if the example above has been followed. Don't touch the values right from the colon. · Optionally, if you created your custom network for docker containers, you can add the network settings below and change 'nameofyournetwork' to the name of your network. Otherwise a new network (container_name_default) is created. Example: version: "3.7" services: onedrive: image: driveone/onedrive:latest container_name: Onedrive-userA stdin_open: true # docker run -i tty: true # docker run -t restart: unless-stopped environment: - ONEDRIVE_UID=1001 - ONEDRIVE_GID=100 volumes: - /mnt/user/appdata/onedrive/userA:/onedrive/conf/ - /mnt/user/onedrive/userA:/onedrive/data networks: - proxy networks: proxy: external: true name: nameofyournetwork Step 10: Press ‘save changes’ Step 11 (optional): If you want to add an icon to your docker container (otherwise you’ll see a questionmark), press the cog-wheel again, select ‘edit stack’ and select UI labels. On the internet find a link to the icon of your choosing (for example from Onedrive’s wiki) and past the link in this field. This can be done later on as well (by updating the stack). Press ‘OK’ when done. Step 12: Press ‘Compose up’ and press ‘Done’ when it is done. A new container is now created and running, but the Onedrive Client still needs to be connected to your Microsoft account with the following steps: Step 13: Stop the new container Step 14: In the right upper corner of the docker page, switch over from ‘Basic view’ to ‘Advanced view’. Now you can see the Container ID for your newly made container (for example 72409c107bd0). Copy this number. Step 15: Open the Unraid terminal and enter: docker start your_container_id --interactive Use right mouse and paste to paste your container ID in the terminal. Step 16: After entering the command and pressing enter, the container starts in an interactive mode and a link to Microsoft is shown in the terminal. You open this link by clicking on it and log in with the Microsoft credentials of the onedrive account you want to add. If successful, a blank page is shown. Copy the full address of this page and past it (right mouse and paste) in the terminal as the response URL and press enter. If the link is accepted, the client immediately starts downloading your files. Step 17: You can close the terminal, restart the container and everything should be working from now on. Step 18: Repeat step 5-17 for every account you want to add. For some reason you need to select a different Icon URL for every new container you want to add. Edited December 17, 2022 by BVersluis Quote Link to comment
renegade5150001 Posted December 25, 2022 Share Posted December 25, 2022 Hey, thanks for this! I'm gonna give this a try. For the docker compose did you use the 'Docker Compose Manager' from Community applications>? thx Quote Link to comment
BVersluis Posted December 25, 2022 Author Share Posted December 25, 2022 Hey, yes, that's the one. Succes. Quote Link to comment
PeterPan Posted January 15 Share Posted January 15 (edited) Hi! in step 16 it downloads a file which is empty if I open it with a text editor. I login and it just wants to download a file... any ideas? Edit: Safari issue Edited January 15 by PeterPan Quote Link to comment
Bluppylein Posted January 17 Share Posted January 17 Thanks this i have search :). Why it give not one drive app directly on unRAID? 🙂 1 Quote Link to comment
PeterPan Posted January 22 Share Posted January 22 The great CA Maintainer BVersluis just uploaded a great working application. Just search in the shop 🙂 1 Quote Link to comment
deepbellybutton Posted January 23 Share Posted January 23 I would love to see this working with bpozdena/OneDriveGUI web interface as well. Any plans for that or a quick rundown on how to do it now if not? Great tool and thanks! John Quote Link to comment
BVersluis Posted Tuesday at 07:25 PM Author Share Posted Tuesday at 07:25 PM 22 hours ago, deepbellybutton said: I would love to see this working with bpozdena/OneDriveGUI web interface as well. Any plans for that or a quick rundown on how to do it now if not? Great tool and thanks! John No, sorry I have no plans for that at the moment... Quote Link to comment
Guo Jiacheng Posted Wednesday at 03:10 AM Share Posted Wednesday at 03:10 AM How can I change the new created file permission to 755? Right now, to share between users, I have repeatedly change new synced file permission to 755. The default permission is 500 ? Quote Link to comment
isaacgrant85 Posted Wednesday at 03:47 AM Share Posted Wednesday at 03:47 AM Currently having what I expect is the same issue. Look forward to hearing the answer! Quote Link to comment
BVersluis Posted Thursday at 08:01 PM Author Share Posted Thursday at 08:01 PM (edited) On 1/25/2023 at 4:10 AM, Guo Jiacheng said: How can I change the new created file permission to 755? Right now, to share between users, I have repeatedly change new synced file permission to 755. The default permission is 500 ? Yes, default is 500. Every Unraid user with his/her own UID has only access to his/her files Onedrive by default. If one Unraid user has multiple Onedrive accounts, you could use the same UID and have access to all files, but by default only the owner of the files (container) has access. To my knowledge - and my Docker knowledge is very limited - there is no easy way to change this in docker (in combination with mounted volumes). Depending on your needs, one 'solution' could be to create an Unraid user (UID) for all Onedrive accounts you want to share files between and use this account to access your files. Perhaps this might be of help. Edited Thursday at 08:03 PM by BVersluis Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.