Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch built-in SSH server to github.com/gliderlabs/ssh #3896

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ ignored = ["google.golang.org/appengine*"]
branch = "master"
name = "golang.org/x/net"

[[override]]
name = "github.com/gliderlabs/ssh"
version = "0.1.1"

[[override]]
name = "github.com/go-xorm/xorm"
revision = "a6300f2a45e05a8f75f00a1d6188049fe7851915"
Expand Down
4 changes: 2 additions & 2 deletions cmd/serv.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func parseCmd(cmd string) (string, string) {
if len(ss) != 2 {
return "", ""
}
return ss[0], strings.Replace(ss[1], "'/", "'", 1)
return ss[0], ss[1]
}

var (
Expand Down Expand Up @@ -146,7 +146,7 @@ func runServ(c *cli.Context) error {
}
}

repoPath := strings.ToLower(strings.Trim(args, "'"))
repoPath := strings.ToLower(strings.TrimLeft(strings.Trim(args, "'"), "/"))
rr := strings.SplitN(repoPath, "/", 2)
if len(rr) != 2 {
fail("Invalid repository path", "Invalid repository path: %v", args)
Expand Down
1 change: 1 addition & 0 deletions integrations/mysql.ini.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ LFS_CONTENT_PATH = data/lfs-mysql
OFFLINE_MODE = false
LFS_JWT_SECRET = Tv_MjmZuHqpIY6GFl12ebgkRAMt4RlWt0v4EHKSXO0w
APP_DATA_PATH = integrations/gitea-integration-mysql/data
BUILTIN_SSH_SERVER_USER = git

[mailer]
ENABLED = true
Expand Down
1 change: 1 addition & 0 deletions integrations/pgsql.ini.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ LFS_CONTENT_PATH = data/lfs-pgsql
OFFLINE_MODE = false
LFS_JWT_SECRET = Tv_MjmZuHqpIY6GFl12ebgkRAMt4RlWt0v4EHKSXO0w
APP_DATA_PATH = integrations/gitea-integration-pgsql/data
BUILTIN_SSH_SERVER_USER = git

[mailer]
ENABLED = true
Expand Down
2 changes: 1 addition & 1 deletion integrations/repo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func TestViewRepo1CloneLinkAuthorized(t *testing.T) {
assert.Equal(t, setting.AppURL+"user2/repo1.git", link)
link, exists = htmlDoc.doc.Find("#repo-clone-ssh").Attr("data-link")
assert.True(t, exists, "The template has changed")
sshURL := fmt.Sprintf("ssh://%s@%s:%d/user2/repo1.git", setting.RunUser, setting.SSH.Domain, setting.SSH.Port)
sshURL := fmt.Sprintf("ssh://%s@%s:%d/user2/repo1.git", setting.SSH.BuiltinServerUser, setting.SSH.Domain, setting.SSH.Port)
assert.Equal(t, sshURL, link)
}

Expand Down
1 change: 1 addition & 0 deletions integrations/sqlite.ini
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ LFS_CONTENT_PATH = data/lfs-sqlite
OFFLINE_MODE = false
LFS_JWT_SECRET = Tv_MjmZuHqpIY6GFl12ebgkRAMt4RlWt0v4EHKSXO0w
APP_DATA_PATH = integrations/gitea-integration-sqlite/data
BUILTIN_SSH_SERVER_USER = git
ENABLE_GZIP = true

[mailer]
Expand Down
Loading