1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/minio_ynh.git synced 2024-09-03 19:46:18 +02:00

Merge pull request #43 from Limezy/2023.02.22

2023.02.22
This commit is contained in:
Limezy 2023-03-20 23:20:45 +07:00 committed by GitHub
commit de2f5f43b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 54 additions and 28 deletions

View file

@ -12,7 +12,6 @@
setup_private=1 setup_private=1
setup_public=1 setup_public=1
upgrade=1 upgrade=1
upgrade=1 from_commit=1ef6a65e00dbb39dac8919cf6c5f4313fea8462e
backup_restore=1 backup_restore=1
multi_instance=0 multi_instance=0
port_already_use=0 port_already_use=0

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://dl.min.io/server/minio/release/linux-amd64/archive/minio.RELEASE.2023-01-25T00-19-54Z SOURCE_URL=https://dl.min.io/server/minio/release/linux-amd64/archive/minio.RELEASE.2023-02-22T18-23-45Z
SOURCE_SUM=e7d44bb2f808d9ada43c7b1a677b3ae8e336f5be442992cd35a1b89e545c76d5 SOURCE_SUM=9e27137008ee2e233f72dc5d774dec7cbb1175280e9fde20f1ccbe61365edc2f
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_IN_SUBDIR=false SOURCE_IN_SUBDIR=false
SOURCE_FILENAME=minio SOURCE_FILENAME=minio

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://dl.min.io/server/minio/release/linux-arm64/archive/minio.RELEASE.2023-01-25T00-19-54Z SOURCE_URL=https://dl.min.io/server/minio/release/linux-arm64/archive/minio.RELEASE.2023-02-22T18-23-45Z
SOURCE_SUM=a927c48815c1f077dd8228734275a521c2299de1aa28bc8972585e3addd59c3f SOURCE_SUM=845b8cd10199ca2bcee369b5b3fe82e13b5889b7040bff013780efc8c0a2bca4
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_IN_SUBDIR=false SOURCE_IN_SUBDIR=false
SOURCE_FILENAME=minio SOURCE_FILENAME=minio

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://dl.min.io/client/mc/release/linux-amd64/archive/mc.RELEASE.2023-01-28T20-29-38Z SOURCE_URL=https://dl.min.io/client/mc/release/linux-amd64/archive/mc.RELEASE.2023-02-16T19-20-11Z
SOURCE_SUM=ecd7b92a7a5c6e74db16fcd19950a28fa8ccb1fcc343ff37050787da346f7d4e SOURCE_SUM=04aee1a04a513a293af5ceff699113c791a54309cecd97b2dd71f111dcc45f7b
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_IN_SUBDIR=false SOURCE_IN_SUBDIR=false
SOURCE_FILENAME=mc SOURCE_FILENAME=mc

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://dl.min.io/client/mc/release/linux-arm64/archive/mc.RELEASE.2023-01-28T20-29-38Z SOURCE_URL=https://dl.min.io/client/mc/release/linux-arm64/archive/mc.RELEASE.2023-02-16T19-20-11Z
SOURCE_SUM=319fb47eb7f48e3e6efff1151bb82d44463d5c23f94495146c813f9ed2531a4b SOURCE_SUM=df56bc161266efadc4cb722f4afb909738ff1eb5200f1446bcdb75fe4c272374
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_IN_SUBDIR=false SOURCE_IN_SUBDIR=false
SOURCE_FILENAME=mc SOURCE_FILENAME=mc

View file

@ -6,7 +6,7 @@
"en": "High Performance, Kubernetes Native Object Storage", "en": "High Performance, Kubernetes Native Object Storage",
"fr": "Serveur de stockage d'objets hautes performances" "fr": "Serveur de stockage d'objets hautes performances"
}, },
"version": "2023.01.11~ynh1", "version": "2023.02.22~ynh1",
"url": "https://min.io/", "url": "https://min.io/",
"upstream": { "upstream": {
"license": "AGPL-3.0-only", "license": "AGPL-3.0-only",

View file

@ -46,6 +46,7 @@ ynh_backup --src_path="$final_path"
# BACKUP THE DATA DIR # BACKUP THE DATA DIR
#================================================= #=================================================
ynh_print_info --message="WARNING : by default, the buckets are not saved (use is big option)..."
ynh_backup --src_path="$datadir" --is_big ynh_backup --src_path="$datadir" --is_big
#================================================= #=================================================

View file

@ -49,6 +49,49 @@ ynh_clean_setup () {
# Exit if an error occurs during the execution of the script # Exit if an error occurs during the execution of the script
ynh_abort_if_errors ynh_abort_if_errors
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..."
if ynh_compare_current_package_version --comparison le --version 2023.02.22~ynh1
then
ynh_script_progression --message="Mirroring old Filesystem to secure MinIO start"
tmp="/tmp/minio"
mkdir "$tmp"
chown -R $app:www-data "$tmp"
pushd "$datadir/"
for d in * ; do
if [ "$d" == "*" ]
then
ynh_script_progression --message="No buckets to migrate"
else
ynh_script_progression --message="Moving $d..."
ynh_exec_warn_less sudo -u $app $mc_path/mc mirror --preserve "minio/$d" "$tmp/$d"
fi
done
if ynh_compare_current_package_version --comparison eq --version 2022.09.01~ynh1
then
ynh_die --message="Sorry, your MinIO instance requires a complex manual migration. Please contact Limezy on the Yunohost forum"
fi
if ynh_compare_current_package_version --comparison eq --version 2022.11.11~ynh1
then
ynh_die --message="Sorry, your MinIO instance requires a complex manual migration. Please contact Limezy on the Yunohost forum"
fi
if ynh_compare_current_package_version --comparison eq --version 2023.01.11~ynh1
then
ynh_die --message="Sorry, your MinIO instance requires a complex manual migration. Please contact Limezy on the Yunohost forum"
fi
popd
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"
else
ynh_script_progression --message="No migration to be done"
fi
#================================================= #=================================================
# STANDARD UPGRADE STEPS # STANDARD UPGRADE STEPS
#================================================= #=================================================
@ -128,23 +171,6 @@ 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
#================================================= #=================================================
@ -173,7 +199,7 @@ popd
#================================================= #=================================================
ynh_script_progression --message="Ensuring downward compatibility..." 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 le --version 2023.02.22~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 "$tmp/" pushd "$tmp/"