diff --git a/conf/nginx.conf b/conf/nginx.conf index a5de8c9..424f2e0 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -9,11 +9,11 @@ location __PATH__/ { rewrite ^ https://$server_name$request_uri? permanent; } - location ^~ __PATH__/data { + location ^~ __PATH__/app/data { deny all; } - location ^~ __PATH__/pgpback/keys { + location ^~ __PATH__/app/pgpback/keys { deny all; } ### Example PHP configuration (remove it if not used) diff --git a/scripts/install b/scripts/install index b6cd382..95e2d17 100644 --- a/scripts/install +++ b/scripts/install @@ -24,11 +24,6 @@ ynh_abort_if_errors # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= - - rainloop_version=$(cat ../sources/rainloop_version) - - - # Retrieve arguments domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH @@ -58,6 +53,8 @@ app=$YNH_APP_INSTANCE_NAME ### If the app provides an internal web server (or uses another application server such as uwsgi), the final path should be "/opt/yunohost/$app" final_path=/var/www/$app test ! -e "$final_path" || ynh_die "This path already contains a folder" +rainloop_path=${final_path}/app + # Normalize the url path syntax path_url=$(ynh_normalize_url_path $path_url) @@ -132,8 +129,9 @@ ynh_mysql_setup_db $db_name $db_name ### `ynh_setup_source` use the file conf/app.src ynh_app_setting_set $app final_path $final_path +ynh_app_setting_set $app rainloop_path $rainloop_path # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source "$final_path" +ynh_setup_source "$rainloop_path" #================================================= # NGINX CONFIGURATION @@ -176,29 +174,29 @@ ynh_add_fpm_config #================================================= # Install plugins - sudo mkdir -p $final_path/data/_data_/_default_/plugins - sudo cp -rf ../sources/plugins/auto-domain-grab $final_path/data/_data_/_default_/plugins/. - sudo cp -rf ../sources/plugins/ynh-login-mapping $final_path/data/_data_/_default_/plugins/. - sudo cp -rf ../sources/plugins/ynh-ldap-suggestions $final_path/data/_data_/_default_/plugins/. + sudo mkdir -p $rainloop_path/data/_data_/_default_/plugins + sudo cp -rf ../sources/plugins/auto-domain-grab $rainloop_path/data/_data_/_default_/plugins/. + sudo cp -rf ../sources/plugins/ynh-login-mapping $rainloop_path/data/_data_/_default_/plugins/. + sudo cp -rf ../sources/plugins/ynh-ldap-suggestions $rainloop_path/data/_data_/_default_/plugins/. # Autoconfig - sudo mkdir -p $final_path/data/_data_/_default_/configs/ - application_file=$final_path/data/_data_/_default_/configs/application.ini + sudo mkdir -p $rainloop_path/data/_data_/_default_/configs/ + application_file=$rainloop_path/data/_data_/_default_/configs/application.ini sudo cp ../conf/data/configs/application.ini $application_file # Set admin password - sudo php ../conf/config.php --index="$final_path/index.php" --password="$password" + sudo php ../conf/config.php --index="$rainloop_path/index.php" --password="$password" ynh_app_setting_set "$app" password "$password" # Add default domain configs by looping through all the domains already added - sudo mkdir -p $final_path/data/_data_/_default_/domains/ + sudo mkdir -p $rainloop_path/data/_data_/_default_/domains/ # get list of ldap domains alldomains=`ldapsearch -LLL -x -b ou=domains,dc=yunohost,dc=org -s one "objectclass=top" virtualdomain | grep -v "dn:" | sed "s/virtualdomain://" ` for ldomain in $alldomains ; do - sudo cp ../conf/data/domains/domain.tld.ini $final_path/data/_data_/_default_/domains/$ldomain.ini + sudo cp ../conf/data/domains/domain.tld.ini $rainloop_path/data/_data_/_default_/domains/$ldomain.ini done # Add wildcard domain for auto-grab - sudo cp ../conf/data/domains/default.ini $final_path/data/_data_/_default_/domains/default.ini + sudo cp ../conf/data/domains/default.ini $rainloop_path/data/_data_/_default_/domains/default.ini # Install SSO - at the moment the index is the SSO and rainloop is installed in /app sudo cp ../sources/sso/sso.php $final_path/index.php diff --git a/sources/sso/sso.php b/sources/sso/sso.php index a6a5468..8193dc5 100644 --- a/sources/sso/sso.php +++ b/sources/sso/sso.php @@ -1,24 +1,9 @@