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>
10 lines
363 B
Handlebars
10 lines
363 B
Handlebars
{{$allowImportLocal := $.AllowImportLocal}}
|
|
<div class="inline required field">
|
|
<label>{{ctx.Locale.Tr "repo.migrate.clone_address"}}</label>
|
|
<input name="clone_addr" autofocus required>
|
|
<span class="help">
|
|
{{ctx.Locale.Tr "repo.migrate.clone_address_desc"}}
|
|
{{if $allowImportLocal}}{{ctx.Locale.Tr "repo.migrate.clone_local_path"}}{{end}}
|
|
</span>
|
|
</div>
|