Skip to content

Commit

Permalink
docs: Add documentation for daemon
Browse files Browse the repository at this point in the history
- update README.md
- go mod tidy
  • Loading branch information
LeslieLeung committed Nov 9, 2023
1 parent 91bc13f commit 3d9e356
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 9 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ REpository ArchivER(REAPER) is a tool to archive repositories from any Git serve
- [Usage](#usage)
- [rip](#rip)
- [run](#run)
- [daemon](#daemon)
- [Configuration](#configuration)
- [Storage](#storage)
- [Run as docker container](#run-as-docker-container)
Expand Down Expand Up @@ -65,6 +66,16 @@ reaper run

Combined with cron, you can archive repositories periodically.

### daemon

`daemon` runs REAPER as a daemon. It will archive all repositories defined in configuration periodically.

```bash
reaper daemon
# You might want to run it with something like nohup
nohup reaper daemon &
```

## Configuration

For configuration, you can checkout this [example](config/example.config.yaml).
Expand Down Expand Up @@ -100,6 +111,10 @@ For example compose file, see [docker-compose.yml](docker-compose.yml).
docker compose up -d
```

## FAQ

See [FAQ](https://github.com/LeslieLeung/reaper/wiki/FAQ).

## Stargazers over time

[![Stargazers over time](https://starchart.cc/LeslieLeung/reaper.svg)](https://starchart.cc/LeslieLeung/reaper)
Expand Down
15 changes: 15 additions & 0 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ REpository ArchivER(REAPER)是一个用于从任何Git服务器归档 Git
- [使用方法](#使用方法)
- [rip](#rip)
- [run](#run)
- [daemon](#daemon)
- [配置](#配置)
- [存储](#存储)
- [使用 Docker 运行](#使用-docker-运行)
Expand Down Expand Up @@ -65,6 +66,16 @@ reaper run

结合cron,你可以定期归档 Git 仓库。

### daemon

`daemon`命令会启动一个守护进程,它会在后台运行,归档在配置中定义的所有 Git 仓库。

```bash
reaper daemon
# 使用 nohup 后台运行
nohup reaper daemon &
```

## 配置

有关配置,你可以查看此[示例](config/example.config.yaml)
Expand Down Expand Up @@ -97,9 +108,13 @@ docker run --rm \
示例Compose配置,见 [docker-compose.yml](docker-compose.yml)

```bash
git clone https://github.com/leslieleung/reaper.git
docker compose up -d
```

## 常见问题

[FAQ](https://github.com/LeslieLeung/reaper/wiki/FAQ)

## Stargazers over time

Expand Down
8 changes: 5 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ services:
- TZ=Asia/Shanghai
volumes:
# config file path, modify it to yours
- ${pwd}/config/example.config.syaml:/config.yaml
- ${pwd}/config/example.config.yaml:/config.yaml
# data path, to store downloaded repo, modify it to yours
# the in-container path need to be the same as defined in config file
- ${pwd}/repo:/repo
# defaultly archives all repositories defined in configuration.
# by default archives all repositories defined in configuration.
command: ["run"]
# or just archives a single repository defined in configuration.
# command: ["rip", "reaper"]
# command: ["rip", "reaper"]
# run as daemon
# command: ["daemon"]
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ module github.com/leslieleung/reaper
go 1.21

require (
github.com/go-co-op/gocron v1.35.3
github.com/go-git/go-git/v5 v5.10.0
github.com/google/uuid v1.4.0
github.com/gookit/color v1.5.4
github.com/mholt/archiver/v4 v4.0.0-alpha.8
github.com/minio/minio-go/v7 v7.0.63
github.com/spf13/cobra v1.7.0
github.com/spf13/viper v1.17.0
)
Expand All @@ -27,7 +29,6 @@ require (
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-co-op/gocron v1.35.3 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.5.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
Expand All @@ -44,7 +45,6 @@ require (
github.com/klauspost/pgzip v1.2.5 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/minio/md5-simd v1.1.2 // indirect
github.com/minio/minio-go/v7 v7.0.63 // indirect
github.com/minio/sha256-simd v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
Expand All @@ -66,7 +66,7 @@ require (
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/therootcompany/xz v1.0.1 // indirect
github.com/ulikunitz/xz v0.5.10 // indirect
github.com/ulikunitz/xz v0.5.11 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect
go.uber.org/atomic v1.9.0 // indirect
Expand Down
5 changes: 2 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o
github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
github.com/klauspost/compress v1.17.0 h1:Rnbp4K9EjcDuVuHtd0dgA4qNuv9yKDYKK1ulpJwgrqM=
github.com/klauspost/compress v1.17.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
github.com/klauspost/cpuid v1.2.0 h1:NMpwD2G9JSFOE1/TJjGSo5zG7Yb2bTe7eq1jH+irmeE=
github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg=
Expand Down Expand Up @@ -310,8 +309,8 @@ github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSW
github.com/therootcompany/xz v1.0.1 h1:CmOtsn1CbtmyYiusbfmhmkpAAETj0wBIH6kCYaX+xzw=
github.com/therootcompany/xz v1.0.1/go.mod h1:3K3UH1yCKgBneZYhuQUvJ9HPD19UEXEI0BWbMn8qNMY=
github.com/ulikunitz/xz v0.5.6/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8=
github.com/ulikunitz/xz v0.5.10 h1:t92gobL9l3HE202wg3rlk19F6X+JOxl9BBrCCMYEYd8=
github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8=
github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM=
github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw=
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 h1:QldyIu/L63oPpyvQmHgvgickp1Yw510KJOqX7H24mg8=
Expand Down

0 comments on commit 3d9e356

Please sign in to comment.