diff --git a/check_process b/check_process index fefa192..8e42659 100644 --- a/check_process +++ b/check_process @@ -6,15 +6,11 @@ ;; Test complet ; Manifest domain="domain.tld" - path="/path" - admin="john" - language="fr" + path="/" is_public=1 - password="1Strong-Password" - port="666" ; Checks pkg_linter=1 - setup_sub_dir=1 + setup_sub_dir=0 setup_root=1 setup_nourl=0 setup_private=1 @@ -24,7 +20,7 @@ backup_restore=1 multi_instance=1 port_already_use=0 - change_url=1 + change_url=0 ;;; Options Email= Notification=none diff --git a/manifest.json b/manifest.json index 3c40935..c1ae03c 100644 --- a/manifest.json +++ b/manifest.json @@ -37,8 +37,12 @@ { "name": "path", "type": "path", - "example": "/cinny", - "default": "/cinny" + "example": "/", + "default": "/", + "help": { + "en": "Cinny only supports to be installed on / for now.", + "fr": "Cinny ne peut être installé que à la racine pour le moment." + } }, { "name": "is_public", diff --git a/scripts/_common.sh b/scripts/_common.sh index 51b7f40..69bad41 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -11,6 +11,14 @@ nodejs_version=14 # PERSONAL HELPERS #================================================= +ynh_webpath_is_domain_root () { + local -A args_array=( [p]=path_url= ) + local path_url + ynh_handle_getopts_args "$@" + + [[ "$path_url" != "/" ]] && [[ "$path_url" != "" ]] +} + #================================================= # EXPERIMENTAL HELPERS #================================================= diff --git a/scripts/change_url b/scripts/change_url index 1c9d1c3..43c7b65 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -62,6 +62,12 @@ then change_path=1 fi + +if ynh_webpath_is_domain_root -p "$new_path"; then + ynh_print_err "Cinny can only be installed on a domain root !" + ynh_die "Aborting." +fi + #================================================= # STANDARD MODIFICATIONS #================================================= diff --git a/scripts/install b/scripts/install index db2d5ef..1b8819b 100755 --- a/scripts/install +++ b/scripts/install @@ -35,6 +35,12 @@ final_path=/var/www/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" # Register (book) web path + +if ynh_webpath_is_domain_root -p "$path_url"; then + ynh_print_err "Cinny can only be installed on a domain root !" + ynh_die "Aborting." +fi + ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url #=================================================