cooperspencer / gickup

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

Sourcehut destination support #159

Closed barnumbirr closed 1 year ago

barnumbirr commented 1 year ago

Hi,

I'd love to have the ability to backup repositories to Sourcehut but it would seem that feature is not currently supported by gickup.

Cheers.

cooperspencer commented 1 year ago

Hi, That's not supported so far. Gitea and Gogs have a built-in mirroring function, Sourcehut doesn't. I might have an idea how to get that done. I'll keep you posted.

cooperspencer commented 1 year ago

Hi,

I have just added a mirroring option for Sourcehut to the main branch. Could you please test and confirm if it functions as you intended?

adamcstephens commented 1 year ago

I could not sourcehut destination to work. I created an unscoped oauth token and ssh key, and this configuration:

destination:
  sourcehut:
    - token: GICKUP_SOURCEHUT_TOKEN
      user: adamcstephens
      sshkey: ./gickup-sh

I received the error:

2023-08-15T15:45:13-04:00 ERR repository not found stage=sourcehut url=https://codeberg.org/adam/nix-sandbox.git

In the example configuration, it would be helpful to see if a source/destination has a default. For example, this integration defaults to git.sr.ht as I would expect, but the example config doesn't relay this information so when troubleshooting I changed this and caused other errors.

It would be nice if the sshkey would have agent support. Relying on id_rsa is fragile, as for example I would use id_ecdsa of not my security key. I realize this may be a library problem.

cooperspencer commented 1 year ago

I tested it today with an id_ecdsa key and it worked fine for me. I actually had an issue in the code to create a new project on Sourcehut, it should be fixed now on main

adamcstephens commented 1 year ago

I'm still receiving ERR repository not found stage=sourcehut, even on a repository I manually created myself.

cooperspencer commented 1 year ago

Which token do you use? I tested it with the legacy tokens. I haven't implemented sourcehuts graphql api yet.

adamcstephens commented 1 year ago

Ahh, thank you for that clarification. It wasn't clear that I needed a legacy token. It does work as expected with a legacy token.

cooperspencer commented 1 year ago

I'll add it to the documentation. Thanks a lot for testing it

cooperspencer commented 1 year ago

i pushed v0.10.18 and those features are now included.