From 40ff4c7b3f97268f20d60c6d327a92844c21fb44 Mon Sep 17 00:00:00 2001 From: Thomas Miceli <27960254+thomiceli@users.noreply.github.com> Date: Sun, 17 Nov 2024 21:25:59 +0100 Subject: [PATCH] Fix git clone on SSH with MySQL (#382) --- internal/db/admin_setting.go | 2 +- internal/ssh/git_ssh.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/db/admin_setting.go b/internal/db/admin_setting.go index 88f4ccd..d8586ee 100644 --- a/internal/db/admin_setting.go +++ b/internal/db/admin_setting.go @@ -19,7 +19,7 @@ const ( func GetSetting(key string) (string, error) { var setting AdminSetting - err := db.Where("key = ?", key).First(&setting).Error + err := db.Where("`key` = ?", key).First(&setting).Error return setting.Value, err } diff --git a/internal/ssh/git_ssh.go b/internal/ssh/git_ssh.go index 3c99994..f2ba6ab 100644 --- a/internal/ssh/git_ssh.go +++ b/internal/ssh/git_ssh.go @@ -41,6 +41,7 @@ func runGitCommand(ch ssh.Channel, gitCmd string, key string, ip string) error { allowUnauthenticated, err := auth.ShouldAllowUnauthenticatedGistAccess(db.AuthInfo{}, true) if err != nil { + errorSsh("Failed to get auth info", err) return errors.New("internal server error") }