-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Allow pushmirror to use publickey authentication #18835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
@wxiaoguang I've changed my comment to reflect a more accurate representation. Sorry for the confusion. |
No need to say sorry .... 😊 I just hope most people can realize the fact, and make Gitea frontend get rid of the current nobody-cares situation. |
- Remember, don't escape in arguments.
- Also un-comment remove part.
Ready for review... I'm not sure how to handle the UI to display the long ssh key. |
Codecov Report
@@ Coverage Diff @@
## main #18835 +/- ##
==========================================
+ Coverage 46.93% 46.95% +0.01%
==========================================
Files 977 979 +2
Lines 135302 135609 +307
==========================================
+ Hits 63508 63672 +164
- Misses 64012 64132 +120
- Partials 7782 7805 +23
Help us with your feedback. Take ten seconds to tell us how you rate us. |
b0e7a61
to
f3bbdcc
Compare
f3bbdcc
to
af81b21
Compare
Force-pushed twice, because git was being funny. |
@@ -26,6 +27,10 @@ type PushMirror struct { | |||
Repo *Repository `xorm:"-"` | |||
RemoteName string | |||
|
|||
// A keypair formatted in OpenSSH format. | |||
PublicKey string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be a TEXT
field on MySQL which is potentially too small for an RSA key - how big is the potential representation for ED25519 keys?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I once run a script with the old code in modules/crypto/ed25519.go
to generate a few million private keys and get their max length. IIRC it was 387, so I just got at 400 to be safe.
Public keys are: ssh-ed25519 + base64 of the ssh's marshaled of the public key bytes + new line
And should result in a max of 81 bytes per the analysis of the code (we likely should have a test that verifies these lengths)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might still want to enlarge it now to accomodate future key formats. There's no need to define database fields so tightly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not able to guess future key formats. I prefer to just limit it to Ed25519 signatures and only add other signatures scheme if there's a need for them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we enlarge now, it saves us from the pain of a future migration. So, unless this is a critical performance code path where there are indexing benefits by using the smaller type, I would enlarge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright then, I give in. What would be a good size to use here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, MySQL TEXT
should be limited to 65535 bytes, which seems plenty. So this is LGTM.
Signed-off-by: Andrew Thornton <[email protected]>
Please resolve the conflicts. |
Co-authored-by: silverwind <[email protected]>
@Gusted Is this PR abandoned? Do you need any help finishing up the merge conflicts? |
No, the merge conflicts aren't the problem. Rather that I forgot that Git-LFS exists, which is way harder to support with SSH. I'm not knowledgeable enough about LFS to even try add support for it. |
Would it be possible to implement push mirrors without support for Git-LFS and leave that feature for the future? There are a fair number of repositories that doesn't require it, so the implementation would not be wasted. |
👀 |
@Gusted Are you still willing to work on this PR? I think this feature would be a great addition even without Git LFS support. I see that you suggested to force HTTP auth for LFS-enabled repos - I think this would be an acceptable approach. If you still want to continue with this PR, please resolve merge conflicts and maybe we could merge it soon. |
@Gusted Any way I can help? I am also interested in pushing this through to the finish line. I know a lot about LFS. |
@philip-peterson AFAIK this contributor is now rather more active over at Forgejo. As there was no response in a while, we can consider this PR as abandoned. As this feature still would be a valuable addition, it would be great if you or somebody else could take over this PR. |
I'll close this PR for those reasons. Im refactoring other code areas that might make this easier anyway |
Uh oh!
There was an error while loading. Please reload this page.