From 497912f9d52b7c43191e4e10e57886749564b4cd Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 11 Nov 2021 21:38:06 +0700 Subject: [PATCH] Update install --- scripts/install | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/scripts/install b/scripts/install index edf00cb..4486b09 100755 --- a/scripts/install +++ b/scripts/install @@ -63,6 +63,7 @@ fi minio_domain=$(ynh_app_setting_get --app="minio" --key=domain) minio_id=$(ynh_app_setting_get --app="minio" --key=minio_id) minio_key=$(ynh_app_setting_get --app="minio" --key=minio_key) +mc_path=$(ynh_app_setting_get --app="minio" --key=mc_path) #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS @@ -72,8 +73,6 @@ ynh_script_progression --message="Validating installation parameters..." --time final_path=/opt/yunohost/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" -mc_path=$final_path/mc - # Register (book) web path ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url @@ -153,31 +152,15 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" -#================================================= -# DOWNLOAD, CHECK AND UNPACK MINIO CLIENT -#================================================= -ynh_script_progression --message="Setting up MinIO client..." --time --weight=1 - -ynh_setup_source --dest_dir="$mc_path" --source_id=mc - -# FIXME: this should be managed by the core in the future -# Here, as a packager, you may have to tweak the ownerhsip/permissions -# such that the appropriate users (e.g. maybe www-data) can access -# files in some cases. -# But FOR THE LOVE OF GOD, do not allow r/x for "others" on the entire folder - -# this will be treated as a security issue. -chmod -R 750 "$mc_path" -chmod -R o-rwx "$mc_path" -chown -R $app:www-data "$mc_path" - #================================================= # SETUP MINIO BUCKET #================================================= ynh_script_progression --message="Setting up MinIO bucket for Outline..." --time --weight=1 -$mc_path/mc alias set minio "https://$minio_domain" $minio_id $minio_key -$mc_path/mc mb minio/outlinestorage --region "fr-ynh-1" -$mc_path/mc policy set public minio/outlinestorage +pushd "$mc_path" + ynh_exec_warn_less sudo -u minio ./mc mb minio/outlinestorage --region "fr-ynh-1" + ynh_exec_warn_less sudo -u minio ./mc policy set public minio/outlinestorage +popd #================================================= # NGINX CONFIGURATION