[FEAT] add Forgero Git Service
Signed-off-by: cassiozareck <cassiomilczareck@gmail.com> (cherry picked from commita878adfe62
) Adding description and Forgejo SVG (cherry picked from commit13738c0380
) Undo reordering and tmpl redirection (cherry picked from commit9ae51c46f4
) (cherry picked from commit70fffdc61d
) (cherry picked from commitc0ebfa9da3
) (cherry picked from commit9922c92787
) (cherry picked from commit00c0effbc7
) (cherry picked from commite4c9525b13
) (cherry picked from commit09d7b83211
) (cherry picked from commitbbcd5975c9
) (cherry picked from commit55c70a0e18
) (cherry picked from commit0a55a2f382
) (cherry picked from commitae6b468516
) (cherry picked from commit76adcdff43
) (cherry picked from commit2934f1c7d6
) (cherry picked from commit59871154e9
)
This commit is contained in:
parent
d2e1734394
commit
5ef52a873e
7 changed files with 29 additions and 1 deletions
|
@ -287,6 +287,7 @@ const (
|
||||||
OneDevService // 6 onedev service
|
OneDevService // 6 onedev service
|
||||||
GitBucketService // 7 gitbucket service
|
GitBucketService // 7 gitbucket service
|
||||||
CodebaseService // 8 codebase service
|
CodebaseService // 8 codebase service
|
||||||
|
ForgejoService // 9 forgejo service
|
||||||
)
|
)
|
||||||
|
|
||||||
// Name represents the service type's name
|
// Name represents the service type's name
|
||||||
|
@ -312,6 +313,8 @@ func (gt GitServiceType) Title() string {
|
||||||
return "GitBucket"
|
return "GitBucket"
|
||||||
case CodebaseService:
|
case CodebaseService:
|
||||||
return "Codebase"
|
return "Codebase"
|
||||||
|
case ForgejoService:
|
||||||
|
return "Forgejo"
|
||||||
case PlainGitService:
|
case PlainGitService:
|
||||||
return "Git"
|
return "Git"
|
||||||
}
|
}
|
||||||
|
@ -353,7 +356,7 @@ type MigrateRepoOptions struct {
|
||||||
// TokenAuth represents whether a service type supports token-based auth
|
// TokenAuth represents whether a service type supports token-based auth
|
||||||
func (gt GitServiceType) TokenAuth() bool {
|
func (gt GitServiceType) TokenAuth() bool {
|
||||||
switch gt {
|
switch gt {
|
||||||
case GithubService, GiteaService, GitlabService:
|
case GithubService, GiteaService, GitlabService, ForgejoService:
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
@ -364,6 +367,7 @@ func (gt GitServiceType) TokenAuth() bool {
|
||||||
var SupportedFullGitService = []GitServiceType{
|
var SupportedFullGitService = []GitServiceType{
|
||||||
GithubService,
|
GithubService,
|
||||||
GitlabService,
|
GitlabService,
|
||||||
|
ForgejoService,
|
||||||
GiteaService,
|
GiteaService,
|
||||||
GogsService,
|
GogsService,
|
||||||
OneDevService,
|
OneDevService,
|
||||||
|
|
|
@ -1088,6 +1088,7 @@ migrate.migrating_failed_no_addr = Migration failed.
|
||||||
migrate.github.description = Migrate data from github.com or other GitHub instances.
|
migrate.github.description = Migrate data from github.com or other GitHub instances.
|
||||||
migrate.git.description = Migrate a repository only from any Git service.
|
migrate.git.description = Migrate a repository only from any Git service.
|
||||||
migrate.gitlab.description = Migrate data from gitlab.com or other GitLab instances.
|
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.gitea.description = Migrate data from gitea.com or other Gitea instances.
|
||||||
migrate.gogs.description = Migrate data from notabug.org or other Gogs 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.
|
migrate.onedev.description = Migrate data from code.onedev.io or other OneDev instances.
|
||||||
|
|
9
public/assets/img/svg/gitea-forgejo.svg
generated
Normal file
9
public/assets/img/svg/gitea-forgejo.svg
generated
Normal 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 |
|
@ -36,6 +36,8 @@ func ToGitServiceType(value string) structs.GitServiceType {
|
||||||
return structs.OneDevService
|
return structs.OneDevService
|
||||||
case "gitbucket":
|
case "gitbucket":
|
||||||
return structs.GitBucketService
|
return structs.GitBucketService
|
||||||
|
case "forgejo":
|
||||||
|
return structs.ForgejoService
|
||||||
default:
|
default:
|
||||||
return structs.PlainGitService
|
return structs.PlainGitService
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,8 @@ func TestToGitServiceType(t *testing.T) {
|
||||||
typ: "gitlab", enum: 4,
|
typ: "gitlab", enum: 4,
|
||||||
}, {
|
}, {
|
||||||
typ: "gogs", enum: 5,
|
typ: "gogs", enum: 5,
|
||||||
|
}, {
|
||||||
|
typ: "forgejo", enum: 9,
|
||||||
}, {
|
}, {
|
||||||
typ: "trash", enum: 1,
|
typ: "trash", enum: 1,
|
||||||
}}
|
}}
|
||||||
|
|
1
templates/repo/migrate/forgejo.tmpl
Normal file
1
templates/repo/migrate/forgejo.tmpl
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{{template "repo/migrate/gitea" .}}
|
9
web_src/svg/gitea-forgejo.svg
Normal file
9
web_src/svg/gitea-forgejo.svg
Normal 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 |
Loading…
Reference in a new issue