diff --git a/README.md b/README.md index 9e943fa14c4..d11344cbf5e 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ Get more information from [the translation section of our contributing guide](CO ## Official and Third-Party Projects -We provide an official [go-sdk](https://gitea.com/gitea/go-sdk), a CLI tool called [tea](https://gitea.com/gitea/tea) and an [action runner](https://gitea.com/gitea/runner) for Gitea Action. +We provide an official [go-sdk](https://gitea.com/gitea/go-sdk), a CLI tool called [gt](https://gitea.com/gitea/cli) and an [action runner](https://gitea.com/gitea/runner) for Gitea Action. We maintain a list of Gitea-related projects at [gitea/awesome-gitea](https://gitea.com/gitea/awesome-gitea), where you can discover more third-party projects, including SDKs, plugins, themes, and more. diff --git a/README.zh-cn.md b/README.zh-cn.md index dda919a8fff..b5d49053e57 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -76,7 +76,7 @@ ## 官方和第三方项目 -我们提供了一个官方的 [go-sdk](https://gitea.com/gitea/go-sdk),一个名为 [tea](https://gitea.com/gitea/tea) 的 CLI 工具和一个 Gitea Action 的 [action runner](https://gitea.com/gitea/runner)。 +我们提供了一个官方的 [go-sdk](https://gitea.com/gitea/go-sdk),一个名为 [gt](https://gitea.com/gitea/cli) 的 CLI 工具和一个 Gitea Action 的 [action runner](https://gitea.com/gitea/runner)。 我们在 [gitea/awesome-gitea](https://gitea.com/gitea/awesome-gitea) 维护了一个 Gitea 相关项目的列表,您可以在那里发现更多的第三方项目,包括 SDK、插件、主题等。 diff --git a/README.zh-tw.md b/README.zh-tw.md index 15fd3843df5..605f0dd8ac8 100644 --- a/README.zh-tw.md +++ b/README.zh-tw.md @@ -76,7 +76,7 @@ ## 官方和第三方項目 -我們提供了一個官方的 [go-sdk](https://gitea.com/gitea/go-sdk),一個名為 [tea](https://gitea.com/gitea/tea) 的 CLI 工具和一個 Gitea Action 的 [action runner](https://gitea.com/gitea/runner)。 +我們提供了一個官方的 [go-sdk](https://gitea.com/gitea/go-sdk),一個名為 [gt](https://gitea.com/gitea/cli) 的 CLI 工具和一個 Gitea Action 的 [action runner](https://gitea.com/gitea/runner)。 我們在 [gitea/awesome-gitea](https://gitea.com/gitea/awesome-gitea) 維護了一個 Gitea 相關項目的列表,您可以在那裡發現更多的第三方項目,包括 SDK、插件、主題等。 diff --git a/custom/conf/app.example.ini b/custom/conf/app.example.ini index d52170805bf..a60a25cdd60 100644 --- a/custom/conf/app.example.ini +++ b/custom/conf/app.example.ini @@ -637,10 +637,10 @@ ENABLED = true ;; Pre-register OAuth2 applications for some universally useful services ;; * https://github.com/hickford/git-credential-oauth ;; * https://github.com/git-ecosystem/git-credential-manager -;; * https://gitea.com/gitea/tea +;; * https://gitea.com/gitea/cli ;; * Gitea App (the official Gitea mobile app) ;; * https://gitea.com/gitea/gitea-vscode -;DEFAULT_APPLICATIONS = git-credential-oauth, git-credential-manager, tea, gitea-app, gitea-vscode +;DEFAULT_APPLICATIONS = git-credential-oauth, git-credential-manager, gitea-cli, gitea-app, gitea-vscode ;; ;; By default, OAuth2 applications can only use "http" and "https" as their redirect URI schemes. ;; If you need to use other schemes (e.g. for desktop applications), you can specify them here as a comma-separated list. diff --git a/models/auth/oauth2.go b/models/auth/oauth2.go index 0abd69bf19f..78d94f2ed2c 100644 --- a/models/auth/oauth2.go +++ b/models/auth/oauth2.go @@ -78,8 +78,8 @@ func BuiltinApplications() map[string]*BuiltinOAuth2Application { RedirectURIs: []string{"http://127.0.0.1", "https://127.0.0.1"}, } m["d57cb8c4-630c-4168-8324-ec79935e18d4"] = &BuiltinOAuth2Application{ - ConfigName: "tea", - DisplayName: "tea", + ConfigName: "gitea-cli", + DisplayName: "gitea-cli", RedirectURIs: []string{"http://127.0.0.1", "https://127.0.0.1"}, } m["b757811a-05c8-4c76-8d74-a5ee3d2073f2"] = &BuiltinOAuth2Application{ diff --git a/models/repo/repo.go b/models/repo/repo.go index bafc9b5d025..c56f562d8ee 100644 --- a/models/repo/repo.go +++ b/models/repo/repo.go @@ -605,7 +605,7 @@ type CloneLink struct { SSH string HTTPS string - Tea string + CLI string } // ComposeHTTPSCloneURL returns HTTPS clone URL based on the given owner and repository name. @@ -656,9 +656,9 @@ func composeSSHCloneURL(doer *user_model.User, ownerName, repoName string, useUR return fmt.Sprintf("%s@%s:%s/%s.git", sshUser, sshHost, url.PathEscape(ownerName), url.PathEscape(repoName)) } -// ComposeTeaCloneCommand returns Tea CLI clone command based on the given owner and repository name. -func ComposeTeaCloneCommand(ctx context.Context, owner, repo string) string { - return fmt.Sprintf("tea clone %s/%s", url.PathEscape(owner), url.PathEscape(repo)) +// ComposeCLICloneCommand returns the gt (gitea-cli) clone command based on the given owner and repository name. +func ComposeCLICloneCommand(ctx context.Context, owner, repo string) string { + return fmt.Sprintf("gt repo clone %s/%s", url.PathEscape(owner), url.PathEscape(repo)) } func (repo *Repository) cloneLink(ctx context.Context, doer *user_model.User, repoPathName string) *CloneLink { @@ -668,7 +668,7 @@ func (repo *Repository) cloneLink(ctx context.Context, doer *user_model.User, re SupportSSH: !setting.SSH.Disabled && (doer != nil || setting.SSH.ExposeAnonymous), SSH: ComposeSSHCloneURL(doer, repo.OwnerName, repoPathName), HTTPS: ComposeHTTPSCloneURL(ctx, repo.OwnerName, repoPathName), - Tea: ComposeTeaCloneCommand(ctx, repo.OwnerName, repoPathName), + CLI: ComposeCLICloneCommand(ctx, repo.OwnerName, repoPathName), } } diff --git a/modules/setting/oauth2.go b/modules/setting/oauth2.go index f7838c7c128..97bbf0ac974 100644 --- a/modules/setting/oauth2.go +++ b/modules/setting/oauth2.go @@ -108,7 +108,7 @@ var OAuth2 = struct { JWTSigningAlgorithm: "RS256", JWTSigningPrivateKeyFile: "jwt/private.pem", MaxTokenLength: math.MaxInt16, - DefaultApplications: []string{"git-credential-oauth", "git-credential-manager", "tea", "gitea-app", "gitea-vscode"}, + DefaultApplications: []string{"git-credential-oauth", "git-credential-manager", "gitea-cli", "gitea-app", "gitea-vscode"}, } func loadOAuth2From(rootCfg ConfigProvider) { @@ -121,6 +121,11 @@ func loadOAuth2From(rootCfg ConfigProvider) { if sec.HasKey("DEFAULT_APPLICATIONS") && sec.Key("DEFAULT_APPLICATIONS").String() == "" { OAuth2.DefaultApplications = nil } + for i, name := range OAuth2.DefaultApplications { + if name == "tea" { // tea was renamed to gitea-cli, which kept its OAuth2 client ID + OAuth2.DefaultApplications[i] = "gitea-cli" + } + } if !filepath.IsAbs(OAuth2.JWTSigningPrivateKeyFile) { OAuth2.JWTSigningPrivateKeyFile = filepath.Join(AppDataPath, OAuth2.JWTSigningPrivateKeyFile) diff --git a/modules/setting/oauth2_test.go b/modules/setting/oauth2_test.go index 579454be30c..7579b2b9140 100644 --- a/modules/setting/oauth2_test.go +++ b/modules/setting/oauth2_test.go @@ -64,13 +64,13 @@ func TestOauth2DefaultApplications(t *testing.T) { cfg, _ := NewConfigProviderFromData(``) loadOAuth2From(cfg) - assert.Equal(t, []string{"git-credential-oauth", "git-credential-manager", "tea", "gitea-app", "gitea-vscode"}, OAuth2.DefaultApplications) + assert.Equal(t, []string{"git-credential-oauth", "git-credential-manager", "gitea-cli", "gitea-app", "gitea-vscode"}, OAuth2.DefaultApplications) cfg, _ = NewConfigProviderFromData(`[oauth2] DEFAULT_APPLICATIONS = tea `) loadOAuth2From(cfg) - assert.Equal(t, []string{"tea"}, OAuth2.DefaultApplications) + assert.Equal(t, []string{"gitea-cli"}, OAuth2.DefaultApplications) cfg, _ = NewConfigProviderFromData(`[oauth2] DEFAULT_APPLICATIONS = diff --git a/templates/repo/clone_panel.tmpl b/templates/repo/clone_panel.tmpl index 24cc1bd31bc..4628c973026 100644 --- a/templates/repo/clone_panel.tmpl +++ b/templates/repo/clone_panel.tmpl @@ -13,7 +13,7 @@ {{if $showCloneLinks}}