I have been introduced a couple ways to display OneDrive’s content, either using Cloudflare workers or using Heroku. You can find them from my previous posts:
- OneManager – Deploy a free OneDrive List App using Heroku and Cloudflare
- Fast OneDrive Index – A Serverless OneDrive Index Setup
Also I recorded videos to show the whole process:
Deploying OneManager to Heroku is simple and easy but there are two issues which will cause the OneManager will be down.
- New accounts receive 550 free dyno hours and you can verify your identity with a credit card for an additional 450 hours.
- The app will be put into idle mode automatically, after 30 minutes of inactivity. It will take 1-2 minutes to wake it up when it receives access activity.
To resolve those two issues, I developed following three steps to bypass them.
Demo site: https://myod.51sec.eu.org
Deploy Two OneManager into Two Different Heroku Accounts
Lets say, you created two Heroku accounts, and deployed two OneManager apps into them one by one with the process described in my previous post:
You got following two OneManager apps:
They are exactly same except the app name and app url is different. Both apps have added same OneDrive disk in it.
The logic behind it to use two OneManager apps which not get us exceeding the 550 hours / month limits if we only activate one app every day and keep another one in idle.
Create a Cloudflare Workers to Rotate Access to Those Two Apps
Now we need to tell CloudFlare Workers to only point to one app at one day and point to anther app at another day.
Of course, do not forget to set up a DNS A record (myod.51sec.eu.org) and workers route to it.
Create two CRON Job from www.easycron.com
Since Heroku will put your APP in idle mode once there is no activity for 30 minutes, we will just need to create a CRON job to get the site every 30 minutes at www.easycron.com site. We will need to create two CRON jobs, one for odd number days to get myod1.herokuapp.com, and second one for even number days to get my od2.herokuapp.com.
Done, that is all you will need to set up a OneManager at Heroku, which will make your site up all the time to end user when they using your Cloudflare dns to access your site.