1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/cinny_ynh.git synced 2024-09-03 18:16:13 +02:00

Ensure Cinny is always installed on a domain root

This commit is contained in:
Salamandar 2021-09-18 22:08:45 +02:00 committed by Salamandar
parent 2569a7cb89
commit 53d1d56e20
5 changed files with 29 additions and 9 deletions

View file

@ -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

View file

@ -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",

View file

@ -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
#=================================================

View file

@ -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
#=================================================

View file

@ -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
#=================================================