cooperspencer / gickup

https://cooperspencer.github.io/gickup-documentation/
Apache License 2.0
955 stars 33 forks source link

Backup/Mirror based on filter results #136

Closed ShalokShalom closed 1 year ago

ShalokShalom commented 1 year ago

Hi 😊

I am inclined to mirror A LOT of repositories to my instance of DevOne.

I know, there is no backend for it, and I am aware, that you write a binding to Java, that makes it possible.

In case you get bored then: I like to backup basically all repositories of a certain language (F#), that would require the app to be aware of Github's filter/search API..

Another point that might be interesting, is to sort out repositories with less than 10 stars, archived ones, and/or those who had not seen an update for 10 years. ⏰

The filtering mechanism is obviously a bonus, it would significantly reduce the amount of repos to be cloned. 😊

I can also do it by hand. Just think this could be a neat feature. 👍🏻

Have a good day!

cooperspencer commented 1 year ago

Hi fellow Viennese,

I just had a look at your account and you really have a lot of starred repositories.

I will have a look at the APIs of Github and co. and see what I can do.

I'll keep you posted.

cooperspencer commented 1 year ago

I had a look at the different APIs: Github:

Gitea/Forgejo:

Gogs:

Gitlab:

Sourcehut:

OneDev:

Bitbucket:

regarding the requirement not updated in the last 10 years. Do you want this feature only in the default branch or should it apply to all branches?

ShalokShalom commented 1 year ago

That's wonderful

I mainly want that to sort out the stuff that's unmaintained for years.

Since its unlikely that the main branch has no commit for years, and there is development going on in a subbranch, I think that's not needed.

Thanks a lot

jholdstock commented 1 year ago

Hi @cooperspencer. Thanks for your great work on gickup! I run it daily on my server to backup my projects from GitHub to local storage.

For me, the most important of the filters listed by @ShalokShalom would be archived projects. I actually run my own fork with that filter hacked in.

I would love to see first class support for this!

cooperspencer commented 1 year ago

Hi @jholdstock, I just saw your message. Awesome idea, I included this in the latest changes of the filter branch. So if anyone wants to test it, the config looks something like this:

source:
  github:
    - user: cooperspencer
      filter:
        lastactivity: 1y
        stars: 700
        languages:
          - dockerfile
          - go
        excludearchived: true
destination:
  local:
    - path: backup
      structured: true

I will include these changes, as far as possible, for the other hosters too.

cooperspencer commented 1 year ago

In my tests everything went smoothly, so I merged it into main. Feel free to test it.

cooperspencer commented 1 year ago

@ShalokShalom I have just added a mirroring option for OneDev to the main branch.