Merge pull request #1382 from YunoHost/fix-app-address-regex

Allow tilde in username/organization for repo URLs
This commit is contained in:
Alexandre Aubin 2021-11-23 23:12:00 +01:00 committed by GitHub
commit 04ebf2740d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View file

@ -79,7 +79,7 @@ re_app_instance_name = re.compile(
)
APP_REPO_URL = re.compile(
r"^https://[a-zA-Z0-9-_.]+/[a-zA-Z0-9-_./]+/[a-zA-Z0-9-_.]+_ynh(/?(-/)?tree/[a-zA-Z0-9-_.]+)?(\.git)?/?$"
r"^https://[a-zA-Z0-9-_.]+/[a-zA-Z0-9-_./~]+/[a-zA-Z0-9-_.]+_ynh(/?(-/)?tree/[a-zA-Z0-9-_.]+)?(\.git)?/?$"
)
APP_FILES_TO_COPY = [

View file

@ -70,6 +70,7 @@ def test_repo_url_definition():
)
assert _is_app_repo_url("https://github.com/YunoHost-Apps/foobar_ynh/tree/1.23.4")
assert _is_app_repo_url("git@github.com:YunoHost-Apps/foobar_ynh.git")
assert _is_app_repo_url("https://git.super.host/~max/foobar_ynh")
assert not _is_app_repo_url("github.com/YunoHost-Apps/foobar_ynh")
assert not _is_app_repo_url("http://github.com/YunoHost-Apps/foobar_ynh")