You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,15 @@
1
1
# gobackup-github
2
-
[](https://github.com/slashtechno/gobackup-github/actions/workflows/go-build.yml)[](https://github.com/slashtechno/gobackup-github/actions/workflows/docker.yml)
3
-
Go program that utilizes the Github API to backup all a user's repositories, including repositories that have been stored. Multiple users can be backed up, including all members of a GitHub organization.
Go program that utilizes the Github API to backup a user's repositories, including repositories that have been starred. Multiple users can be backed up, including all members of a GitHub organization.
4
5

5
6
6
7
### Setup and Usage
7
8
1. Create a Github personal access token with the following scopes: `read:user, repo`
8
9
2. Either download a binary for your system from releases, or build the program and add it to your PATH with `go install`.
9
10
3. Copy `config.example.yaml` to `config.yaml` and fill in the fields.
10
11
- In addition, command line flags can be used to specify configuration options. Use the `help` command or the `--help` flag for more information.
12
+
- It is recommended to read through the `config.example.yaml` file to understand the configuration options.
11
13
4. Run the program with `gobackup-github backup`
12
14
- To perform a rolling backup, run `gobackup-github backup continuous`
13
15
@@ -20,5 +22,5 @@ To create a container that runs on boot and performs a rolling backup every 24 h
20
22
#### Docker Compose
21
23
You can also just run `docker compose up -d` to start the container with automatic restarts, assuming you have a `docker-compose.yml` file in the same directory as the `config.yaml` file. You can also edit the `docker-compose.yml` file to change configuration and to manage the rolling backup, if needed.
22
24
23
-
### Why?
24
-
I wanted a simple way to backup my Github repositories. I also wanted to learn Go and APIs. Thus, I began this project in 2022 as a way to create my first Go project, use the Github API, and make a utility to backup Github repositories.
backupCmd.PersistentFlags().String("run-type", "", "`Type of backup: clone` (clone the repositories), `fetch` (fetch the repositories and write to output if it ends in .json or `repositories.json` in output), `dry-run` (fetch the repositories and print the output). Default is `clone`")
Copy file name to clipboardExpand all lines: config.example.yaml
+6-2Lines changed: 6 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,11 @@ log-level: info
12
12
output: backup
13
13
# GitHub token with read access to the repositories and user
14
14
token: ""
15
-
# List of usernames to fetch. If neither usernames or in-org is set, it will fetch the token owner's repositories
15
+
# List of usernames to fetch. If neither usernames or in-org are set (or an empty string is passed), the authenticated user will (also) be fetched. Fetching the authenticated user also fetches repositories shared with the authenticated user.
16
16
usernames: []
17
17
# `clone` (clone the repositories), `fetch` (fetch the repositories and write to output if it ends in .json or `repositories.json` in output), `dry-run` (fetch the repositories and print the output)
18
-
run-type: clone
18
+
run-type: clone
19
+
# Ntfy URL to optionally send a notification to upon completion. If you don't want to use ntfy.sh, you can use a self-hosted instance of ntfy.
20
+
ntfy-url: ""
21
+
# Submodule depth to include. If set to 0 (default), submodules will not be initialized.
0 commit comments