File tree Expand file tree Collapse file tree 5 files changed +18
-19
lines changed
Expand file tree Collapse file tree 5 files changed +18
-19
lines changed Original file line number Diff line number Diff line change 1- # System Files
1+ # Exclude system files
22.DS_Store
33
4- # NPM Modules
4+ # Exclude Node modules
55node_modules /
66
7- # Environment Variables File
7+ # Exclude the environment variables
88.env
Original file line number Diff line number Diff line change 1- # User lightwight base image
1+ # Use a lightweight base image
22FROM node:20.9.0-alpine
33
44# Install Git
55RUN apk add --no-cache git
66
7- # Define work directory
7+ # Define the work directory
88WORKDIR /usr/src/app
99
10- # Copy package definition
10+ # Copy the package definition
1111COPY package*.json ./
1212
13- # Install dependencies
13+ # Install all dependencies
1414RUN npm install
1515
16- # Copy source files
16+ # Copy the source files
1717COPY . .
1818
19- # Start backup script
19+ # Start the backup script
2020CMD ["node" , "index.js" ]
Original file line number Diff line number Diff line change 1+ # Include the environment variables
12include ./.env
23
4+ # Run the Docker image and attach the environment file
35docker_run : docker_build
46 docker run --rm --name github-backup -v $(FOLDER ) :/usr/src/backup --env-file ./.env github-backup
57
8+ # Build the Docker image
69docker_build : docker_cleanup
710 docker build -t github-backup .
811
12+ # Cleanup Docker
913docker_cleanup :
1014 docker stop github-backup || true
1115 docker rm github-backup || true
Original file line number Diff line number Diff line change @@ -4,17 +4,11 @@ Creates a local backup of your GitHub data.
44
55## In Scope
66
7- - ✅ Repositories: cloned, public and private ones, images from markdown files
7+ - ✅ Repositories: cloned, public and private ones
88- ✅ Releases: including images and assets
99- ✅ Issues: including comments and images, open and closed ones
10- - ✅ User: details and starred repositories
11-
12- ## In Progress
13- - ⏳ Repositories: attachments from markdown files
14- - ⏳ Releases: attachments
15- - ⏳ Issues: attachments
16- - ⏳ Projects v1: related to repositories, users and organizations
17- - ⏳ Projects v2
10+ - ✅ Markdown: images, uploaded to the GitHub editor
11+ - ✅ User: user details and starred repositories
1812
1913## Usage
2014
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ const retryDelayRateLimit = 6 * 60
1313const retryDelayOthers = 6
1414
1515const { USERNAME , TOKEN } = process . env
16- const folder = '/usr/src/backup'
16+ const folder = '/usr/src/backup' // Will be deleted entirely!
1717
1818function delay ( seconds ) {
1919 return new Promise ( resolve => {
@@ -281,4 +281,5 @@ async function backup() {
281281 }
282282}
283283
284+ // Run the backup
284285backup ( )
You can’t perform that action at this time.
0 commit comments