[FEAT] add Forgero Git Service

Signed-off-by: cassiozareck <cassiomilczareck@gmail.com>
(cherry picked from commit a878adfe628cf6dc367a17c3715fcd3499aa02b6)

Adding description and Forgejo SVG

(cherry picked from commit 13738c03804d019f28550e46a4ebc37dbe3a5cfc)

Undo reordering and tmpl redirection

(cherry picked from commit 9ae51c46f42acecac834371857e638098ebf6d27)
(cherry picked from commit 70fffdc61d06dd1d70b6a31496676a23d3d0c2fc)
(cherry picked from commit c0ebfa9da3db3e60d7b403a1bf8b8a19c32c5dc7)
(cherry picked from commit 9922c92787eccaba0021486ba0a3eb28583969e1)
(cherry picked from commit 00c0effbc74aedc7a4167a69c8a410ef324d576b)
(cherry picked from commit e4c9525b137205fa9ffdb4e0d7492bbbda9be6b5)
(cherry picked from commit 09d7b83211652d045975b0e3bb790856267d52a5)
(cherry picked from commit bbcd5975c91f6932f7f2ee07fbd63e84560ba96a)
(cherry picked from commit 55c70a0e18d33d8ac0da9ffb97f6d994ed88a319)
(cherry picked from commit 0a55a2f38268ec47185ab60ba629d7267aeb9f4e)
(cherry picked from commit ae6b468516a24b214a29ae1e54d016fcf28b0277)
(cherry picked from commit 76adcdff4345a28003875f22a645299b3701a454)
(cherry picked from commit 2934f1c7d6fe7e891a45949726010f441da1fc0d)
(cherry picked from commit 59871154e92893a60835c5516e1a04640a8bb13c)
This commit is contained in:
cassiozareck 2023-08-14 16:52:44 -03:00 committed by Earl Warren
parent d2e1734394
commit 5ef52a873e
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
7 changed files with 29 additions and 1 deletions

View file

@ -287,6 +287,7 @@ const (
OneDevService // 6 onedev service
GitBucketService // 7 gitbucket service
CodebaseService // 8 codebase service
ForgejoService // 9 forgejo service
)
// Name represents the service type's name
@ -312,6 +313,8 @@ func (gt GitServiceType) Title() string {
return "GitBucket"
case CodebaseService:
return "Codebase"
case ForgejoService:
return "Forgejo"
case PlainGitService:
return "Git"
}
@ -353,7 +356,7 @@ type MigrateRepoOptions struct {
// TokenAuth represents whether a service type supports token-based auth
func (gt GitServiceType) TokenAuth() bool {
switch gt {
case GithubService, GiteaService, GitlabService:
case GithubService, GiteaService, GitlabService, ForgejoService:
return true
}
return false
@ -364,6 +367,7 @@ func (gt GitServiceType) TokenAuth() bool {
var SupportedFullGitService = []GitServiceType{
GithubService,
GitlabService,
ForgejoService,
GiteaService,
GogsService,
OneDevService,

View file

@ -1088,6 +1088,7 @@ migrate.migrating_failed_no_addr = Migration failed.
migrate.github.description = Migrate data from github.com or other GitHub instances.
migrate.git.description = Migrate a repository only from any Git service.
migrate.gitlab.description = Migrate data from gitlab.com or other GitLab instances.
migrate.forgejo.description = Migrate data from codeberg.org or other Forgejo instances.
migrate.gitea.description = Migrate data from gitea.com or other Gitea instances.
migrate.gogs.description = Migrate data from notabug.org or other Gogs instances.
migrate.onedev.description = Migrate data from code.onedev.io or other OneDev instances.

9
public/assets/img/svg/gitea-forgejo.svg generated Normal file
View file

@ -0,0 +1,9 @@
<svg width="32" height="32" viewBox="-15 0 256 256" xmlns="http://www.w3.org/2000/svg">
<g transform="translate(28,28)">
<path d="M58 168 v-98 a50 50 0 0 1 50-50 h20" fill="none" stroke="#ff6600" stroke-width="25" />
<path d="M58 168 v-30 a50 50 0 0 1 50-50 h20" fill="none" stroke="#d40000" stroke-width="25" />
<circle cx="142" cy="20" r="18" fill="none" stroke="#ff6600" stroke-width="15" />
<circle cx="142" cy="88" r="18" fill="none" stroke="#d40000" stroke-width="15" />
<circle cx="58" cy="180" r="18" fill="none" stroke="#d40000" stroke-width="15" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 595 B

View file

@ -36,6 +36,8 @@ func ToGitServiceType(value string) structs.GitServiceType {
return structs.OneDevService
case "gitbucket":
return structs.GitBucketService
case "forgejo":
return structs.ForgejoService
default:
return structs.PlainGitService
}

View file

@ -28,6 +28,8 @@ func TestToGitServiceType(t *testing.T) {
typ: "gitlab", enum: 4,
}, {
typ: "gogs", enum: 5,
}, {
typ: "forgejo", enum: 9,
}, {
typ: "trash", enum: 1,
}}

View file

@ -0,0 +1 @@
{{template "repo/migrate/gitea" .}}

View file

@ -0,0 +1,9 @@
<svg width="64" height="64" viewBox="0 0 256 256" xmlns="http://www.w3.org/2000/svg" class="forgejo-logo" aria-hidden="true">
<g transform="translate(28,28)">
<path d="M58 168 v-98 a50 50 0 0 1 50-50 h20" fill="none" stroke="#ff6600" stroke-width="25" />
<path d="M58 168 v-30 a50 50 0 0 1 50-50 h20" fill="none" stroke="#d40000" stroke-width="25" />
<circle cx="142" cy="20" r="18" fill="none" stroke="#ff6600" stroke-width="15" />
<circle cx="142" cy="88" r="18" fill="none" stroke="#d40000" stroke-width="15" />
<circle cx="58" cy="180" r="18" fill="none" stroke="#d40000" stroke-width="15" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 633 B