OPNsense Forum

English Forums => Tutorials and FAQs => Topic started by: rcrules on March 04, 2019, 09:29:17 pm

Title: Google Drive Backup
Post by: rcrules on March 04, 2019, 09:29:17 pm
I just started using OPNsense a couple of days ago.  NICE!

I was trying to configure automatic backups on Google Drive.  I couldn't find current directions so I muddled through using https://wiki.opnsense.org/manual/how-tos/cloud_backup.html (https://wiki.opnsense.org/manual/how-tos/cloud_backup.html) and the trial and error method.

I have some steps that might be helpful.  I typed the steps in OneNote.  I tried printing it in pdf form but it's too big to attach.  I guess I will post images of the steps.  Not ideal, sorry.

If the steps don't work, I'm afraid I won't be much help because I am new to this myself.  :)

Page 1

Link:
https://wiki.opnsense.org/manual/how-tos/cloud_backup.html (https://wiki.opnsense.org/manual/how-tos/cloud_backup.html)
Title: Re: Google Drive Backup
Post by: rcrules on March 04, 2019, 09:30:50 pm
Page 2

Links:
https://accounts.google.com/ (https://accounts.google.com/)
https://console.developers.google.com/project (https://console.developers.google.com/project)
Title: Re: Google Drive Backup
Post by: rcrules on March 04, 2019, 09:31:49 pm
Page 3

Links:
https://console.developers.google.com/apis/library (https://console.developers.google.com/apis/library)
Title: Re: Google Drive Backup
Post by: rcrules on March 04, 2019, 09:32:51 pm
Page 4
Title: Re: Google Drive Backup
Post by: rcrules on March 04, 2019, 09:34:19 pm
Page 5
Title: Re: Google Drive Backup
Post by: rcrules on March 04, 2019, 09:35:15 pm
Page 6
Title: Re: Google Drive Backup
Post by: rcrules on March 04, 2019, 09:36:11 pm
Page 7

Link:
https://drive.google.com (https://drive.google.com)
Title: Re: Google Drive Backup
Post by: rcrules on March 04, 2019, 09:37:17 pm
Page 8
Title: Re: Google Drive Backup
Post by: rcrules on March 04, 2019, 09:38:14 pm
Page 9
Title: Re: Google Drive Backup
Post by: rcrules on March 04, 2019, 09:39:18 pm
Page 10

Link:
https://www.dictionary.com/browse/party (https://www.dictionary.com/browse/party)
Title: Re: Google Drive Backup
Post by: fabian on March 04, 2019, 10:17:50 pm
You can update the official docs here if you like:

https://github.com/opnsense/docs/blob/master/source/manual/how-tos/cloud_backup.rst
Title: Re: Google Drive Backup
Post by: kapara on April 23, 2019, 03:27:16 am
This is crazy!  I cannot beleive how complicated this is.  The directions on the site skip so many screens that one has no way of understanding this.  I was hoping this would be an easy option but it looks like people are better off going manual backup.  SI spent over 30 minutes trying to do this with no luck.  Hopefully, someone will update the instructions or at least provide a video tutorial.  I dont see any documentation on how to complete or what to choose from the screens below!
Title: Re: Google Drive Backup
Post by: kapara on April 23, 2019, 03:38:57 am
So created a p12 and defined as webserver and Project Editor.  Created folder and shared to email but no dice!
Title: Re: Google Drive Backup
Post by: ajayjohn on July 05, 2019, 07:41:39 pm
Thanks a ton @rcrules! The effort made by folks like you make it significantly easier for novices like me, to get the best out of this awesome platform.
Title: Re: Google Drive Backup
Post by: korniza on December 07, 2019, 05:53:31 pm
Thx man!
Today was a nightmare ! your guide is clear !  :) :)
Title: Re: Google Drive Backup
Post by: jeuler on February 09, 2020, 10:38:49 am
@rcrules: Thank you a lot for posting the detailled tutorial. I followed it step for step and was able to succesfully set up an automated backup for all my OPNsenses.
Title: Re: Google Drive Backup
Post by: rheemix on July 03, 2020, 08:22:02 pm
Thank you for putting this together. This guide helped me set up Google Drive backup.
Title: Re: Google Drive Backup
Post by: nerd154 on July 17, 2020, 02:06:45 pm
Hey, thank you very much for the information! I had the same problem and didnt know what to do! You did an amazing job!
Title: Re: Google Drive Backup
Post by: Greelan on November 11, 2020, 06:28:50 am
One clarification I believe for Page 9. The password that should be entered in the OPNsense backups configuration page should be a strong password for encryption of the backups, not the default "notasecret" password that applies to the p12 key. Given that the p12 key password is a standard password used by Google for all keys generated, I believe OPNsense itself supplies that password when using the key.
Title: Re: Google Drive Backup
Post by: axel2078 on December 11, 2020, 02:28:33 pm
rcrules, would you be able to update the official docs (see link provided above) so that others maybe be able to do this easier in the future?
Title: Re: Google Drive Backup
Post by: Greelan on December 26, 2020, 03:35:59 am
I have prepared an updated how-to on GitHub and submitted a PR for it. Hopefully that will assist people (assuming it is accepted)
Title: Re: Google Drive Backup
Post by: Greelan on January 20, 2021, 09:38:35 pm
The updated how-to is now available: https://docs.opnsense.org/manual/how-tos/cloud_backup.html?#setup-google-api-usage
Title: Re: Google Drive Backup
Post by: baqwas on January 28, 2021, 03:28:54 am
Hello @Greelan,

Cannot thank you enough for your efforts that helped me (a basic newbie) get an extra level backup reassurance.

Kind regards.
Title: Re: Google Drive Backup
Post by: Greelan on January 28, 2021, 03:34:49 am
Title: Re: Google Drive Backup
Post by: vijvis on July 05, 2021, 01:35:37 pm
Worked perfectly. Thanks very much for the detailed steps with screen shots.
Title: Re: Google Drive Backup
Post by: cookiemonster on October 28, 2021, 03:19:51 pm
This is a great help. It was desperately needed, than you.
I did follow it and am up and running, just one point. Maybe things changed since the guide was written but I was stuck in :
"3. Set up the account in OPNsense"
Email Address - enter the email address of the service account you created

It took me some time to realize it would only work if I used the user ID instead of the email address in this field in OPN. If I used the email I would get failure when finishing and pushing the "Setup/Test Google Drive" button.
Title: Re: Google Drive Backup
Post by: Greelan on October 28, 2021, 09:11:45 pm
Can you explain your comment further?
Title: Re: Google Drive Backup
Post by: cookiemonster on October 28, 2021, 10:00:14 pm
Of course.
According to this helpful post that is now committed to docs, when setting up the directory in OPN, we enter the email address. I got an error every time I did and pressed Test.
I changed from email i.e. user@opnsense-backups-888-iam-gserviceaccount.com as a value in the email field to it's Unique ID value in the developer console. Only then it would be accepted.

(https://i.ibb.co/Q83m5s7/gdrive.png) (https://ibb.co/FsL7PGk)

It is perfectly possible there's something else that I needed to do to accept the email as per the instructions but I have gone over the steps multiple times.
Title: Re: Google Drive Backup
Post by: Greelan on October 28, 2021, 10:08:35 pm
Thanks for clarifying. That’s interesting. My backup is still happily working with the service account email address. That’s the first I have heard of the email address causing an issue
Title: Re: Google Drive Backup
Post by: cookiemonster on October 28, 2021, 10:33:30 pm
Yes I did find it odd. It probably works as-written and is something on my side. I thought it would be good to share in case something changed google-side for new setups or a setting somewhere causes this and is not quite obvious.
Title: Re: Google Drive Backup
Post by: dp on January 07, 2022, 04:31:21 am
So actually to clarify there are two entries that can be put in the email and it will work. One is the Service Account Email and the other is the Unique ID. Both of those will work. However the email address of the account that owns the drive will not. I wonder if cookiemonster was trying that address instead of the service account address?

Any chance the wording for this field and especially the help tag can get updated to reflect this? Maybe have the field say "Identity" and then have the help say something like: "Enter either the Unique ID or the Service Account Email address. Do not use the G-mail address that owns the drive."

It wasn't until I found this thread and looked back over the instructions that I found my mistake.
Title: Re: Google Drive Backup
Post by: Greelan on January 07, 2022, 05:35:33 am
Anyone can submit a PR to propose adjustments: https://github.com/opnsense/core/blob/6de63630efb3c8914fcb59693ad973bdb54f4578/src/opnsense/mvc/app/library/OPNsense/Backup/GDrive.php

 :)
Title: Re: Google Drive Backup
Post by: cookiemonster on January 10, 2022, 01:14:57 pm
I am positive I was attempting to use the email of the service account, not the account owner.
It might have been a temporary problem at the time, so this might be a non-issue.
Title: Re: Google Drive Backup
Post by: crashdox on October 10, 2022, 09:59:51 pm
FWIW, I attempted this using a Google *Shared* drive (*not* a drive under My Drives that is shared) and repeatedly received FileNotFound errors.  It DID work when I created a "normal" folder under My Drive & shared it.  Maybe something stupid I did, but I'm leaving it there for now since it's working.

(the folder in the Shared drives isn't shown here, but that is where it was).