Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lowitea/gitlobster
π¦ A tool for full cloning all available repositories from a GitLab instance.
https://github.com/lowitea/gitlobster
gitlab hacktoberfest
Last synced: 2 months ago
JSON representation
π¦ A tool for full cloning all available repositories from a GitLab instance.
- Host: GitHub
- URL: https://github.com/lowitea/gitlobster
- Owner: lowitea
- License: apache-2.0
- Created: 2022-09-20T20:41:10.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-04-08T09:04:47.000Z (9 months ago)
- Last Synced: 2024-04-08T10:27:49.443Z (9 months ago)
- Topics: gitlab, hacktoberfest
- Language: Rust
- Homepage:
- Size: 471 KB
- Stars: 30
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.RU.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# Gitlobster
**_ΠΠ½ΡΡΡΡΠΌΠ΅Π½Ρ ΠΏΠΎΠ»Π½ΠΎΠ³ΠΎ ΠΊΠΎΠΏΠΈΡΠΎΠ²Π°Π½ΠΈΡ Π²ΡΠ΅Ρ Π΄ΠΎΡΡΡΠΏΠ½ΡΡ ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠ΅Π² Ρ ΡΠ΅ΡΠ²Π΅ΡΠ° GitLab._**
[![Crates.io](https://img.shields.io/crates/v/gitlobster?style=for-the-badge)](https://crates.io/crates/gitlobster)
[![Docker Image Version (latest semver)](https://img.shields.io/docker/v/lowitea/gitlobster?sort=semver&label=docker&style=for-the-badge)](https://hub.docker.com/r/lowitea/gitlobster)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/lowitea/gitlobster/integration_test.yml?branch=master&label=integration%20tests&style=for-the-badge)](https://github.com/lowitea/gitlobster/actions)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/lowitea/gitlobster/test.yml?branch=master&label=unit%20tests&style=for-the-badge)](https://github.com/lowitea/gitlobster/actions)[EN](README.md) | RU
## ΠΠ»ΡΡΠ΅Π²ΡΠ΅ ΡΡΠ½ΠΊΡΠΈΠΈ
- ΠΠ»ΠΎΠ½ΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ Π²ΡΠ΅Ρ Π΄ΠΎΡΡΡΠΏΠ½ΡΡ ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠ΅Π²
- ΠΠ»ΠΎΠ½ΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ Π²ΡΠ΅Ρ Π²Π΅ΡΠΎΠΊ ΠΊΠ°ΠΆΠ΄ΠΎΠ³ΠΎ ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΡ
- ΠΠ°Π³ΡΡΠ·ΠΊΠ° Π²ΡΠ΅Ρ ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠ΅Π² Π² Π΄ΡΡΠ³ΠΎΠΉ ΡΠ΅ΡΠ²Π΅Ρ GitLab (ΠΈΠ»ΠΈ Π² Π΄ΡΡΠ³ΡΡ Π³ΡΡΠΏΠΏΡ)
- ΠΠΎΠ΄Π΄Π΅ΡΠΆΠΊΠ° ΡΠΊΠ°ΡΠΈΠ²Π°Π½ΠΈΡ ΡΠΎΠ»ΡΠΊΠΎ ΠΎΠ±Π½ΠΎΠ²Π»Π΅Π½ΠΈΠΉ (Π²ΠΊΠ»ΡΡΠ°Ρ ΡΠΊΠ°ΡΠΈΠ²Π°Π½ΠΈΠ΅ Π½ΠΎΠ²ΡΡ ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠ΅Π²), ΠΏΠΎΡΠ»Π΅ ΠΏΠ΅ΡΠ²ΠΎΠ³ΠΎ ΠΏΠΎΠ»Π½ΠΎΠ³ΠΎ ΠΊΠ»ΠΎΠ½ΠΈΡΠΎΠ²Π°Π½ΠΈΡ
- Π‘ΠΎΡ ΡΠ°Π½Π΅Π½ΠΈΠ΅ ΠΈΠ΅ΡΠ°ΡΡ ΠΈΠΈ Π³ΡΡΠΏΠΏ
- ΠΠΎΠ΄Π΄Π΅ΡΠΆΠΊΠ° ΡΠΈΠ»ΡΡΡΠΎΠ² (Π² ΡΠΎΠΌ ΡΠΈΡΠ»Π΅ Π½Π° ΠΎΡΠ½ΠΎΠ²Π΅ ΡΠ΅Π³ΡΠ»ΡΡΠ½ΡΡ Π²ΡΡΠ°ΠΆΠ΅Π½ΠΈΠΉ) Π΄Π»Ρ ΠΊΠΎΠΏΠΈΡΠΎΠ²Π°Π½ΠΈΡ ΡΠΎΠ»ΡΠΊΠΎ Π½ΡΠΆΠ½ΡΡ ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠ΅Π²## Π£ΡΡΠ°Π½ΠΎΠ²ΠΊΠ°
### Docker
```shell
docker run --rm -it lowitea/gitlobster:latest --help
```### ΠΠ°ΠΏΡΡΠΊ ΠΏΡΠ΅Π΄Π²Π°ΡΠΈΡΠ΅Π»ΡΠ½ΠΎ ΡΠΎΠ±ΡΠ°Π½Π½ΡΡ Π±ΠΈΠ½Π°ΡΠ½ΡΡ ΡΠ°ΠΉΠ»ΠΎΠ²
1. Π‘ΠΊΠ°ΡΠ°ΡΡ ΡΠΎΠ±ΡΠ°Π½Π½ΡΠΉ Π°ΡΡ ΠΈΠ² Π½Π° [ΡΡΡΠ°Π½ΠΈΡΠ΅ ΡΠ΅Π»ΠΈΠ·ΠΎΠ²](https://github.com/lowitea/gitlobster/releases) ΠΏΠΎΠ΄ ΡΠ²ΠΎΡ ΠΏΠ»Π°ΡΡΠΎΡΠΌΡ.
2. Π Π°ΡΠΏΠ°ΠΊΠΎΠ²Π°ΡΡ Π°ΡΡ ΠΈΠ².
3. ΠΠ°ΠΏΡΡΡΠΈΡΡ ΡΠ΅ΡΠ΅Π· ΠΊΠΎΠ½ΡΠΎΠ»Ρ ΡΠ°ΠΉΠ» `gitlobster`.### Cargo
```shell
cargo install gitlobster
```### Π‘Π±ΠΎΡΠΊΠ° ΠΈΠ· ΠΈΡΡ ΠΎΠ΄Π½ΠΈΠΊΠΎΠ²
```shell
# ΠΊΠ»ΠΎΠ½ΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΡ
git clone https://github.com/lowitea/gitlobster.git
# ΠΏΠ΅ΡΠ΅Ρ ΠΎΠ΄ Π² ΡΠΊΠ°ΡΠ°Π½Π½ΡΡ Π΄ΠΈΡΠ΅ΠΊΡΠΎΡΠΈΡ
cd gitlobster
# ΡΠ±ΠΎΡΠΊΠ°
cargo build --release
# Π·Π°ΠΏΡΡΠΊ
./target/release/gitlobster --help
```_Π’Π°ΠΊΠΆΠ΅ Π΅ΡΡΡ Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎΡΡΡ Π·Π°ΠΏΡΡΡΠΈΡΡ Π² ΡΠ΅ΠΆΠΈΠΌΠ΅ ΡΠ°Π·ΡΠ°Π±ΠΎΡΠΊΠΈ, Π±Π΅Π· ΠΏΡΠ΅Π΄Π²Π°ΡΠΈΡΠ΅Π»ΡΠ½ΠΎΠΉ ΡΠ±ΠΎΡΠΊΠΈ._
```shell
# Π² Π΄ΠΈΡΠ΅ΠΊΡΠΎΡΠΈΠΈ Ρ ΠΏΡΠΎΠ΅ΠΊΡΠΎΠΌ
cargo run -- --help
```## ΠΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΠ΅
### GitLab ΡΠΎΠΊΠ΅Π½
ΠΠ»Ρ ΡΠ°Π±ΠΎΡΡ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΡ Π½ΡΠΆΠ½ΠΎ ΡΠ³Π΅Π½Π΅ΡΠΈΡΠΎΠ²Π°ΡΡ ΡΠΎΠΊΠ΅Π½ GitLab Ρ ΠΏΡΠ°Π²Π°ΠΌΠΈ Π½Π° ΡΡΠ΅Π½ΠΈΠ΅ API (`read_api`). ΠΡΠ»ΠΈ Π½Π΅ ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΠ΅ΡΡΡ ΠΊΠΎΠΏΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ ΠΏΠΎ SSH, ΡΠ°ΠΊΠΆΠ΅ Π½Π΅ΠΎΠ±Ρ ΠΎΠ΄ΠΈΠΌΡ ΠΏΡΠ°Π²Π° Π½Π° ΡΡΠ΅Π½ΠΈΠ΅ ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠ΅Π² (`read_repository`).
ΠΡΠ»ΠΈ ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠΈ ΠΊΠΎΠΏΠΈΡΡΡΡΡΡ Π²ΠΎ Π²ΡΠΎΡΠΎΠΉ GitLab, ΡΠΎ ΡΠΎΠΊΠ΅Π½ Π½ΡΠΆΠ΅Π½ ΡΠ°ΠΊΠΆΠ΅ ΠΈ Π΄Π»Ρ Π½Π΅Π³ΠΎ. ΠΠ΅ΠΎΠ±Ρ ΠΎΠ΄ΠΈΠΌΡ ΠΏΠΎΠ»Π½ΡΠ΅ ΠΏΡΠ°Π²Π° Π½Π° API (`api`). ΠΡΠ»ΠΈ Π½Π΅ ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΠ΅ΡΡΡ Π·Π°Π³ΡΡΠ·ΠΊΠ° ΠΏΠΎ SSH, ΡΠ°ΠΊΠΆΠ΅ Π½Π΅ΠΎΠ±Ρ ΠΎΠ΄ΠΈΠΌΡ ΠΏΡΠ°Π²Π° Π½Π° Π·Π°ΠΏΠΈΡΡ ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠ΅Π² (`write_repository`).
Π‘Π³Π΅Π½Π΅ΡΠΈΡΠΎΠ²Π°ΡΡ ΡΠΎΠΊΠ΅Π½Ρ ΠΌΠΎΠΆΠ½ΠΎ Π½Π° [ΡΡΡΠ°Π½ΠΈΡΠ΅ Π½Π°ΡΡΡΠΎΠ΅ΠΊ](https://gitlab.com/-/profile/personal_access_tokens).
### SSH
ΠΡΠ»ΠΈ ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΠ΅ΡΡΡ ΠΊΠΎΠΏΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ ΡΠ΅ΡΠ΅Π· SSH, ΡΠΎΠ³Π΄Π° ssh-ΠΊΠ»ΡΡΠΈ Π΄ΠΎΠ»ΠΆΠ½Ρ Π±ΡΡΡ [Π΄ΠΎΠ±Π°Π²Π»Π΅Π½Ρ](https://gitlab.com/-/profile/keys) Π² GitLab.
### ΠΠΎΠΏΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ Π²ΡΠ΅Ρ ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠ΅Π² Π² Π΄ΡΡΠ³ΠΎΠΉ GitLab
```shell
gitlobster \
--ft= \
--fu=https://gitlab.com/ \
--bt= \
--bu=https://gitlab.com/ \
--bg=gitlobster_test/upload
```### Π‘ΠΊΠ°ΡΠΈΠ²Π°Π½ΠΈΠ΅ Π²ΡΠ΅Ρ ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠ΅Π² Π² Π»ΠΎΠΊΠ°Π»ΡΠ½ΡΡ ΠΏΠ°ΠΏΠΊΡ
```shell
gitlobster \
--ft= \
--fu=https://gitlab.com/ \
-d out_directory
```_ΠΠΎΠ΄Π΄Π΅ΡΠΆΠΈΠ²Π°Π΅ΡΡΡ ΠΎΠ΄Π½ΠΎΠ²ΡΠ΅ΠΌΠ΅Π½Π½ΠΎΠ΅ ΡΠΎΡ ΡΠ°Π½Π΅Π½ΠΈΠ΅ ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠ΅Π² Π»ΠΎΠΊΠ°Π»ΡΠ½ΠΎ ΠΈ ΠΊΠΎΠΏΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ Π²ΠΎ Π²ΡΠΎΡΠΎΠΉ GitLab._
### ΠΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΠ΅ ΡΠΈΠ»ΡΡΡΠΎΠ² ΠΈ ΡΠΈΠ»ΡΡΡΡΡΡΠΈΡ ΡΠ»Π°Π³ΠΎΠ²
```shell
gitlobster \
--ft= \
--fu=https://gitlab.com/ \
--only-owned \
--include="^gitlobster_test/download/project_2" \
--include="^gitlobster_test/download/project_1" \
-d out_directory
```_Π’Π°ΠΊΠΆΠ΅ ΠΏΠΎΠ΄Π΄Π΅ΡΠΆΠΈΠ²Π°Π΅ΡΡΡ ΡΠ»Π°Π³ `--exclude` Π΄Π»Ρ ΡΠΊΠ°ΡΠΈΠ²Π°Π½ΠΈΡ Π²ΡΠ΅Ρ ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠ΅Π², ΠΊΡΠΎΠΌΠ΅ ΡΠ΅Ρ , ΡΡΠΎ ΠΏΠΎΠ΄ΠΏΠ°Π΄Π°ΡΡ ΠΏΠΎΠ΄ ΡΠ°Π±Π»ΠΎΠ½._
_ΠΠΎΠΆΠ½ΠΎ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΡ ΡΠΎΠ»ΡΠΊΠΎ ΠΎΠ΄ΠΈΠ½ ΠΈΠ· ΡΠ»Π°Π³ΠΎΠ² `--exclude` ΠΈΠ»ΠΈ `--include`. ΠΡΠΈ ΠΎΠ΄Π½ΠΎΠ²ΡΠ΅ΠΌΠ΅Π½Π½ΠΎΠΌ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΠΈ ΡΡΠΈΡ ΡΠ»Π°Π³ΠΎΠ² Π±ΡΠ΄Π΅Ρ Π²ΡΠ΄Π°Π½Π° ΡΠΎΠΎΡΠ²Π΅ΡΡΡΠ²ΡΡΡΠ°Ρ ΠΎΡΠΈΠ±ΠΊΠ°._
### ΠΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΠ΅ ΡΠ΅ΡΠ΅Π· Π΄ΠΎΠΊΠ΅Ρ
```shell
docker run --rm -it -v $(pwd)/out:/out lowitea/gitlobster:latest \
--ft= \
--fu=https://gitlab.com/ \
--include='^gitlobster_test/example' \
-d /out
```### ΠΡΠ·ΠΎΠ² help
```text
$ gitlobster --helpA tool for cloning all available repositories in a GitLab instance
Usage: gitlobster [OPTIONS] --fu --ft
Options:
--fu
The GitLab instance URL for fetch repositories (example: https://gitlab.local/) [env: GTLBSTR_FETCH_URL=]
--ft
Your personal GitLab token for fetch repositories [env: GTLBSTR_FETCH_TOKEN=]
--bu
The GitLab instance URL for backup repositories (example: https://backup-gitlab.local/) [env: GTLBSTR_BACKUP_URL=]
--bt
Your personal GitLab token for backup repositories [env: GTLBSTR_BACKUP_TOKEN=]
--bg
A target created group on backup GitLab for push repositories [env: GTLBSTR_BACKUP_GROUP=]
-i, --include
Include regexp patterns (cannot be used together with --exclude flag, may be repeated) [env: GTLBSTR_INCLUDE=]
-x, --exclude
Comma separated exclude regexp patterns (cannot be used together with --include flag, may be repeated) [env: GTLBSTR_EXCLUDE=]
-d, --dst
A destination local folder for save downloaded repositories [env: GTLBSTR_DST=]
-v, --verbose...
Verbose level (one or more, max four)
--dry-run
Show all projects to download
--objects-per-page
Low-level option, how many projects can fetch in one request [env: GTLBSTR_OBJECTS_PER_PAGE=]
--limit
Maximum projects to download [env: GTLBSTR_LIMIT=]
--concurrency-limit
Limit concurrency download [env: GTLBSTR_CONCURRENCY_LIMIT=] [default: 21]
--only-owned
Download projects explicitly owned by user [env: GTLBSTR_ONLY_OWNED=]
--only-membership
Download only user's projects [env: GTLBSTR_ONLY_MEMBERSHIP=]
--download-ssh
Enable download by ssh instead of http. An authorized ssh key is required [env: GTLBSTR_DOWNLOAD_SSH=]
--upload-ssh
Enable upload by ssh instead of http. An authorized ssh key is required [env: GTLBSTR_UPLOAD_SSH=]
--download-force-http
Force download repositories by insecure protocol. Does not work with the download_ssh flag [env: GTLBSTR_DOWNLOAD_FORCE_HTTP=]
--download-force-https
Force download repositories by secure protocol. Does not work with the download_ssh flag [env: GTLBSTR_DOWNLOAD_FORCE_HTTPS=]
--upload-force-http
Force upload repositories by insecure protocol. Does not work with the upload_ssh flag [env: GTLBSTR_UPLOAD_FORCE_HTTP=]
--upload-force-https
Force upload repositories by secure protocol. Does not work with the upload_ssh flag [env: GTLBSTR_UPLOAD_FORCE_HTTPS=]
--disable-hierarchy
Disable saving the directory hierarchy [env: GTLBSTR_DISABLE_HIERARCHY=]
--clear-dst
Clear dst path before cloning [env: GTLBSTR_CLEAR_DST=]
--only-master
Download only default branch [env: GTLBSTR_ONLY_MASTER=]
--disable-sync-date
Disable adding sync dates in project descriptions [env: GTLBSTR_DISABLE_SYNC_DATE=]
--gitlab-timeout
Timeout for requests to GitLab instances in seconds [env: GTLBSTR_GITLAB_TIMEOUT=]
-h, --help
Print help
-V, --version
Print version
```### ΠΡΠ΅Π΄ΡΠΏΡΠ΅ΠΆΠ΄Π΅Π½ΠΈΠ΅
ΠΡΡΡΡΠ΅ ΠΏΡΠΎΠ΅ΠΊΡΡ Π½Π΅ Π±ΡΠ΄ΡΡ ΠΏΠ΅ΡΠ΅Π½Π΅ΡΠ΅Π½Ρ. Π’Π°ΠΊ ΠΊΠ°ΠΊ, ΠΈΡ Π½Π΅Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎ ΡΠΊΠ»ΠΎΠ½ΠΈΡΠΎΠ²Π°ΡΡ ΡΠ΅ΡΠ΅Π· git, ΠΏΠΎΠΊΠ° Π² ΡΡΠΈΡ ΠΏΡΠΎΠ΅ΠΊΡΠ°Ρ Π½Π΅ Π±ΡΠ΄Π΅Ρ ΡΠΎΠ·Π΄Π°Π½ΠΎ Π½ΠΈ ΠΎΠ΄Π½ΠΎΠΉ Π²Π΅ΡΠΊΠΈ ([issue 37](https://github.com/lowitea/gitlobster/issues/37)).
## ΠΠ½Π°Π»ΠΎΠ³ΠΈ
- [gitlabber](https://github.com/ezbz/gitlabber)
- [ghorg](https://github.com/gabrie30/ghorg)