From 3e148db28147bda310f89246bdd2382ab0020ca0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Sat, 26 Oct 2019 22:53:02 +0200 Subject: [PATCH] Add allow an access to git command if the app is not public --- manifest.json | 6 +++++- scripts/_common.sh | 11 +---------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/manifest.json b/manifest.json index bb59c10..c9de272 100644 --- a/manifest.json +++ b/manifest.json @@ -56,9 +56,13 @@ "name": "is_public", "type": "boolean", "ask": { - "en": "Is it a public site ?", + "en": "Is it a public site ? ", "fr": "Est-ce un site public ?" }, + "help": { + "en": "A public server means that everybody is able to access to the pain page of the forge, on the public profile of the user and on the public repository. But you still can limit the access to each repository if you set it as private. Note that to be able to use the remote git command (clone, pull, push) with http and to use the API by (by example with a smartphone), you need to set this application as public.", + "fr": "Un serveur publique signifie que n'importe qui peut accéder à la page principale de la forge, au profil publique des utilisateur et au dépots publiques Mais vous pouvez définir les dépot en tant que privé. Notez que pour pouvoir utiliser les commandes git distante (clone, pull, push) avec http et pour pouvoir utiliser l'API (par exemple avec un smartphone), vous devez mettre cette application en tant que publique." + }, "default": true } ] diff --git a/scripts/_common.sh b/scripts/_common.sh index 7f70aa1..d6e5689 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -91,15 +91,6 @@ set_access_settings() { then ynh_app_setting_set --app $app --key unprotected_uris --value "/" else - # For an access to the git server by https in private mode we need to allow the access to theses URL : - # - "DOMAIN/PATH/USER/REPOSITORY/info/refs" - # - "DOMAIN/PATH/USER/REPOSITORY/git-upload-pack" - # - "DOMAIN/PATH/USER/REPOSITORY/git-receive-pack" - - excaped_domain=${domain//'.'/'%.'} - excaped_domain=${excaped_domain//'-'/'%-'} - excaped_path=${path_url//'.'/'%.'} - excaped_path=${excaped_path//'-'/'%-'} - ynh_app_setting_set --app $app --key skipped_regex --value "$excaped_domain$excaped_path/[%w-.]*/[%w-.]*/git%-receive%-pack,$excaped_domain$excaped_path/[%w-.]*/[%w-.]*/git%-upload%-pack,$excaped_domain$excaped_path/[%w-.]*/[%w-.]*/info/refs" + ynh_app_setting_delete --app $app --key skipped_regex fi }