A Warning about Google Drive Local File Permissions and Web Publishing
Google Drive is one of the loves of my online life. I store all my local files in my Google Drive Folder and that Google Drive Folder gets synced between here and the — out there — remote Google Drive. I do all my writing and publishing via Google Drive. I can find pretty much anything I want just by typing in a few keywords in Google Drive and I’m instantly presented with what I need. Life is good that way!
However, I just discovered a permissions problem when it comes to using a local instance of Google Drive and a remote, third-party, website publisher, and I’ll share with you now what I learned, and how I fixed it.
When I started making several new directories for new books on my Boles Books website — to make showroom space for the new “Best of…” book volumes — I noticed that the new directories I was creating on my web server were being denied access from a remote web browser — namely, me, trying to view the files and folders I created: “Permission Denied.” I also started noticing, with the conflation of 14 blogs into one — that previously viewable blog images were suddenly not appearing!
I finally figured out that if I copied/used files and folders that were already on my PairNet server, everything worked remotely as anticipated. If, however, I created local folders and files and uploaded them to my remote Pair web server, I could not read or see anything.
I had a file permissions problem and, after a lot of error troubleshooting and behavior duplication, I learned the culprit is how the remote Google Drive decides to handle the syncing of local files in the Google Drive Folder.
It appears that if you choose not to share everything in your online Google Drive with the public, Google changes all your Google Drive file permissions to 600 — User Only — and then mirrors that file status in your local Google Drive with every subsequent sync to keep them private, and unviewable, on the web.
That’s a fine security scheme if you’re a web newbie, but if you’re more experienced in online publishing, you would not guess that Google would mess with flagging and resetting file permissions on your local drive when you sync.
The solution around this problem comes along two pathways. The first is for you to change all your remotely published file permissions uploaded from your local Google Drive Folder to your non-Google server from 600 to 644 — Adding Group and World Read permissions. I can easily do that using the fine Mac program Transmit, but it is labor-intensive. I haven’t figured out a way for Google Drive not to mess with my local file permissions. I don’t want all my Google Drive set to 644 and world public viewing!
The second path is to just make sure you only deal with known good public files on your web server by copying folders and files and directories that are already published and putting them into a new place on the same server. That method will save you a lot of time by avoiding any hands on file changes. All the online files on my Pair server are mirrored in my local Google Drive Folder, so I need to be especially vigilant.
It took me a long time to figure out that Google Drive sync was changing the file permissions on my local Google Drive Folder. I didn’t notice the problem straight away because every day I publish a new Boles Blogs article, I save image files to my local Google Drive Folder — so they’ll later be saved in my online Google Drive, too — and I then upload those local Google Drive Folder files to my remote Pair Networks server.
I never had a problem with files refusing to load. I discovered that the Google Drive sync process is not instantaneous, and the time it takes for me to save a file and then upload it to Pair is brief. If I wait a few hours, or a day or two, then the local file permission is changed by Google Drive during the next sync — and the same image that was 644 when it was saved, has been transformed into a 600 file by Google Drive sync.
At first, I thought this was a Transmit FTP file uploading problem — but I’ve never had Transmit change any file flags without my explicit direction — and divining Google Drive was actually the problem was both a great relief and a little heartbreaking.