Compare commits

...

3 Commits

Author SHA1 Message Date
Joe Chen
f5c8030c1f Fix up tests 2026-01-31 22:28:11 -05:00
Joe Chen
8c5c0125c4 release: update version to 0.14.1 2026-01-31 22:23:40 -05:00
ᴊᴏᴇ ᴄʜᴇɴ
3f03530042 fix(ssh): git clone via built-in SSH server hangs (#8135)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 22:22:03 -05:00
6 changed files with 15 additions and 8 deletions

View File

@@ -4,6 +4,10 @@ All notable changes to Gogs are documented in this file.
## 0.15.0+dev (`main`)
### Fixed
- Git clone via the built-in SSH server hangs. [#8132](https://github.com/gogs/gogs/issues/8132)
## 0.14.0
### Added

View File

@@ -14,7 +14,7 @@ import (
)
func init() {
conf.App.Version = "0.14.0"
conf.App.Version = "0.14.1"
}
func main() {

View File

@@ -70,7 +70,7 @@ func Init(customConf string) error {
if err = File.Append(customConf); err != nil {
return errors.Wrapf(err, "append %q", customConf)
}
} else {
} else if !HookMode {
log.Warn("Custom config %q not found. Ignore this warning if you're running for the first time", customConf)
}
@@ -142,9 +142,11 @@ func Init(customConf string) error {
}
if IsWindowsRuntime() || semverutil.Compare(sshVersion, "<", "5.1") {
log.Warn(`SSH minimum key size check is forced to be disabled because server is not eligible:
if !HookMode {
log.Warn(`SSH minimum key size check is forced to be disabled because server is not eligible:
1. Windows server
2. OpenSSH version is lower than 5.1`)
}
} else {
SSH.MinimumKeySizes = map[string]int{}
for _, key := range File.Section("ssh.minimum_key_sizes").Keys() {
@@ -346,8 +348,10 @@ func Init(customConf string) error {
LFS.ObjectsPath = ensureAbs(LFS.ObjectsPath)
handleDeprecated()
for _, warning := range checkInvalidOptions(File) {
log.Warn("%s", warning)
if !HookMode {
for _, warning := range checkInvalidOptions(File) {
log.Warn("%s", warning)
}
}
if err = File.Section("cache").MapTo(&Cache); err != nil {

View File

@@ -444,7 +444,7 @@ func checkInvalidOptions(config *ini.File) (warnings []string) {
"service": "auth",
}
for oldSection, newSection := range renamedSections {
if config.Section(oldSection).KeyStrings() != nil {
if len(config.Section(oldSection).KeyStrings()) > 0 {
warnings = append(warnings, fmt.Sprintf("section [%s] is invalid, use [%s] instead", oldSection, newSection))
}
}

View File

@@ -68,7 +68,6 @@ func TestCheckInvalidOptions(t *testing.T) {
"section [service] is invalid, use [auth] instead",
"option [server] ROOT_URL is invalid, use [server] EXTERNAL_URL instead",
"option [server] LANDING_PAGE is invalid, use [server] LANDING_URL instead",
"option [server] NONEXISTENT_OPTION is invalid",
}

View File

@@ -87,6 +87,7 @@ func handleServerConn(keyID string, chans <-chan ssh.NewChannel) {
_ = req.Reply(true, nil)
go func() {
_, _ = io.Copy(input, ch)
input.Close()
}()
_, _ = io.Copy(ch, stdout)
_, _ = io.Copy(ch.Stderr(), stderr)
@@ -187,7 +188,6 @@ func setupHostKeys(appDataPath string, algorithms []string) ([]ssh.Signer, error
conf.SSH.KeygenPath,
"-t", algo,
"-f", keyPath,
"-m", "PEM",
"-N", run.Arg(""),
}
err = run.Cmd(context.Background(), args...).Run().Wait()