forgejo/modules
Gusted b55c72828e feat(sec): Add SSH signing support for instances (#6897)
- Add support to set `gpg.format` in the Git config, via the new `[repository.signing].FORMAT` option. This is to tell Git that the instance would like to use SSH instead of OpenPGP to sign its commits. This is guarded behind a Git version check for v2.34.0 and a check that a `ssh-keygen` binary is present.
- Add support to recognize the public SSH key that is given to `[repository.signing].SIGNING_KEY` as the signing key by the instance.
- Thus this allows the instance to use SSH commit signing for commits that the instance creates (e.g. initial and squash commits) instead of using PGP.
- Technically (although I have no clue how as this is not documented) you can have a different PGP signing key for different repositories; this is not implemented for SSH signing.
- Add unit and integration testing.
  - `TestInstanceSigning` was reworked from `TestGPGGit`, now also includes testing for SHA256 repositories. Is the main integration test that actually signs commits and checks that they are marked as verified by Forgejo.
  - `TestParseCommitWithSSHSignature` is a unit test that makes sure that if a SSH instnace signing key is set, that it is used to possibly verify instance SSH signed commits.
  - `TestSyncConfigGPGFormat` is a unit test that makes sure the correct git config is set according to the signing format setting. Also checks that the guarded git version check and ssh-keygen binary presence check is done correctly.
  - `TestSSHInstanceKey` is a unit test that makes sure the parsing of a SSH signing key is done correctly.
  - `TestAPISSHSigningKey` is a integration test that makes sure the newly added API route `/api/v1/signing-key.ssh` responds correctly.

Documentation PR: forgejo/docs#1122

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6897
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-04-11 13:25:35 +00:00
..
actions chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
activitypub feat(activitiypub): enable HTTP signatures on all ActivityPub endpoints (#7035) 2025-04-03 15:24:15 +00:00
analyze Rename code_langauge.go to code_language.go (#26377) 2023-08-07 15:00:53 -04:00
assetfs Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
auth chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
avatar Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
base Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
cache Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
card chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
charset Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
container Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
csv Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
emoji Update emoji set to Unicode 15 (#25595) 2023-06-29 16:29:48 +00:00
eventsource chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
forgefed chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
generate chore(sec): unify usage of crypto/rand.Read (#7453) 2025-04-04 03:31:37 +00:00
git feat(sec): Add SSH signing support for instances (#6897) 2025-04-11 13:25:35 +00:00
gitrepo chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
graceful Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
hcaptcha chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
highlight Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
hostmatcher Support allowed hosts for migrations to work with proxy (#32025) 2024-09-14 17:52:54 +02:00
html Refactor backend SVG package and add tests (#26335) 2023-08-05 04:34:59 +00:00
httpcache chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
httplib chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
indexer Update module github.com/blevesearch/bleve/v2 to v2.5.0 (forgejo) (#7468) 2025-04-06 08:41:38 +00:00
issue/template Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
json Replace interface{} with any (#25686) 2023-07-04 18:36:08 +00:00
keying chore(sec): unify usage of crypto/rand.Read (#7453) 2025-04-04 03:31:37 +00:00
label chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
lfs Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
log Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
markup chore(ui): remove ineffective class small in inline code preview (#7414) 2025-04-01 15:55:56 +00:00
mcaptcha chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
metrics chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
migration fix(migrations): transfer PR flow information (#7421) 2025-04-03 06:47:37 +00:00
nosql chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
optional Move ParseBool to optional (#33979) 2025-04-01 02:28:02 +02:00
options chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
packages Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
paginator Use more specific test methods (#24265) 2023-04-22 17:56:27 -04:00
pprof chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
private chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
process Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
proxy chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
proxyprotocol chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
public chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
queue Update module go.uber.org/mock to v0.5.1 (forgejo) (#7488) 2025-04-08 11:11:21 +00:00
recaptcha chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
references Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
regexplru Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
repository Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
secret Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v1.64.6 (forgejo) (#7118) 2025-03-04 21:38:35 +00:00
session chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
setting feat(sec): Add SSH signing support for instances (#6897) 2025-04-11 13:25:35 +00:00
sitemap Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
ssh chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
storage Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
structs feat: sync forks (#2364) 2025-04-07 07:00:38 +00:00
svg chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
sync chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
system Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
templates Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
test feat(activitiypub): enable HTTP signatures on all ActivityPub endpoints (#7035) 2025-04-03 15:24:15 +00:00
testlogger feat: use XORM EngineGroup instead of single Engine connection (#7212) 2025-03-30 11:34:02 +00:00
timeutil Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
translation feat(build): uniform ini parsing (#7429) 2025-04-03 08:27:02 +00:00
turnstile chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
typesniffer chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
updatechecker chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
uri Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
user Drop SSPI auth support and more Windows files (#7148) 2025-03-08 00:43:41 +00:00
util chore(sec): unify usage of crypto/rand.Read (#7453) 2025-04-04 03:31:37 +00:00
validation Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
web fix(ui): display user-friendly message for range error (#7420) 2025-04-02 15:48:09 +00:00
webhook Add support for workflow_dispatch (#3334) 2024-06-28 05:17:11 +00:00
zstd Cache generated binary across jobs 2024-08-26 23:43:09 +02:00