diff --git a/assets/src/bundles/save/index.js b/assets/src/bundles/save/index.js --- a/assets/src/bundles/save/index.js +++ b/assets/src/bundles/save/index.js @@ -358,7 +358,7 @@ } if (validUrl) { - const allowedProtocols = ['http:', 'https:', 'svn:', 'git:']; + const allowedProtocols = ['http:', 'https:', 'svn:', 'git:', 'rsync:', 'pserver:', 'ssh:']; validUrl = ( allowedProtocols.find(protocol => protocol === originUrl.protocol) !== undefined ); diff --git a/cypress/integration/origin-save.spec.js b/cypress/integration/origin-save.spec.js --- a/cypress/integration/origin-save.spec.js +++ b/cypress/integration/origin-save.spec.js @@ -19,8 +19,8 @@ 'csrfError': 'CSRF Failed: Referrer checking failed - no Referrer.' }; -const anonymousVisitTypes = ['git', 'hg', 'svn']; -const allVisitTypes = ['archives', 'git', 'hg', 'svn']; +const anonymousVisitTypes = ['cvs', 'git', 'hg', 'svn']; +const allVisitTypes = ['archives', 'cvs', 'git', 'hg', 'svn']; function makeOriginSaveRequest(originType, originUrl) { cy.get('#swh-input-origin-url') diff --git a/swh/web/common/origin_save.py b/swh/web/common/origin_save.py --- a/swh/web/common/origin_save.py +++ b/swh/web/common/origin_save.py @@ -121,7 +121,12 @@ # map visit type to scheduler task # TODO: do not hardcode the task name here (T1157) -_visit_type_task = {"git": "load-git", "hg": "load-hg", "svn": "load-svn"} +_visit_type_task = { + "git": "load-git", + "hg": "load-hg", + "svn": "load-svn", + "cvs": "load-cvs", +} _visit_type_task_privileged = { "archives": "load-archive-files", @@ -203,7 +208,9 @@ ) -_validate_url = URLValidator(schemes=["http", "https", "svn", "git"]) +_validate_url = URLValidator( + schemes=["http", "https", "svn", "git", "rsync", "pserver", "ssh"] +) def _check_origin_url_valid(origin_url: str) -> None: diff --git a/swh/web/templates/misc/origin-save.html b/swh/web/templates/misc/origin-save.html --- a/swh/web/templates/misc/origin-save.html +++ b/swh/web/templates/misc/origin-save.html @@ -85,6 +85,9 @@
git
, for origins using Githg
, for origins using Mercurialsvn
, for origins using Subversioncvs
, for origins using CVS