123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296 |
- source _common.sh
- source /usr/share/yunohost/helpers
- ynh_clean_setup () {
- ### Remove this function if there's nothing to clean before calling the remove script.
- true
- }
- # Exit if an error occurs during the execution of the script
- ynh_abort_if_errors
- #=================================================
- # RETRIEVE ARGUMENTS FROM THE MANIFEST
- #=================================================
- 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
- password=$YNH_APP_ARG_PASSWORD
- ### If it's a multi-instance app, meaning it can be installed several times independently
- app=$YNH_APP_INSTANCE_NAME
- final_path=/var/www/$app
- test ! -e "$final_path" || ynh_die "This path already contains a folder"
- path_url=$(ynh_normalize_url_path $path_url)
- ynh_webpath_register $app $domain $path_url
- 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_add_nginx_config
- ynh_system_user_create $app
- ynh_add_fpm_config
- ynh_add_systemd_config
- chown -R $app: $final_path
- ynh_app_setting_set $app skipped_uris "/"
- yunohost app ssowatconf
- systemctl reload nginx
- ynh_local_curl "/INSTALL_PATH" "key1=value1" "key2=value2" "key3=value3"
- if [ $is_public -eq 0 ]
- then
- ynh_app_setting_delete $app skipped_uris
- fi
- ynh_replace_string "match_string" "replace_string" "$final_path/CONFIG_FILE"
- ynh_store_file_checksum "$final_path/CONFIG_FILE"
- chown -R root: $final_path
- ynh_use_logrotate
- yunohost service add $app --log "/var/log/$app/APP.log"
- 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
|