Fix git clone on SSH with MySQL (#382)

This commit is contained in:
Thomas Miceli 2024-11-17 21:25:59 +01:00 committed by GitHub
parent c1e046f428
commit 40ff4c7b3f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View file

@ -19,7 +19,7 @@ const (
func GetSetting(key string) (string, error) { func GetSetting(key string) (string, error) {
var setting AdminSetting var setting AdminSetting
err := db.Where("key = ?", key).First(&setting).Error err := db.Where("`key` = ?", key).First(&setting).Error
return setting.Value, err return setting.Value, err
} }

View file

@ -41,6 +41,7 @@ func runGitCommand(ch ssh.Channel, gitCmd string, key string, ip string) error {
allowUnauthenticated, err := auth.ShouldAllowUnauthenticatedGistAccess(db.AuthInfo{}, true) allowUnauthenticated, err := auth.ShouldAllowUnauthenticatedGistAccess(db.AuthInfo{}, true)
if err != nil { if err != nil {
errorSsh("Failed to get auth info", err)
return errors.New("internal server error") return errors.New("internal server error")
} }