mirror of
https://github.com/YunoHost-Apps/outline_ynh.git
synced 2024-09-03 19:56:12 +02:00
Second test
This commit is contained in:
parent
916c2111a6
commit
4eb853d95d
6 changed files with 52 additions and 33 deletions
|
@ -38,10 +38,14 @@ slack_key=$(ynh_app_setting_get --app=$app --key=slack_key)
|
||||||
slack_secret=$(ynh_app_setting_get --app=$app --key=slack_secret)
|
slack_secret=$(ynh_app_setting_get --app=$app --key=slack_secret)
|
||||||
secret_key=$(ynh_app_setting_get --app=$app --key=secret_key)
|
secret_key=$(ynh_app_setting_get --app=$app --key=secret_key)
|
||||||
utils_secret=$(ynh_app_setting_get --app=$app --key=utils_secret)
|
utils_secret=$(ynh_app_setting_get --app=$app --key=utils_secret)
|
||||||
|
|
||||||
minio_domain=$(ynh_app_setting_get --app="minio" --key=domain)
|
minio_domain=$(ynh_app_setting_get --app="minio" --key=domain)
|
||||||
|
|
||||||
|
if [ $minio_domain != "sub.domain.tld" ]; then
|
||||||
minio_id=$(ynh_app_setting_get --app="minio" --key=minio_id)
|
minio_id=$(ynh_app_setting_get --app="minio" --key=minio_id)
|
||||||
minio_key=$(ynh_app_setting_get --app="minio" --key=minio_key)
|
minio_key=$(ynh_app_setting_get --app="minio" --key=minio_key)
|
||||||
mc_path=$(ynh_app_setting_get --app="minio" --key=mc_path)
|
mc_path=$(ynh_app_setting_get --app="minio" --key=mc_path)
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DECLARE DATA AND CONF FILES TO BACKUP
|
# DECLARE DATA AND CONF FILES TO BACKUP
|
||||||
|
@ -57,7 +61,7 @@ ynh_print_info --message="Declaring files to be backed up..."
|
||||||
# BACKUP MINIO
|
# BACKUP MINIO
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
if $minio_domain != "sub.domain.tld"; then
|
if [ $minio_domain != "sub.domain.tld" ]; then
|
||||||
pushd "$mc_path"
|
pushd "$mc_path"
|
||||||
ynh_exec_warn_less sudo -u minio mkdir outlinestorage
|
ynh_exec_warn_less sudo -u minio mkdir outlinestorage
|
||||||
ynh_exec_warn_less sudo -u minio ./mc mirror --a minio/outlinestorage ./outlinestorage/
|
ynh_exec_warn_less sudo -u minio ./mc mirror --a minio/outlinestorage ./outlinestorage/
|
||||||
|
|
|
@ -37,10 +37,14 @@ slack_key=$(ynh_app_setting_get --app=$app --key=slack_key)
|
||||||
slack_secret=$(ynh_app_setting_get --app=$app --key=slack_secret)
|
slack_secret=$(ynh_app_setting_get --app=$app --key=slack_secret)
|
||||||
secret_key=$(ynh_app_setting_get --app=$app --key=secret_key)
|
secret_key=$(ynh_app_setting_get --app=$app --key=secret_key)
|
||||||
utils_secret=$(ynh_app_setting_get --app=$app --key=utils_secret)
|
utils_secret=$(ynh_app_setting_get --app=$app --key=utils_secret)
|
||||||
|
|
||||||
minio_domain=$(ynh_app_setting_get --app="minio" --key=domain)
|
minio_domain=$(ynh_app_setting_get --app="minio" --key=domain)
|
||||||
|
|
||||||
|
if [ $minio_domain != "sub.domain.tld" ]; then
|
||||||
minio_id=$(ynh_app_setting_get --app="minio" --key=minio_id)
|
minio_id=$(ynh_app_setting_get --app="minio" --key=minio_id)
|
||||||
minio_key=$(ynh_app_setting_get --app="minio" --key=minio_key)
|
minio_key=$(ynh_app_setting_get --app="minio" --key=minio_key)
|
||||||
mc_path=$(ynh_app_setting_get --app="minio" --key=mc_path)
|
mc_path=$(ynh_app_setting_get --app="minio" --key=mc_path)
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP
|
# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP
|
||||||
|
|
|
@ -57,15 +57,15 @@ if ! yunohost app list | grep -q "id: minio"; then
|
||||||
if yunohost app list | grep -q "$YNH_APP_ARG_MINIO_DOMAIN"; 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 !"
|
ynh_die "The domain provided for MinIO is already used by another app. Please chose another one !"
|
||||||
fi
|
fi
|
||||||
if $YNH_APP_ARG_MINIO_DOMAIN != "sub.domain.tld"; then
|
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"
|
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)
|
minio_domain=$(ynh_app_setting_get --app="minio" --key=domain)
|
||||||
minio_id=$(ynh_app_setting_get --app="minio" --key=minio_id)
|
minio_id=$(ynh_app_setting_get --app="minio" --key=minio_id)
|
||||||
minio_key=$(ynh_app_setting_get --app="minio" --key=minio_key)
|
minio_key=$(ynh_app_setting_get --app="minio" --key=minio_key)
|
||||||
mc_path=$(ynh_app_setting_get --app="minio" --key=mc_path)
|
mc_path=$(ynh_app_setting_get --app="minio" --key=mc_path); else
|
||||||
|
minio_domain="sub.domain.tld"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
|
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
|
||||||
|
@ -156,7 +156,7 @@ chown -R $app:www-data "$final_path"
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Setting up MinIO bucket for Outline..." --weight=1
|
ynh_script_progression --message="Setting up MinIO bucket for Outline..." --weight=1
|
||||||
|
|
||||||
if $YNH_APP_ARG_MINIO_DOMAIN != "sub.domain.tld"; then
|
if [ $YNH_APP_ARG_MINIO_DOMAIN != "sub.domain.tld" ]; then
|
||||||
pushd "$mc_path"
|
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 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 policy set public minio/outlinestorage
|
||||||
|
|
|
@ -28,9 +28,12 @@ utils_secret=$(ynh_app_setting_get --app=$app --key=utils_secret)
|
||||||
|
|
||||||
|
|
||||||
minio_domain=$(ynh_app_setting_get --app="minio" --key=domain)
|
minio_domain=$(ynh_app_setting_get --app="minio" --key=domain)
|
||||||
|
|
||||||
|
if [ $minio_domain != "sub.domain.tld" ]; then
|
||||||
minio_id=$(ynh_app_setting_get --app="minio" --key=minio_id)
|
minio_id=$(ynh_app_setting_get --app="minio" --key=minio_id)
|
||||||
minio_key=$(ynh_app_setting_get --app="minio" --key=minio_key)
|
minio_key=$(ynh_app_setting_get --app="minio" --key=minio_key)
|
||||||
mc_path=$(ynh_app_setting_get --app="minio" --key=mc_path)
|
mc_path=$(ynh_app_setting_get --app="minio" --key=mc_path)
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD REMOVE
|
# STANDARD REMOVE
|
||||||
|
@ -91,7 +94,7 @@ ynh_secure_remove --file="$final_path"
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Removing Outline MinIO bucket..." --time --weight=1
|
ynh_script_progression --message="Removing Outline MinIO bucket..." --time --weight=1
|
||||||
|
|
||||||
if $minio_domain != "sub.domain.tld"; then
|
if [ $minio_domain != "sub.domain.tld" ]; then
|
||||||
pushd "$mc_path"
|
pushd "$mc_path"
|
||||||
ynh_exec_warn_less sudo -u minio ./mc rb minio/outlinestorage --force
|
ynh_exec_warn_less sudo -u minio ./mc rb minio/outlinestorage --force
|
||||||
popd
|
popd
|
||||||
|
|
|
@ -47,10 +47,14 @@ slack_key=$(ynh_app_setting_get --app=$app --key=slack_key)
|
||||||
slack_secret=$(ynh_app_setting_get --app=$app --key=slack_secret)
|
slack_secret=$(ynh_app_setting_get --app=$app --key=slack_secret)
|
||||||
secret_key=$(ynh_app_setting_get --app=$app --key=secret_key)
|
secret_key=$(ynh_app_setting_get --app=$app --key=secret_key)
|
||||||
utils_secret=$(ynh_app_setting_get --app=$app --key=utils_secret)
|
utils_secret=$(ynh_app_setting_get --app=$app --key=utils_secret)
|
||||||
|
|
||||||
minio_domain=$(ynh_app_setting_get --app="minio" --key=domain)
|
minio_domain=$(ynh_app_setting_get --app="minio" --key=domain)
|
||||||
|
|
||||||
|
if [ $minio_domain != "sub.domain.tld" ]; then
|
||||||
minio_id=$(ynh_app_setting_get --app="minio" --key=minio_id)
|
minio_id=$(ynh_app_setting_get --app="minio" --key=minio_id)
|
||||||
minio_key=$(ynh_app_setting_get --app="minio" --key=minio_key)
|
minio_key=$(ynh_app_setting_get --app="minio" --key=minio_key)
|
||||||
mc_path=$(ynh_app_setting_get --app="minio" --key=mc_path)
|
mc_path=$(ynh_app_setting_get --app="minio" --key=mc_path)
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK IF THE APP CAN BE RESTORED
|
# CHECK IF THE APP CAN BE RESTORED
|
||||||
|
@ -92,7 +96,7 @@ chown -R $app:www-data "$final_path"
|
||||||
# RESTORE MINIO
|
# RESTORE MINIO
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
if $minio_domain != "sub.domain.tld"; then
|
if [ $minio_domain != "sub.domain.tld" ]; then
|
||||||
mv "$final_path/outlinestorage" "$mc_path/outlinestorage"
|
mv "$final_path/outlinestorage" "$mc_path/outlinestorage"
|
||||||
chown -R minio:www-data "$mc_path/outlinestorage"
|
chown -R minio:www-data "$mc_path/outlinestorage"
|
||||||
pushd "$mc_path"
|
pushd "$mc_path"
|
||||||
|
|
|
@ -26,10 +26,14 @@ slack_key=$(ynh_app_setting_get --app=$app --key=slack_key)
|
||||||
slack_secret=$(ynh_app_setting_get --app=$app --key=slack_secret)
|
slack_secret=$(ynh_app_setting_get --app=$app --key=slack_secret)
|
||||||
secret_key=$(ynh_app_setting_get --app=$app --key=secret_key)
|
secret_key=$(ynh_app_setting_get --app=$app --key=secret_key)
|
||||||
utils_secret=$(ynh_app_setting_get --app=$app --key=utils_secret)
|
utils_secret=$(ynh_app_setting_get --app=$app --key=utils_secret)
|
||||||
|
|
||||||
minio_domain=$(ynh_app_setting_get --app="minio" --key=domain)
|
minio_domain=$(ynh_app_setting_get --app="minio" --key=domain)
|
||||||
|
|
||||||
|
if [ $minio_domain != "sub.domain.tld" ]; then
|
||||||
minio_id=$(ynh_app_setting_get --app="minio" --key=minio_id)
|
minio_id=$(ynh_app_setting_get --app="minio" --key=minio_id)
|
||||||
minio_key=$(ynh_app_setting_get --app="minio" --key=minio_key)
|
minio_key=$(ynh_app_setting_get --app="minio" --key=minio_key)
|
||||||
mc_path=$(ynh_app_setting_get --app="minio" --key=mc_path)
|
mc_path=$(ynh_app_setting_get --app="minio" --key=mc_path)
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK VERSION
|
# CHECK VERSION
|
||||||
|
|
Loading…
Add table
Reference in a new issue