mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-28 16:47:01 +09:00
Only the plain git migration can clone from a local server path. Other services (Gitea, GitLab, Gogs, OneDev, GitBucket, Codebase, CodeCommit, Bitbucket Server) are accessed through their remote API, so a local path never works, yet their migrate forms advertised "or a local server path". - Remove the local path hint from those templates. - Add `IsMigrateURLAllowedForService` and use it in the web and API migrate handlers and in `MigrateRepository`, rejecting local paths for any service other than plain git. - Add a unit test. Raised in review of #39913. _Authored with Codet (AI assistant) on behalf of @lunny._ --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
59 lines
2.1 KiB
Handlebars
59 lines
2.1 KiB
Handlebars
{{template "base/head" .}}
|
|
<div role="main" aria-label="{{.Title}}" class="page-content repository new migrate">
|
|
<div class="ui container medium-width">
|
|
<h3 class="ui top attached header">
|
|
{{ctx.Locale.Tr "repo.migrate.migrate" .service.Title}}
|
|
</h3>
|
|
<div class="ui attached segment">
|
|
{{template "base/alert" .}}
|
|
<form class="ui form left-right-form form-fetch-action" action="{{.Link}}" method="post">
|
|
{{template "repo/migrate/common-init" (dict "ServiceType" .service)}}
|
|
|
|
{{template "repo/migrate/common-clone-addr"}}
|
|
|
|
<div class="inline required field">
|
|
<label>{{ctx.Locale.Tr "repo.migrate.codecommit.aws_access_key_id"}}</label>
|
|
<input name="aws_access_key_id" required>
|
|
</div>
|
|
<div class="inline required field">
|
|
<label>{{ctx.Locale.Tr "repo.migrate.codecommit.aws_secret_access_key"}}</label>
|
|
<input name="aws_secret_access_key" type="password" required>
|
|
</div>
|
|
<div class="inline required field">
|
|
<label>{{ctx.Locale.Tr "repo.migrate.codecommit.https_git_credentials_username"}}</label>
|
|
<input name="auth_username" required>
|
|
</div>
|
|
<div class="inline required field">
|
|
<label>{{ctx.Locale.Tr "repo.migrate.codecommit.https_git_credentials_password"}}</label>
|
|
<input name="auth_password" type="password" required>
|
|
</div>
|
|
|
|
{{if not .DisableNewPullMirrors}}
|
|
<div class="inline field">
|
|
<label>{{ctx.Locale.Tr "repo.migrate_options"}}</label>
|
|
<div class="ui checkbox">
|
|
<input name="mirror" type="checkbox" {{if .mirror}} checked{{end}}>
|
|
<label>{{ctx.Locale.Tr "repo.migrate_options_mirror_helper"}}</label>
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
|
|
<div id="migrate_items">
|
|
<div class="inline field">
|
|
<label>{{ctx.Locale.Tr "repo.migrate_items"}}</label>
|
|
<div class="ui checkbox">
|
|
<input name="pull_requests" type="checkbox">
|
|
<label>{{ctx.Locale.Tr "repo.migrate_items_pullrequests"}}</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="divider"></div>
|
|
|
|
{{template "repo/migrate/common-migrated-repo"}}
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{template "base/footer" .}}
|