I have a Microsoft 365 Family subscription where I’m the only user.
With 1TB of OneDrive space per account, that leaves me 5TB of free space sitting around.
The common way to use it is to mount the drive on a computer with rclone
, acting as a network drive.
But instead of a simple mount, I can serve it over HTTP or expose it as an S3 server, then publish it through a VPS to share files publicly.
This is a fairly simple Docker Compose example that deploys it alongside Ferron as a reverse proxy on a VPS.
There is no hard requirement on VPS performance; it runs comfortably on a 1-core, 1GB memory instance.
Stats in my current setup:
NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
ferron-ferron-1 0.21% 29.02MiB / 954.9MiB 3.04% 119MB / 101MB 8.27MB / 5.49MB 8
ferron-rclone-dev-1 0.00% 32.11MiB / 954.9MiB 3.36% 91.4MB / 90.9MB 4.62MB / 49.2kB 7
ferron-rclone-dev-1 0.00% 26.78MiB / 954.9MiB 2.80% 661kB / 868kB 3.82MB / 132kB 7
Docker Compose
docker-compose.yml
services:
ferron:
image: ferronserver/ferron:3-alpine
ports:
- "80:80"
- "443:443"
volumes:
- ./conf.d:/etc/ferron/conf.d:ro
- ferron-acme:/var/cache/ferron-acme
restart: unless-stopped
networks:
- proxy
rclone:
image: rclone/rclone:latest
command: serve http onedrive:public --addr :8080 --read-only --disable-dir-list
volumes:
- ./rclone:/config/rclone
restart: unless-stopped
networks:
- proxy
volumes:
ferron-acme:
networks:
proxy:
Ferron Configuration
conf.d/rclone.conf
dev.example.com {
tls {
provider acme
challenge http-01
contact "[email protected]"
cache "/var/cache/ferron-acme"
}
}
dev.example.com {
#These two rewrites are adding index.html as default
rewrite r"^/$" "/index.html" { last }
rewrite r"^/((?:[^./]+/)*[^./]+)/?$" "/$1/index.html" { last }
proxy http://rclone:8080
}
Rclone Setup
You can check here
for the OneDrive setup guide.
You can access rclone by running docker exec -it rclone rclone config for configuration.
One thing to note: authenticate through your desktop browser, not on the VPS.
Choose No for this option: Use web browser to automatically authenticate rclone with remote?
In the rclone service in the docker compose:command: serve http onedrive:public --addr :8080 --read-only --disable-dir-list
Rename onedrive as your rclone profile name and public as the folder created in the Onedrive root.
After that, you can upload a file to /public in OneDrive (e.g. test.jpg) and access it from https://dev.example.com/test.jpg.
Just like that, you have a 1TB shared disk.
Bonus: Serve an S3 Endpoint
P.S. Other than rclone serve http
, you can also use rclone serve s3
to host an S3 server.
The command and environment in the rclone service would look like this:
...
command: serve s3 onedrive:public --addr :8080 --read-only
environment:
RCLONE_AUTH_KEY: '"${S3_KEY},${S3_SECRET}"'
...
Just pass S3_KEY and S3_SECRET as environment variables and change the command to serve s3, and you have an S3 interface.