1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-15 23:17:19 +00:00

Re-enable import local paths after reversion from #13610 (#14925) (#14927)

Backport #14925

PR #13610 unfortunately disabled importing repositories from local paths.
This PR restores this functionality.

Fix #14700

Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
zeripath
2021-03-08 13:50:57 +00:00
committed by GitHub
parent 75496b9ff5
commit 906ecfd173
2 changed files with 19 additions and 0 deletions

View File

@@ -52,6 +52,13 @@ func isMigrateURLAllowed(remoteURL string) error {
}
}
if u.Host == "" {
if !setting.ImportLocalPaths {
return &models.ErrMigrationNotAllowed{Host: "<LOCAL_FILESYSTEM>"}
}
return nil
}
if !setting.Migrations.AllowLocalNetworks {
addrList, err := net.LookupIP(strings.Split(u.Host, ":")[0])
if err != nil {