123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157 |
- source _common.sh
- source /usr/share/yunohost/helpers
- app=$YNH_APP_INSTANCE_NAME
- domain=$(ynh_app_setting_get $app domain)
- path_url=$(ynh_app_setting_get $app path)
- admin=$(ynh_app_setting_get $app admin)
- is_public=$(ynh_app_setting_get $app is_public)
- final_path=$(ynh_app_setting_get $app final_path)
- language=$(ynh_app_setting_get $app language)
- db_name=$(ynh_app_setting_get $app db_name)
- if [ "$is_public" = "Yes" ]; then
- ynh_app_setting_set $app is_public 1
- is_public=1
- elif [ "$is_public" = "No" ]; then
- ynh_app_setting_set $app is_public 0
- is_public=0
- fi
- if [ -z $db_name ]; then
- db_name=$(ynh_sanitize_dbid $app)
- ynh_app_setting_set $app db_name $db_name
- fi
- if [ -z $final_path ]; then
- final_path=/var/www/$app
- ynh_app_setting_set $app final_path $final_path
- fi
- ynh_backup_before_upgrade
- ynh_clean_setup () {
- # restore it if the upgrade fails
- ynh_restore_upgradebackup
- }
- ynh_abort_if_errors
- path_url=$(ynh_normalize_url_path $path_url)
- ynh_setup_source "$final_path"
- ynh_add_nginx_config
- ynh_install_app_dependencies deb1 deb2
- ynh_system_user_create $app
- ynh_add_fpm_config
- ynh_backup_if_checksum_is_different "$final_path/CONFIG_FILE"
- ynh_store_file_checksum "$final_path/CONFIG_FILE"
- ynh_use_logrotate --non-append
- ynh_add_systemd_config
- chown -R root: $final_path
- 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
|