From 4f6d3c426ab5159230b017b1b23ea8e9bfe0a8f9 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Tue, 23 Nov 2021 21:22:22 +0000 Subject: [PATCH 1/2] Allow tilde in username/organization for repo URLs --- src/yunohost/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/yunohost/app.py b/src/yunohost/app.py index 649110267..f6d940da8 100644 --- a/src/yunohost/app.py +++ b/src/yunohost/app.py @@ -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 = [ From 6a8aa333eac7eada56f24f86771b30060f7fb66b Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 23 Nov 2021 23:11:37 +0100 Subject: [PATCH 2/2] appurl: Add test for app url containing tilde --- src/yunohost/tests/test_appurl.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/yunohost/tests/test_appurl.py b/src/yunohost/tests/test_appurl.py index 7b4c6e2e3..00bfe5c58 100644 --- a/src/yunohost/tests/test_appurl.py +++ b/src/yunohost/tests/test_appurl.py @@ -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")