123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202 |
- source _common.sh
- source /usr/share/yunohost/helpers
- ynh_abort_if_errors
- domain=$YNH_APP_ARG_DOMAIN
- path_url=$YNH_APP_ARG_PATH
- admin=$YNH_APP_ARG_ADMIN
- is_public=$YNH_APP_ARG_IS_PUBLIC
- language=$YNH_APP_ARG_LANGUAGE
- app=$YNH_APP_INSTANCE_NAME
- path_url=$(ynh_normalize_url_path $path_url)
- ynh_webpath_available $domain $path_url
- ynh_webpath_register $app $domain $path_url
- final_path=/var/www/$app
- test ! -e "$final_path" || ynh_die "This path already contains a folder"
- ynh_app_setting_set $app domain $domain
- ynh_app_setting_set $app path $path_url
- ynh_app_setting_set $app admin $admin
- ynh_app_setting_set $app is_public $is_public
- ynh_app_setting_set $app language $language
- port=$(ynh_find_port 8095)
- yunohost firewall allow --no-upnp TCP $port 2>&1
- ynh_app_setting_set $app port $port
- ynh_install_app_dependencies deb1 deb2
- db_name=$(ynh_sanitize_dbid $app)
- ynh_app_setting_set $app db_name $db_name
- ynh_mysql_setup_db $db_name $db_name
- ynh_app_setting_set $app final_path $final_path
- ynh_setup_source "$final_path"
- ynh_nginx_config
- ynh_system_user_create $app
- ynh_fpm_config
- ynh_systemd_config
- chown -R $app: $final_path
- ynh_app_setting_set $app unprotected_uris "/"
- yunohost app ssowatconf
- systemctl reload nginx
- ynh_local_curl "/INSTALL_PATH" "key1=value1" "key2=value2" "key3=value3"
- ynh_store_file_checksum "$final_path/CONFIG_FILE"
- chown -R root: $final_path
- ynh_use_logrotate
- yunohost service add NAME_INIT.D --log "/var/log/FILE.log"
- if [ $is_public -eq 0 ]
- then # Remove the public access
- ynh_app_setting_delete $app skipped_uris
- fi
- if [ $is_public -eq 1 ]
- then
- # unprotected_uris allows SSO credentials to be passed anyway.
- ynh_app_setting_set $app unprotected_uris "/"
- fi
- systemctl reload nginx
|