Access Your Google Drive Folder via Heroku using Rclone and Google Service Account (SA)
- An Google Service Account with Google Drive API activated. Go here for reference.
- Make sure to include your SA address to your drive folder/Team Drive directly or via Google Groups
- Common sense
- Heroku account
- Pull or download this repo and push or upload to your private repo. (So you won't expose your SA)
- Copy SA .json content to acc.json file, and visit URL below.
- Then go to https://heroku.com/deploy?template=https://github.com/yourusername/yourprivatereponame
- Notice the
yourusernameandyourprivatereponameon url above, use your own. - Heroku can detect your private repo if you have active login on the same browser.
- Insert your app name, server location and Google Drive folder/Team Drive ID, make sure your .json have access to your folder/Team Drive.
- Wait for build and done.
- Setup a basic http auth for single user with adding
--userand--passflags to this file - Example:
--user devsdocs_u --pass devsdocs_p - Go here if you want to setup multiple user for your app.
- To change folder, just replace your folder ID in your Heroku App Config Vars and restart your dyno(s)
- Keep your free heroku account live with Cron-Job