Skip to content

devprothon/cobble-backup

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cobble-backup 💾

This project creates a backup of a MySQL database and uploads it to Google Cloud Storage. It can be run periodically to back up your database in .sql format. After creating the backup, it uploads the file to Google Cloud Storage and deletes the local copy.

Features 🚀

  • Backups a MySQL database.
  • Uploads the backup file to Google Cloud Storage.
  • Deletes the local backup file after uploading it.
  • Configurable through environment variables in a .env file.

Requirements 📋

  • Deno (This project is written with Deno.js)
  • A Google Cloud Storage account and service account key
  • A MySQL database

Setup ⚙️

1. Google Cloud Storage API Keys 🔑

  • Go to the Google Cloud Console and create a new project.
  • Enable the Google Cloud Storage API.
  • Create an API key and download it as a JSON file. Save this file as gcs_key.json in your project.

2. Set Up Environment Variables 🌱

After setting up your Google Cloud API, you need to configure the environment variables.

  1. In the root directory of your project, rename the .env.example file as .env.
  2. Edit the following environment variables to the .env file, replacing the placeholders with your actual values:
# MySQL
DB_HOST=artren.ddns.net:3306
DB_USER=artren
DB_PASSWORD=verysecretpassword
DB_NAME=quiltauth

# Google Cloud Storage
GCS_KEY_FILE=./serviceKey.json
GCS_PROJECT_ID=quilt-anarchy
GCS_BUCKET_NAME=quilt-auth

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%