mirror of
https://github.com/YunoHost-Apps/minio_ynh.git
synced 2024-09-03 19:46:18 +02:00
commit
0c776b05f0
3 changed files with 25 additions and 8 deletions
|
@ -1,5 +1,5 @@
|
||||||
SOURCE_URL=https://dl.min.io/client/mc/release/linux-amd64/archive/mc.RELEASE.2022-12-24T15-21-38Z
|
SOURCE_URL=https://dl.min.io/client/mc/release/linux-amd64/archive/mc.RELEASE.2023-01-28T20-29-38Z
|
||||||
SOURCE_SUM=8274f56d3ca69b2538fd818ff53a793c2fe1fc568489d97ee74d463123536aa6
|
SOURCE_SUM=ecd7b92a7a5c6e74db16fcd19950a28fa8ccb1fcc343ff37050787da346f7d4e
|
||||||
SOURCE_SUM_PRG=sha256sum
|
SOURCE_SUM_PRG=sha256sum
|
||||||
SOURCE_IN_SUBDIR=false
|
SOURCE_IN_SUBDIR=false
|
||||||
SOURCE_FILENAME=mc
|
SOURCE_FILENAME=mc
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
SOURCE_URL=https://dl.min.io/client/mc/release/linux-arm64/archive/mc.RELEASE.2022-12-24T15-21-38Z
|
SOURCE_URL=https://dl.min.io/client/mc/release/linux-arm64/archive/mc.RELEASE.2023-01-28T20-29-38Z
|
||||||
SOURCE_SUM=5a29fb81e9a7d75b0afca9fbccfca6eba6c54e7dcefbe8b0ac662bc7a70e089a
|
SOURCE_SUM=319fb47eb7f48e3e6efff1151bb82d44463d5c23f94495146c813f9ed2531a4b
|
||||||
SOURCE_SUM_PRG=sha256sum
|
SOURCE_SUM_PRG=sha256sum
|
||||||
SOURCE_IN_SUBDIR=false
|
SOURCE_IN_SUBDIR=false
|
||||||
SOURCE_FILENAME=mc
|
SOURCE_FILENAME=mc
|
||||||
|
|
|
@ -128,6 +128,23 @@ ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
||||||
|
|
||||||
yunohost service add $app --description="A High Performance, Kubernetes Native Object Storage" --log="/var/log/$app/$app.log"
|
yunohost service add $app --description="A High Performance, Kubernetes Native Object Storage" --log="/var/log/$app/$app.log"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# ENSURE DOWNWARD COMPATIBILITY
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Ensuring downward compatibility..."
|
||||||
|
|
||||||
|
if ynh_compare_current_package_version --comparison lt --version 2022.12.12~ynh1
|
||||||
|
then
|
||||||
|
ynh_script_progression --message="Moving old Filesystem to secure MinIO start"
|
||||||
|
tmp="/tmp/minio"
|
||||||
|
ynh_exec_warn_less cp -Ra "$datadir" "$tmp"
|
||||||
|
ynh_secure_remove --file="$datadir"
|
||||||
|
ynh_exec_warn_less mkdir "$datadir"
|
||||||
|
chmod 750 "$datadir"
|
||||||
|
chmod -R o-rwx "$datadir"
|
||||||
|
chown -R $app:www-data "$datadir"
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SYSTEMD SERVICE
|
# START SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -159,21 +176,20 @@ ynh_script_progression --message="Ensuring downward compatibility..."
|
||||||
if ynh_compare_current_package_version --comparison lt --version 2022.12.12~ynh1
|
if ynh_compare_current_package_version --comparison lt --version 2022.12.12~ynh1
|
||||||
then
|
then
|
||||||
ynh_script_progression --message="Migration from Filesystem to Single-Node Single-Drive mode"
|
ynh_script_progression --message="Migration from Filesystem to Single-Node Single-Drive mode"
|
||||||
pushd $datadir
|
pushd "$tmp/"
|
||||||
for d in * ; do
|
for d in * ; do
|
||||||
if [ "$d" == "*" ]
|
if [ "$d" == "*" ]
|
||||||
then
|
then
|
||||||
ynh_script_progression --message="No buckets to migrate"
|
ynh_script_progression --message="No buckets to migrate"
|
||||||
else
|
else
|
||||||
ynh_script_progression --message="Migrating bucket $d"
|
ynh_script_progression --message="Migrating bucket $d"
|
||||||
mv "$d" "DATA_$d"
|
|
||||||
pushd $mc_path
|
pushd $mc_path
|
||||||
ynh_exec_warn_less sudo -u $app ./mc mb minio/"$d"
|
ynh_exec_warn_less sudo -u $app ./mc mb minio/"$d"
|
||||||
ynh_exec_warn_less sudo -u $app ./mc mirror --preserve "$datadir/DATA_$d" minio/"$d"
|
ynh_exec_warn_less sudo -u $app ./mc mirror --preserve "$tmp/$d" "minio/$d"
|
||||||
# This is a hack, but it will make outline_ynh users' lifes much easier !
|
# This is a hack, but it will make outline_ynh users' lifes much easier !
|
||||||
if [ "$d" == "outlinestorage" ]
|
if [ "$d" == "outlinestorage" ]
|
||||||
then
|
then
|
||||||
ynh_exec_warn_less sudo -u $app ./mc policy set public minio/outlinestorage
|
ynh_exec_warn_less sudo -u $app ./mc anonymous set public minio/outlinestorage
|
||||||
else
|
else
|
||||||
ynh_script_progression --message="Bucket is migrated and objects are now mirrored. However, make sure to set properly access policy of bucket $d. That part of the migration can't be automated, sorry ! You can log into the minio console to perform your changes."
|
ynh_script_progression --message="Bucket is migrated and objects are now mirrored. However, make sure to set properly access policy of bucket $d. That part of the migration can't be automated, sorry ! You can log into the minio console to perform your changes."
|
||||||
fi
|
fi
|
||||||
|
@ -182,6 +198,7 @@ then
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
popd
|
popd
|
||||||
|
ynh_secure_remove --file="$tmp"
|
||||||
else
|
else
|
||||||
ynh_script_progression --message="No migration required"
|
ynh_script_progression --message="No migration required"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue