54 Commits
Author SHA1 Message Date
KismetDev 611f638070 Pass git credentials through a credential helper instead of http.extraHeader (#443)
git lfs adds http.extraHeader to object downloads, which already carry an
Authorization header from the LFS batch response. gitlab.com rejects the
duplicate header with 400, so no LFS objects were downloaded since #425.
2026-09-16 07:53:56 +02:00
Andreas Wachter 64e81c3b14 added lfs to s3 (#437) 2026-09-11 13:27:53 +02:00
Danny Sauer 55882ef63e fix(github): use App installation token for destination pushes (#433)
Pass the resolved destination credential through GetOrCreate to the push helper. Cover App and configured tokens on github.com and Enterprise Server, API failures, and the backup call chain.
2026-09-09 18:34:52 +02:00
Andreas Wachter 002be7a6e8 fixed lfs partial backup (#426) 2026-08-28 15:52:10 +02:00
Dmitriy Prikhodko 7d810a4a1b Fix GitHub App authentication for LFS-backed local mirrors (#425)
* fix: use fresh GitHub App auth for LFS mirror updates

* fix: satisfy lint checks
2026-08-19 09:46:36 +02:00
Ryan ed581d75d9 fix GitLab mirroring visibility, URL parsing, and ref pushes (#423) 2026-08-18 20:34:43 +02:00
Thomas Christlieb c4d33b44f9 Fix 415 pruning old folders does count non repo folders (#420)
* slightly refactor prune function for testing

* add tests for pruning function

* fix keep-Logic: All timestamp-prefixed-Folders will be grouped into one generation to keep.
Fixes #415
Side effect: This will delete all folders `<timestamp>.<anything>` in the repo directory, not only `timestamp.issues`

* correct tests for CI, fix typo

* add test for no pruning needed
2026-08-10 18:46:27 +02:00
Thomas ChristliebandThomas Christlieb 2a2fd35ae3 fix #414: path.Dir() does not work on windows-style paths. (#418)
Co-authored-by: Thomas Christlieb <thomas.christlieb@aptean.com>
2026-07-30 09:55:27 +02:00
Bernat MutandAndreas Wachter d5caefb310 Feature/discussion 391 add GitHub app support (#396)
* feat: Add GitHub App support for authentication in configuration and code

* feat: Enhance GitHub App support by updating repository fetching logic and authentication method

* test: Update dependencies, enhance configuration handling, and add GitHub client tests

- Updated dependencies in go.sum to latest versions for improved stability and security.
- Added a defer statement to close the configuration file in readConfigFile function to prevent resource leaks.
- Implemented unit tests for GenRepo's HasAppAuth method to validate authentication conditions.
- Created new tests for the GitHub client to verify behavior with and without authentication tokens, including handling of invalid and missing private key files.

* feat: Exclude G101 gosec warning for github/github_test.go

* fixed go.mod and go.sum

---------

Co-authored-by: Andreas Wachter <andreas.wachter@buddyspencer.monster>
2026-06-16 14:12:59 +02:00
Jan Loewe ee95e89de5 Fix unintentional data loss when zip is false and keep greater than or one (#399) 2026-06-02 21:00:20 +02:00
Andreas Wachter de4f262e1f add additional tests (#374)
* add additional tests

* fix linter
2026-04-08 16:32:34 +02:00
Andreas Wachter e6999418e2 Fix linting (#372) 2026-04-05 21:39:20 +02:00
Andreas Wachter 3f831c33b3 Revert "upgraded go-git to v6 (#340)"
This reverts commit 6f2bfc2419.
2025-07-24 06:55:34 +02:00
Andreas Wachter 6f2bfc2419 upgraded go-git to v6 (#340) 2025-07-03 09:06:48 +02:00
Sjors Holtrop 533b98ba0c Make S3 backups bare (#316) 2025-04-28 11:58:00 +02:00
Aleksey @soar Smyrnov eadd2f7347 feat(local): Add mirror mode (#308)
* feat(local): Add mirror mode

* fix: Add `.git` to the mirror repos too
2025-04-05 20:30:31 +02:00
sjorsholtrop-ritense 57a38a4d8f Fix bitbucket source, add temp token support to s3 dest (#302) 2025-03-23 15:05:12 +01:00
Aleksey @soar Smyrnov 43ef607b13 fix: Fetch LFS files explicitly in bare repositories (#303) 2025-03-22 11:06:34 +01:00
Andreas Wachter 9e1217eef1 return false instead of break (#271) 2024-09-04 19:22:15 +02:00
Andreas Wachter 818c0cef4e fix temp clone as well (#269) 2024-09-02 17:14:16 +02:00
Andreas Wachter 45056fce58 don't use user for token on gogs (#268) 2024-09-02 16:11:52 +02:00
Andreas Wachter d346b1d1fb fetch updates on a bare repo (#266)
* fetch updates on a bare repo

* move print and fetch outside of the if clause
2024-08-30 12:31:05 +02:00
Andreas Wachter e513444acc added zip function (#240)
* added zip function

* remove comment
2024-05-10 11:48:48 +02:00
Andreas Wachter c37176fc24 Fix issues (#238)
* fixed backup of issues

* add issues to zip
2024-04-27 16:32:02 +02:00
Andreas Wachter ff37881126 fixed backup of issues (#237) 2024-04-27 11:49:50 +02:00
Andreas Wachter b5969879fd It also updated when the source repo was force pushed (#235) 2024-04-27 11:23:01 +02:00
Andreas Wachter 61d5070f50 fixed some backup path issues and reload issues (#220)
* fixed some backup path issues and reload issues

* removed all chdirs
2024-04-04 07:31:28 +02:00
Andreas Wachter 8de9d0f16f added git lfs for mirrors (#204)
* added git lfs for mirrors

* added openssh-client to ubuntu image

* working push on all branches

* fetch after clone and before pull to get all branches

* checkout all branches is not needed

* fix fetch
2024-02-19 08:42:35 +01:00
Andreas Wachter 76bcf763aa Issue 200 (#203)
* force fetch

* do not fetch

* log push

* log clone too
2024-01-29 12:31:36 +01:00
Andreas Wachter 4f6317326a authorize during fetch (#202) 2024-01-25 16:31:47 +01:00
Andreas Wachter 46317e71c9 Issue 191 (#192)
* change fatal to warning

* remove directory if not repository

* added error message to warning

* add error around directory removal

* remove repo if initial clone goes wrong
2024-01-03 09:15:34 +01:00
Andreas Wachter a78d73f5de fix relative path for issues (#189) 2023-12-04 13:24:18 +01:00
Andreas Wachter ccb0c5850d fix path for clone (#187) 2023-12-03 14:56:01 +01:00
Andreas Wachter 52a834b42b backup issues from github (#185)
* backup issues from github

* gitlab issues

* added gitea

* added gogs

* added onedev

* updated examples

* added more documentation
2023-12-01 07:58:53 +01:00
Andreas Wachter fecb4040e6 added sublogger to gitea (#178)
* added sublogger to gitea

* implemented the rest of the subloggers
2023-10-04 10:55:24 +02:00
Andreas Wachter e530b8b3df updated archiver (#175) 2023-10-03 15:53:43 +02:00
Andreas Wachter 082821bfb9 added force push (#172) 2023-09-29 17:10:06 +02:00
Andreas Wachter 4fac8115ff Error on second push (#166)
* there is an error on second push if the repo has only one branch

* fixed fetch error message
2023-08-17 08:06:10 +02:00
Andreas Wachter f8ad43bb29 Multiple branches (#165)
* added github mirror functionality

* create temporary directory to clone into

* added onedev as destination

* added sourcehut

* add new examples

* added push of all branches, autocreation of repos on sourcehut

* push everything

* sourcehut visibility fix
2023-08-16 14:04:59 +02:00
Andreas Wachter f468f48ba1 mirror functions (#164)
* added github mirror functionality

* create temporary directory to clone into

* added onedev as destination

* added sourcehut

* add new examples
2023-08-15 18:13:21 +02:00
Andreas Wachter beae85c182 implemented git lfs (#160)
* implemented git lfs

* removed arm/v6 from docker builds

* add lfs to example
2023-07-18 10:56:43 +02:00
Andreas Wachter 3d125133ef implement filters for github (#137)
* implement filters for github

* add filter to exclude archived repositories

* add filter for gitea/forgejo

* gogs filter option

* fix error log

* include gitlab filters

* fix logging

* parse duration

* filters for onedev and sourcehut

* adapted conf.example.yml
2023-02-20 16:05:01 +01:00
Andreas Wachter f61574bf9c improved prometheus metrics (#134)
* improved prometheus metrics

* change RepoTime to gauge

* fix gitea, only set metrics if ran
2023-02-10 06:07:11 +01:00
Andreas Wachter 12d496dba7 added option to clone the repository as bare (#131) 2023-01-11 11:00:48 +01:00
Andreas Wachter 6ddf340744 added possibility to add date to path (#130)
* added possibility to add date to path

* adds zip functionality

* added keep parameter

* cleanup

* keep parameter creates files with the timestamp in repo name directory

* fixed clone with keep without structured=true

* remove search
2023-01-08 20:22:07 +01:00
Andreas Wachter 81136acfbe should fix #112 2022-09-24 18:14:07 +02:00
Tom Moulard 646b792ac1 chore: add linting (#101)
* chore: adding makefile

* chore: adding lint

* chore: update package name

* lint: run with fix

* chore: update main.go

* chore: update main_test.go

* chore: update types.go

* chore: update logger.go

* chore: update types_test.go

* chore: update prometheus.go

* chore: update local.go

* chore: update gitlab.go

* chore: update gogs.go

* chore: update bitbucket.go

* chore: update gitea.go

* chore: update github.go

* chore: update main*.go

* chore: go mod tidy

* chore: update action to have a correct working-directory
2022-03-20 11:25:11 +01:00
Andreas Wachter 2a069398ad removed git ls-remote from local 2022-03-02 22:28:58 +01:00
Andreas Wachter bee477bf65 addresses #92. ls-remote before pulling or cloning (#93) 2022-02-24 13:00:17 +01:00
Andreas Wachter 8ec9f04715 add repo to warn-message for local clone #79 2021-12-30 19:24:46 +01:00