forgejo/modules
Leon Busch-George 7a8a4f5432
Prefer native parser for SSH public key parsing (#23798)
Without this patch, the setting SSH.StartBuiltinServer decides whether
the native (Go) implementation is used rather than calling 'ssh-keygen'.
It's possible for 'using ssh-keygen' and 'using the built-in server' to
be independent.
In fact, the gitea rootless container doesn't ship ssh-keygen and can be
configured to use the host's SSH server - which will cause the public
key parsing mechanism to break.

This commit changes the decision to be based on SSH.KeygenPath instead.
Any existing configurations with a custom KeygenPath set will continue
to function. The new default value of '' selects the native version. The
downside of this approach is that anyone who has relying on plain
'ssh-keygen' to have special properties will now be using the native
version instead.
I assume the exec-variant is only there because /x/crypto/ssh didn't
support ssh-ed25519 until 2016. I don't see any other reason for using
it so it might be an acceptable risk.

Fixes #23363

EDIT: this message was garbled when I tried to get the commit
description back in.. Trying to reconstruct it:

## ⚠️ BREAKING ⚠️ Users who don't have SSH.KeygenPath
explicitly set and rely on the ssh-keygen binary need to set
SSH.KeygenPath to 'ssh-keygen' in order to be able to continue using it
for public key parsing.

There was something else but I can't remember at the moment.

EDIT2: It was about `make test` and `make lint`. Can't get them to run.
To reproduce the issue, I installed `golang` in `docker.io/node:16` and
got:
```
...
go: mvdan.cc/xurls/v2@v2.4.0: unknown revision mvdan.cc/xurls/v2.4.0
go: gotest.tools/v3@v3.4.0: unknown revision gotest.tools/v3.4.0
...
go: gotest.tools/v3@v3.0.3: unknown revision gotest.tools/v3.0.3
...
go: error loading module requirements
```

Signed-off-by: Leon M. Busch-George <leon@georgemail.eu>
2023-04-11 14:34:28 +08:00
..
actions Do not crash when parsing an invalid workflow file (#23972) 2023-04-07 20:12:10 +08:00
activitypub
analyze
auth
avatar
base Use a general Eval function for expressions in templates. (#23927) 2023-04-07 21:25:49 +08:00
cache
charset Use data-tooltip-content for tippy tooltip (#23649) 2023-03-24 18:35:38 +08:00
container
context Group template helper functions, remove Printf, improve template error messages (#23982) 2023-04-08 21:15:22 +08:00
csv
doctor Check LFS/Packages settings in dump and doctor command (#23631) 2023-03-23 20:30:28 +08:00
emoji
eventsource
generate
git Remove Repository.getFilesChanged to fix Actions paths and paths-ignore filter (#23920) 2023-04-07 14:42:43 +08:00
gitgraph
graceful
hcaptcha
highlight
hostmatcher
html
httpcache
httplib Refactor internal API for git commands, use meaningful messages instead of "Internal Server Error" (#23687) 2023-03-29 14:32:26 +08:00
indexer Add meilisearch support (#23136) 2023-03-28 22:23:23 -04:00
issue/template
json
label Make label templates have consistent behavior and priority (#23749) 2023-04-10 16:44:02 +08:00
lfs Make minio package support legacy MD5 checksum (#23768) 2023-03-28 11:10:24 -04:00
log
markup Append (comment) when a link points at a comment rather than the whole issue (#23734) 2023-04-03 16:02:57 +08:00
mcaptcha
metrics
migration
mirror
nosql
notification
options Introduce path Clean/Join helper functions (#23495) 2023-03-21 16:02:49 -04:00
packages Display image size for multiarch container images (#23821) 2023-04-02 17:53:37 +08:00
paginator
pprof
private Refactor internal API for git commands, use meaningful messages instead of "Internal Server Error" (#23687) 2023-03-29 14:32:26 +08:00
process
proxy
proxyprotocol
public Fix incorrect CORS failure detection logic (#23844) 2023-03-31 11:35:48 -04:00
queue
recaptcha
references
regexplru
repository Make label templates have consistent behavior and priority (#23749) 2023-04-10 16:44:02 +08:00
secret
session Use Get/Set instead of Rename when Regenerate session id (#23975) 2023-04-07 18:11:24 +02:00
setting Prefer native parser for SSH public key parsing (#23798) 2023-04-11 14:34:28 +08:00
sitemap
ssh
storage Make minio package support legacy MD5 checksum (#23768) 2023-03-28 11:10:24 -04:00
structs Add activity feeds API (#23494) 2023-04-04 21:35:31 +08:00
svg Keep (add if not existing) xmlns attribute for generated SVG images (#23410) 2023-03-21 13:39:27 +08:00
sync
system
templates Use auto-updating, natively hoverable, localized time elements (#23988) 2023-04-11 01:01:20 +02:00
test Group template helper functions, remove Printf, improve template error messages (#23982) 2023-04-08 21:15:22 +08:00
timeutil Use auto-updating, natively hoverable, localized time elements (#23988) 2023-04-11 01:01:20 +02:00
translation Append (comment) when a link points at a comment rather than the whole issue (#23734) 2023-04-03 16:02:57 +08:00
turnstile
typesniffer
updatechecker
upload
uri
user
util Merge template functions "dict/Dict/mergeinto" (#23932) 2023-04-07 09:39:08 -05:00
validation
watcher
web
webhook