Git Product home page Git Product logo

g2s3's Introduction

G2S3

logo

G2S3 is a solution to regularly back up your Google data by copying it over to S3.

This is work in progress.

What's working:

  • It can copy a single Google Drive folder with all files in it (non-recursively) to S3
  • CDK deploys AWS Batch jobs, necessary compute environment, queues, SNS topics, subscriptions, etc.

What's not working yet:

  • Recursive copy of a Google Drive folder, or entire Google Drive into S3.

There's also an accompanying blog post:

"Quick" Start Guide

  1. In Google Cloud Platform (GCP):

    1. create a new project (e.g. "g2s3")
    2. enable the Google Drive API
    3. create a OAuth 2.0 consent screen.
    4. Download credentials (TODO: add how)
  2. Build and run the retrieve-google-tokens binary (TODO: add instructions)

  3. In your AWS account

    1. "Store a new secret" in AWS Secrets Manager ("Other type of secret")
    2. Add CLIENT_ID, CLIENT_SECRET, and REFRESH_TOKEN into new secret as key/value pairs
  4. Choose one of the following two options:

    • Option 1: Using a personal fork and your own Docker image:

      1. On GitHub, fork this repository, enable GitHub Actions in your forked repository, and wait for the Action to successfully complete.

      2. In your terminal, run:

        git clone [email protected]:<GITHUB_USER>/g2s3.git
        cd g2s3
        
    • Option 2: Using petergtz repo and the associated Docker image:

      1. In your terminal, run:

        git clone https://github.com/petergtz/g2s3.git
        cd g2s3
        
  5. To configure your backup setup:

    1. In your terminal, run:

      cp cdk/bin/deployment-config.json.example cdk/bin/deployment-config.json
      
    2. Fill in proper values in cdk/bin/deployment-config.json (hopefully self-explanatory)

  6. Assuming aws CLI is installed and configured correctly, run:

    ./scripts/cdk-deploy.sh
    

Architecture Diagram

Architecture

Components

G2S3 consists of three main components:

  • a binary built with Rust to copy files from Google Drive to S3, called back-up-drive-folder
  • a Docker image built from a Dockerfile to package back-up-drive-folder, available as GitHub Package g2s3/g2s3.
  • a CDK stack to deploy everything as AWS Batch job to regularly invoke back-up-drive-folder

CLI back-up-drive-folder

This CLI can be invoked locally for testing, or from the cloud when part of a regular backup. For instructions, on how to use it:

$ back-up-drive-folder --help

Docker Image

The Docker image (built via this GitHub Action) can be used directly using:

$ docker pull ghcr.io/petergtz/g2s3/g2s3:latest

Or it can be built using:

$ ./scripts/build-release.sh && ./scripts/build-container.sh

CDK Stack

The CDK stack can be found in ./cdk/lib.

g2s3's People

Contributors

jfatta avatar petergtz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

g2s3's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.