Media VM
Media is synced via Dropbox, in order to allow graphics, audio, and other media artists to contribute their work without going through git.
In order to have media updates automatically propogate all the way up to the CDN, a VM with a cron task needs to be setup:
- Locally install rclone. Not on the server, but on a dev machine
- Use it to create the authenticated dropbox remote
- Same for cloud storage (though no need for authentication - that will happen via automatic credentials)
- Create the bucket like all the others (and setup w/ fastly, etc.)
- Create a small Compute Engine instance (i.e. e2 micro) and give its service account owner access to the bucket
- Install rclone on that instance
- Copy the local config file (which will contain the config keys) to the remote VM (run
rclone config file
on the vm to get path) - Write a small shell script and chmod u+x it with the following, replacing the remote and bucket names as needed:
#!/bin/sh
rclone sync dropbox:/ji-cloud-media media-storage:/ji-cloud-media-origin-eu-001/
- Setup a cron task to run rclone and sync at some interval. For example, every 2 minutes:
*/2 * * * * /home/david/sync.sh