1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/outline_ynh.git synced 2024-09-03 19:56:12 +02:00

Few tweaks to have CI running

This commit is contained in:
Limezy 2021-11-17 12:44:22 +07:00
parent 1bb2431c24
commit cdb354a578
4 changed files with 29 additions and 19 deletions

View file

@ -57,13 +57,15 @@ ynh_print_info --message="Declaring files to be backed up..."
# BACKUP MINIO
#=================================================
pushd "$mc_path"
ynh_exec_warn_less sudo -u minio mkdir outlinestorage
ynh_exec_warn_less sudo -u minio ./mc mirror --a minio/outlinestorage ./outlinestorage/
popd
if $minio_domain != "sub.domain.tld"; then
pushd "$mc_path"
ynh_exec_warn_less sudo -u minio mkdir outlinestorage
ynh_exec_warn_less sudo -u minio ./mc mirror --a minio/outlinestorage ./outlinestorage/
popd
mv "$mc_path/outlinestorage" "$final_path/outlinestorage"
chown -R outline:www-data "$final_path/outlinestorage"
mv "$mc_path/outlinestorage" "$final_path/outlinestorage"
chown -R outline:www-data "$final_path/outlinestorage"
fi
#=================================================
# BACKUP THE APP MAIN DIR

View file

@ -57,7 +57,9 @@ if ! yunohost app list | grep -q "id: minio"; then
if yunohost app list | grep -q "$YNH_APP_ARG_MINIO_DOMAIN"; then
ynh_die "The domain provided for MinIO is already used by another app. Please chose another one !"
fi
yunohost app install https://github.com/limezy/minio_ynh --force --args "domain=$YNH_APP_ARG_MINIO_DOMAIN&is_public=true&language=en"
if $YNH_APP_ARG_MINIO_DOMAIN != "sub.domain.tld"; then
yunohost app install https://github.com/limezy/minio_ynh --force --args "domain=$YNH_APP_ARG_MINIO_DOMAIN&is_public=true&language=en"
fi
fi
minio_domain=$(ynh_app_setting_get --app="minio" --key=domain)
@ -154,10 +156,12 @@ chown -R $app:www-data "$final_path"
#=================================================
ynh_script_progression --message="Setting up MinIO bucket for Outline..." --weight=1
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
if $minio_domain != "sub.domain.tld"; then
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
fi
#=================================================
# NGINX CONFIGURATION

View file

@ -91,9 +91,11 @@ ynh_secure_remove --file="$final_path"
#=================================================
ynh_script_progression --message="Removing Outline MinIO bucket..." --time --weight=1
pushd "$mc_path"
ynh_exec_warn_less sudo -u minio ./mc rb minio/outlinestorage --force
popd
if $minio_domain != "sub.domain.tld"; then
pushd "$mc_path"
ynh_exec_warn_less sudo -u minio ./mc rb minio/outlinestorage --force
popd
fi
#=================================================
# REMOVE NGINX CONFIGURATION

View file

@ -92,14 +92,16 @@ chown -R $app:www-data "$final_path"
# RESTORE MINIO
#=================================================
if $minio_domain != "sub.domain.tld"; then
mv "$final_path/outlinestorage" "$mc_path/outlinestorage"
chown -R minio:www-data "$mc_path/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
ynh_exec_warn_less sudo -u minio ./mc mirror --a ./outlinestorage/ minio/outlinestorage
popd
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
ynh_exec_warn_less sudo -u minio ./mc mirror --a ./outlinestorage/ minio/outlinestorage
popd
ynh_secure_remove --file="$mc_path/outlinestorage"
fi
#=================================================
# SPECIFIC RESTORATION