From 2343482105c2846de58cb086b7b75fad60582850 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Mon, 15 May 2023 06:10:04 +0000 Subject: [PATCH 01/20] Upgrade to vRELEASE.2023-05-04T21-44-30Z --- conf/amd64.src | 4 ++-- conf/arm64.src | 4 ++-- conf/mc_amd64.src | 4 ++-- conf/mc_arm64.src | 4 ++-- manifest.json | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/conf/amd64.src b/conf/amd64.src index 55e14ad..0b5a231 100644 --- a/conf/amd64.src +++ b/conf/amd64.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://dl.min.io/server/minio/release/linux-amd64/archive/minio.RELEASE.2023-02-22T18-23-45Z -SOURCE_SUM=9e27137008ee2e233f72dc5d774dec7cbb1175280e9fde20f1ccbe61365edc2f +SOURCE_URL=https://dl.min.io/server/minio/release/linux-amd64/archive/minio.RELEASE.2023-05-04T21-44-30Z +SOURCE_SUM=2dce77cec0e4536c5736dee064e478a59dc063fe2e40e3f5fed275252de5e8c7 SOURCE_SUM_PRG=sha256sum SOURCE_IN_SUBDIR=false SOURCE_FILENAME=minio diff --git a/conf/arm64.src b/conf/arm64.src index e040d83..44acce6 100644 --- a/conf/arm64.src +++ b/conf/arm64.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://dl.min.io/server/minio/release/linux-arm64/archive/minio.RELEASE.2023-02-22T18-23-45Z -SOURCE_SUM=845b8cd10199ca2bcee369b5b3fe82e13b5889b7040bff013780efc8c0a2bca4 +SOURCE_URL=https://dl.min.io/server/minio/release/linux-arm64/archive/minio.RELEASE.2023-05-04T21-44-30Z +SOURCE_SUM=4948d289e75a54596e6c78a738f95a1bbec5ec159895406917c340d51c4375c9 SOURCE_SUM_PRG=sha256sum SOURCE_IN_SUBDIR=false SOURCE_FILENAME=minio diff --git a/conf/mc_amd64.src b/conf/mc_amd64.src index 811390f..76cabcf 100644 --- a/conf/mc_amd64.src +++ b/conf/mc_amd64.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://dl.min.io/client/mc/release/linux-amd64/archive/mc.RELEASE.2023-02-16T19-20-11Z -SOURCE_SUM=04aee1a04a513a293af5ceff699113c791a54309cecd97b2dd71f111dcc45f7b +SOURCE_URL=https://dl.min.io/client/mc/release/linux-amd64/archive/mc.RELEASE.2023-05-04T18-10-16Z +SOURCE_SUM=cd26ea353811880704efe8eb1b3335461240c1d4f7e4f3efee1b4391697662e4 SOURCE_SUM_PRG=sha256sum SOURCE_IN_SUBDIR=false SOURCE_FILENAME=mc diff --git a/conf/mc_arm64.src b/conf/mc_arm64.src index cb88b4b..86d03ca 100644 --- a/conf/mc_arm64.src +++ b/conf/mc_arm64.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://dl.min.io/client/mc/release/linux-arm64/archive/mc.RELEASE.2023-02-16T19-20-11Z -SOURCE_SUM=df56bc161266efadc4cb722f4afb909738ff1eb5200f1446bcdb75fe4c272374 +SOURCE_URL=https://dl.min.io/client/mc/release/linux-arm64/archive/mc.RELEASE.2023-05-04T18-10-16Z +SOURCE_SUM=b2beb693e09528c25dbb566abf88bb0b94fd2477730c00a496bfceb0f8e9cd2b SOURCE_SUM_PRG=sha256sum SOURCE_IN_SUBDIR=false SOURCE_FILENAME=mc diff --git a/manifest.json b/manifest.json index 096cb16..86e8b7d 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "High Performance, Kubernetes Native Object Storage", "fr": "Serveur de stockage d'objets hautes performances" }, - "version": "2023.02.22~ynh1", + "version": "2023.05.04~ynh1", "url": "https://min.io/", "upstream": { "license": "AGPL-3.0-only", From 25cfc60acc4162d79ab9ec831c5f5e1f452fc393 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Mon, 15 May 2023 06:10:09 +0000 Subject: [PATCH 02/20] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fa036cd..14a4458 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in MinIO is a High Performance Object Storage released under GNU Affero General Public License v3.0. It is API compatible with Amazon S3 cloud storage service. Use MinIO to build high performance infrastructure for machine learning, analytics and application data workloads. -**Shipped version:** 2023.02.22~ynh1 +**Shipped version:** 2023.05.04~ynh1 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 12dd81d..68b63c1 100644 --- a/README_fr.md +++ b/README_fr.md @@ -19,7 +19,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po MinIO is a High Performance Object Storage released under GNU Affero General Public License v3.0. It is API compatible with Amazon S3 cloud storage service. Use MinIO to build high performance infrastructure for machine learning, analytics and application data workloads. -**Version incluse :** 2023.02.22~ynh1 +**Version incluse :** 2023.05.04~ynh1 ## Captures d’écran From eea2f3e9f365a76ddd0e00f84a4e4a05039d713e Mon Sep 17 00:00:00 2001 From: Tagada <36127788+Tagadda@users.noreply.github.com> Date: Fri, 19 May 2023 23:12:47 +0200 Subject: [PATCH 03/20] convert script v2 --- conf/.env | 2 +- conf/amd64.src | 6 --- conf/arm64.src | 6 --- conf/mc_amd64.src | 6 --- conf/mc_arm64.src | 6 --- conf/systemd.service | 8 ++-- manifest.toml | 79 +++++++++++++++++++++++++++++++++++++ scripts/backup | 18 ++++----- scripts/change_url | 64 +++++++++++++++--------------- scripts/install | 92 ++++++++++++++++++++++---------------------- scripts/remove | 20 +++++----- scripts/restore | 48 +++++++++++------------ scripts/upgrade | 70 ++++++++++++++++----------------- 13 files changed, 241 insertions(+), 184 deletions(-) delete mode 100644 conf/amd64.src delete mode 100644 conf/arm64.src delete mode 100644 conf/mc_amd64.src delete mode 100644 conf/mc_arm64.src create mode 100644 manifest.toml diff --git a/conf/.env b/conf/.env index 549c366..a5fdb53 100644 --- a/conf/.env +++ b/conf/.env @@ -1,4 +1,4 @@ MINIO_ROOT_USER=__ADMIN__ MINIO_ROOT_PASSWORD=__PASSWORD__ -MINIO_VOLUMES="__DATADIR__/" +MINIO_VOLUMES="__DATA_DIR__/" MINIO_OPTS="-C __FINAL_PATH__/ --address 127.0.0.1:__PORT__ --console-address :__CONSOLE_PORT__" diff --git a/conf/amd64.src b/conf/amd64.src deleted file mode 100644 index 0b5a231..0000000 --- a/conf/amd64.src +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://dl.min.io/server/minio/release/linux-amd64/archive/minio.RELEASE.2023-05-04T21-44-30Z -SOURCE_SUM=2dce77cec0e4536c5736dee064e478a59dc063fe2e40e3f5fed275252de5e8c7 -SOURCE_SUM_PRG=sha256sum -SOURCE_IN_SUBDIR=false -SOURCE_FILENAME=minio -SOURCE_EXTRACT=false diff --git a/conf/arm64.src b/conf/arm64.src deleted file mode 100644 index 44acce6..0000000 --- a/conf/arm64.src +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://dl.min.io/server/minio/release/linux-arm64/archive/minio.RELEASE.2023-05-04T21-44-30Z -SOURCE_SUM=4948d289e75a54596e6c78a738f95a1bbec5ec159895406917c340d51c4375c9 -SOURCE_SUM_PRG=sha256sum -SOURCE_IN_SUBDIR=false -SOURCE_FILENAME=minio -SOURCE_EXTRACT=false diff --git a/conf/mc_amd64.src b/conf/mc_amd64.src deleted file mode 100644 index 76cabcf..0000000 --- a/conf/mc_amd64.src +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://dl.min.io/client/mc/release/linux-amd64/archive/mc.RELEASE.2023-05-04T18-10-16Z -SOURCE_SUM=cd26ea353811880704efe8eb1b3335461240c1d4f7e4f3efee1b4391697662e4 -SOURCE_SUM_PRG=sha256sum -SOURCE_IN_SUBDIR=false -SOURCE_FILENAME=mc -SOURCE_EXTRACT=false diff --git a/conf/mc_arm64.src b/conf/mc_arm64.src deleted file mode 100644 index 86d03ca..0000000 --- a/conf/mc_arm64.src +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://dl.min.io/client/mc/release/linux-arm64/archive/mc.RELEASE.2023-05-04T18-10-16Z -SOURCE_SUM=b2beb693e09528c25dbb566abf88bb0b94fd2477730c00a496bfceb0f8e9cd2b -SOURCE_SUM_PRG=sha256sum -SOURCE_IN_SUBDIR=false -SOURCE_FILENAME=mc -SOURCE_EXTRACT=false diff --git a/conf/systemd.service b/conf/systemd.service index 9b6ab5b..ca7532a 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -3,16 +3,16 @@ Description=MinIO Documentation=https://docs.min.io Wants=network-online.target After=network-online.target -AssertFileIsExecutable=__FINALPATH__/minio +AssertFileIsExecutable=__INSTALL_DIR__/minio [Service] Type=simple User=__APP__ Group=__APP__ #ProtectProc=invisible -WorkingDirectory=__FINALPATH__/ -EnvironmentFile=__FINALPATH__/.env -ExecStart=__FINALPATH__/minio server $MINIO_OPTS $MINIO_VOLUMES +WorkingDirectory=__INSTALL_DIR__/ +EnvironmentFile=__INSTALL_DIR__/.env +ExecStart=__INSTALL_DIR__/minio server $MINIO_OPTS $MINIO_VOLUMES # Let systemd restart this service always Restart=always diff --git a/manifest.toml b/manifest.toml new file mode 100644 index 0000000..d65283d --- /dev/null +++ b/manifest.toml @@ -0,0 +1,79 @@ +packaging_format = 2 + +id = "minio" +name = "MinIO server" +description.en = "High Performance, Kubernetes Native Object Storage" +description.fr = "Serveur de stockage d'objets hautes performances" + +version = "2023.05.04~ynh1" + +maintainers = ["Raoul de Limezy"] + +[upstream] +license = "AGPL-3.0-only" +website = "https://min.io" +admindoc = "https://docs.min.io/" +code = "https://github.com/minio/minio" +cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number) +fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin. + +[integration] +yunohost = ">= 11.0.9" +architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386"] +multi_instance = false +ldap = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "sso" key : the "ldap" key corresponds to wether or not a user *can* login on the app using its YunoHost credentials. +sso = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "ldap" key : the "sso" key corresponds to wether or not a user is *automatically logged-in* on the app when logged-in on the YunoHost portal. +disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... +ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... +ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... + +[install] + [install.domain] + # this is a generic question - ask strings are automatically handled by Yunohost's core + type = "domain" + full_domain = true + + [install.init_main_permission] + type = "group" + default = "visitors" + + [install.admin] + # this is a generic question - ask strings are automatically handled by Yunohost's core + type = "user" + + [install.password] + # this is a generic question - ask strings are automatically handled by Yunohost's core + type = "password" + +[resources] + [resources.sources] + [resources.sources.main] + in_subdir = false + arm64.url = "https://dl.min.io/server/minio/release/linux-arm64/archive/minio.RELEASE.2023-05-04T21-44-30Z" + arm64.sha256 = "4948d289e75a54596e6c78a738f95a1bbec5ec159895406917c340d51c4375c9" + amd64.url = "https://dl.min.io/server/minio/release/linux-amd64/archive/minio.RELEASE.2023-05-04T21-44-30Z" + amd64.sha256 = "2dce77cec0e4536c5736dee064e478a59dc063fe2e40e3f5fed275252de5e8c7" + + [resources.sources.mc_arm64] + url = "https://dl.min.io/client/mc/release/linux-arm64/archive/mc.RELEASE.2023-05-04T18-10-16Z" + sha256 = "b2beb693e09528c25dbb566abf88bb0b94fd2477730c00a496bfceb0f8e9cd2b" + in_subdir = false + + [resources.sources.mc_amd64] + url = "https://dl.min.io/client/mc/release/linux-amd64/archive/mc.RELEASE.2023-05-04T18-10-16Z" + sha256 = "cd26ea353811880704efe8eb1b3335461240c1d4f7e4f3efee1b4391697662e4" + in_subdir = false + + + [resources.system_user] + + [resources.install_dir] + + [resources.data_dir] + + [resources.permissions] + main.url = "/" + + [resources.ports] + main.default = 9000 + console.default = 36669 diff --git a/scripts/backup b/scripts/backup index 059aa77..3d200ce 100755 --- a/scripts/backup +++ b/scripts/backup @@ -14,22 +14,22 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { +#REMOVEME? ynh_clean_setup () { true } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_print_info --message="Loading installation settings..." +#REMOVEME? ynh_print_info --message="Loading installation settings..." -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -domain=$(ynh_app_setting_get --app=$app --key=domain) -datadir=$(ynh_app_setting_get --app=$app --key=datadir) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP @@ -40,14 +40,14 @@ ynh_print_info --message="Declaring files to be backed up..." # BACKUP THE APP MAIN DIR #================================================= -ynh_backup --src_path="$final_path" +ynh_backup --src_path="$install_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="$data_dir" --is_big #================================================= # BACKUP THE NGINX CONFIGURATION diff --git a/scripts/change_url b/scripts/change_url index ed3b14e..a0f2148 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -13,54 +13,54 @@ source /usr/share/yunohost/helpers # RETRIEVE ARGUMENTS #================================================= -old_domain=$YNH_APP_OLD_DOMAIN -old_path=$YNH_APP_OLD_PATH +#REMOVEME? old_domain=$YNH_APP_OLD_DOMAIN +#REMOVEME? old_path=$YNH_APP_OLD_PATH -new_domain=$YNH_APP_NEW_DOMAIN -new_path=$YNH_APP_NEW_PATH +#REMOVEME? new_domain=$YNH_APP_NEW_DOMAIN +#REMOVEME? new_path=$YNH_APP_NEW_PATH -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 -# Needed for helper "ynh_add_nginx_config" -final_path=$(ynh_app_setting_get --app=$app --key=final_path) +#REMOVEME? # Needed for helper "ynh_add_nginx_config" +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) #================================================= # BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=1 +#REMOVEME? ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=1 # Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { - ynh_clean_check_starting +#REMOVEME? ynh_backup_before_upgrade +#REMOVEME? ynh_clean_setup () { + #REMOVEME? ynh_clean_check_starting # Remove the new domain config file, the remove script won't do it as it doesn't know yet its location. - ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" +#REMOVEME? ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" # Restore it if the upgrade fails - ynh_restore_upgradebackup +#REMOVEME? ynh_restore_upgradebackup } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # CHECK WHICH PARTS SHOULD BE CHANGED #================================================= -change_domain=0 -if [ "$old_domain" != "$new_domain" ] +#REMOVEME? change_domain=0 +#REMOVEME? if [ "$old_domain" != "$new_domain" ] then - change_domain=1 + #REMOVEME? change_domain=1 fi -change_path=0 -if [ "$old_path" != "$new_path" ] +#REMOVEME? change_path=0 +#REMOVEME? if [ "$old_path" != "$new_path" ] then - change_path=1 + #REMOVEME? change_path=1 fi #================================================= @@ -77,28 +77,30 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" #================================================= ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 -nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf +ynh_change_url_nginx_config + +#REMOVEME? nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf # Change the path in the NGINX config file if [ $change_path -eq 1 ] then # Make a backup of the original NGINX config file if modified - ynh_backup_if_checksum_is_different --file="$nginx_conf_path" +#REMOVEME? ynh_backup_if_checksum_is_different --file="$nginx_conf_path" # Set global variables for NGINX helper - domain="$old_domain" - path_url="$new_path" +#REMOVEME? domain="$old_domain" +#REMOVEME? path="$new_path" # Create a dedicated NGINX config - ynh_add_nginx_config +#REMOVEME? ynh_add_nginx_config fi # Change the domain for NGINX if [ $change_domain -eq 1 ] then # Delete file checksum for the old conf file location - ynh_delete_file_checksum --file="$nginx_conf_path" - mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf +#REMOVEME? ynh_delete_file_checksum --file="$nginx_conf_path" +#REMOVEME? mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf # Store file checksum for the new config file location - ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" +#REMOVEME? ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" fi #================================================= @@ -113,9 +115,9 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --l #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 +#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 -ynh_systemd_action --service_name=nginx --action=reload +#REMOVEME? #REMOVEME? ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index 0f618ce..ad184d6 100755 --- a/scripts/install +++ b/scripts/install @@ -13,85 +13,85 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { +#REMOVEME? ynh_clean_setup () { ynh_clean_check_starting } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -domain=$YNH_APP_ARG_DOMAIN -path_url="/" -is_public=$YNH_APP_ARG_IS_PUBLIC -admin=$YNH_APP_ARG_ADMIN -password=$YNH_APP_ARG_PASSWORD +#REMOVEME? domain=$YNH_APP_ARG_DOMAIN +path="/" +#REMOVEME? is_public=$YNH_APP_ARG_IS_PUBLIC +#REMOVEME? admin=$YNH_APP_ARG_ADMIN +#REMOVEME? password=$YNH_APP_ARG_PASSWORD -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= -ynh_script_progression --message="Validating installation parameters..." --weight=1 +#REMOVEME? ynh_script_progression --message="Validating installation parameters..." --weight=1 -final_path=/var/www/$app -test ! -e "$final_path" || ynh_die --message="This path already contains a folder" +#REMOVEME? install_dir=/var/www/$app +#REMOVEME? test ! -e "$install_dir" || ynh_die --message="This path already contains a folder" -mc_path=$final_path/mc +mc_path=$install_dir/mc # Register (book) web path -ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url +#REMOVEME? ynh_webpath_register --app=$app --domain=$domain --path=$path #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -ynh_script_progression --message="Storing installation settings..." --weight=1 +#REMOVEME? ynh_script_progression --message="Storing installation settings..." --weight=1 -ynh_app_setting_set --app=$app --key=domain --value=$domain -ynh_app_setting_set --app=$app --key=path --value=$path_url -ynh_app_setting_set --app=$app --key=admin --value=$admin -ynh_app_setting_set --app=$app --key=password --value=$password -ynh_app_setting_set --app=$app --key=mc_path --value=$mc_path +#REMOVEME? ynh_app_setting_set --app=$app --key=domain --value=$domain +#REMOVEME? ynh_app_setting_set --app=$app --key=path --value=$path +#REMOVEME? ynh_app_setting_set --app=$app --key=admin --value=$admin +#REMOVEME? ynh_app_setting_set --app=$app --key=password --value=$password +#REMOVEME? ynh_app_setting_set --app=$app --key=mc_path --value=$mc_path #================================================= # STANDARD MODIFICATIONS #================================================= # FIND AND OPEN A PORT #================================================= -ynh_script_progression --message="Finding an available port..." --weight=1 +#REMOVEME? ynh_script_progression --message="Finding an available port..." --weight=1 # Find an available port -port=$(ynh_find_port --port=9000) -ynh_app_setting_set --app=$app --key=port --value=$port +#REMOVEME? port=$(ynh_find_port --port=9000) +#REMOVEME? ynh_app_setting_set --app=$app --key=port --value=$port # Find an available port for minio-console -console_port=$(ynh_find_port --port=36669) -ynh_app_setting_set --app=$app --key=console_port --value=$console_port +#REMOVEME? console_port=$(ynh_find_port --port=36669) +#REMOVEME? ynh_app_setting_set --app=$app --key=console_port --value=$console_port #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Configuring system user..." --weight=1 +#REMOVEME? ynh_script_progression --message="Configuring system user..." --weight=1 # Create a system user -ynh_system_user_create --username=$app --home_dir="$final_path" +#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= ynh_script_progression --message="Setting up source files..." --weight=10 -ynh_app_setting_set --app=$app --key=final_path --value=$final_path +#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$final_path" --source_id="$YNH_ARCH" +ynh_setup_source --dest_dir="$install_dir" ynh_setup_source --dest_dir="$mc_path" --source_id="mc_$YNH_ARCH" -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" -chmod +x "$final_path/minio" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" +chmod +x "$install_dir/minio" chmod +x "$mc_path/mc" #================================================= @@ -109,24 +109,24 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Creating a data directory..." --weight=1 -datadir=/home/yunohost.app/$app -ynh_app_setting_set --app=$app --key=datadir --value=$datadir +#REMOVEME? data_dir=/home/yunohost.app/$app +#REMOVEME? ynh_app_setting_set --app=$app --key=data_dir --value=$data_dir -mkdir -p $datadir +mkdir -p $data_dir -chmod 750 "$datadir" -chmod -R o-rwx "$datadir" -chown -R $app:www-data "$datadir" +chmod 750 "$data_dir" +chmod -R o-rwx "$data_dir" +chown -R $app:www-data "$data_dir" #================================================= # ADD A CONFIGURATION #================================================= ynh_script_progression --message="Adding a configuration file..." --weight=2 -ynh_add_config --template="../conf/.env" --destination="$final_path/.env" +ynh_add_config --template="../conf/.env" --destination="$install_dir/.env" -chmod 400 "$final_path/.env" -chown $app:$app "$final_path/.env" +chmod 400 "$install_dir/.env" +chown $app:$app "$install_dir/.env" #================================================= # SETUP SYSTEMD @@ -164,22 +164,22 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --l #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring permissions..." --weight=1 +#REMOVEME? ynh_script_progression --message="Configuring permissions..." --weight=1 # Make app public if necessary -if [ $is_public -eq 1 ] +#REMOVEME? if [ $is_public -eq 1 ] then # Everyone can access the app. # The "main" permission is automatically created before the install script. - ynh_permission_update --permission="main" --add="visitors" +#REMOVEME? ynh_permission_update --permission="main" --add="visitors" fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 +#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 -ynh_systemd_action --service_name=nginx --action=reload +#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload #================================================= # SETUP MINIO CLIENT diff --git a/scripts/remove b/scripts/remove index 4ad2869..5a3b8d7 100755 --- a/scripts/remove +++ b/scripts/remove @@ -12,13 +12,13 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -datadir=$(ynh_app_setting_get --app=$app --key=datadir) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) #================================================= # STANDARD REMOVE @@ -52,10 +52,10 @@ ynh_remove_logrotate #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory..." --weight=3 +#REMOVEME? ynh_script_progression --message="Removing app main directory..." --weight=3 # Remove the app directory securely -ynh_secure_remove --file="$final_path" +#REMOVEME? ynh_secure_remove --file="$install_dir" #================================================= # REMOVE DATA DIR @@ -65,7 +65,7 @@ ynh_secure_remove --file="$final_path" if [ "${YNH_APP_PURGE:-0}" -eq 1 ] then ynh_script_progression --message="Removing app data directory..." --weight=1 - ynh_secure_remove --file="$datadir" +#REMOVEME? ynh_secure_remove --file="$data_dir" fi #================================================= @@ -81,10 +81,10 @@ ynh_remove_nginx_config #================================================= # REMOVE DEDICATED USER #================================================= -ynh_script_progression --message="Removing the dedicated system user..." --weight=1 +#REMOVEME? ynh_script_progression --message="Removing the dedicated system user..." --weight=1 # Delete a system user -ynh_system_user_delete --username=$app +#REMOVEME? ynh_system_user_delete --username=$app #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index a720975..b2c1ed5 100755 --- a/scripts/restore +++ b/scripts/restore @@ -14,32 +14,32 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { +#REMOVEME? ynh_clean_setup () { ynh_clean_check_starting } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -path_url=$(ynh_app_setting_get --app=$app --key=path) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -datadir=$(ynh_app_setting_get --app=$app --key=datadir) -mc_path=$(ynh_app_setting_get --app=$app --key=mc_path) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) +#REMOVEME? mc_path=$(ynh_app_setting_get --app=$app --key=mc_path) #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= -ynh_script_progression --message="Validating restoration parameters..." --weight=1 +#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." --weight=1 -test ! -d $final_path \ - || ynh_die --message="There is already a directory: $final_path " +#REMOVEME? test ! -d $install_dir \ + || ynh_die --message="There is already a directory: $install_dir " #================================================= # STANDARD RESTORATION STEPS @@ -53,22 +53,22 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RECREATE THE DEDICATED USER #================================================= -ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 +#REMOVEME? ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 # Create the dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir="$final_path" +#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" #================================================= # RESTORE THE APP MAIN DIR #================================================= ynh_script_progression --message="Restoring the app main directory..." --weight=2 -ynh_restore_file --origin_path="$final_path" +ynh_restore_file --origin_path="$install_dir" -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" -chmod +x "$final_path/minio" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" +chmod +x "$install_dir/minio" chmod +x "$mc_path/mc" #================================================= @@ -76,13 +76,13 @@ chmod +x "$mc_path/mc" #================================================= ynh_script_progression --message="Restoring the data directory..." --weight=3 -ynh_restore_file --origin_path="$datadir" --not_mandatory +ynh_restore_file --origin_path="$data_dir" --not_mandatory -mkdir -p $datadir +mkdir -p $data_dir -chmod 750 "$datadir" -chmod -R o-rwx "$datadir" -chown -R $app:www-data "$datadir" +chmod 750 "$data_dir" +chmod -R o-rwx "$data_dir" +chown -R $app:www-data "$data_dir" #================================================= # RESTORE SYSTEMD diff --git a/scripts/upgrade b/scripts/upgrade index d11cf75..5d9150b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,20 +12,20 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -port=$(ynh_app_setting_get --app=$app --key=port) -path_url=$(ynh_app_setting_get --app=$app --key=path) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -mc_path=$(ynh_app_setting_get --app=$app --key=mc_path) -admin=$(ynh_app_setting_get --app=$app --key=admin) -password=$(ynh_app_setting_get --app=$app --key=password) -port=$(ynh_app_setting_get --app=$app --key=port) -console_port=$(ynh_app_setting_get --app=$app --key=console_port) -datadir=$(ynh_app_setting_get --app=$app --key=datadir) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) +#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? mc_path=$(ynh_app_setting_get --app=$app --key=mc_path) +#REMOVEME? admin=$(ynh_app_setting_get --app=$app --key=admin) +#REMOVEME? password=$(ynh_app_setting_get --app=$app --key=password) +#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) +#REMOVEME? console_port=$(ynh_app_setting_get --app=$app --key=console_port) +#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) #================================================= # CHECK VERSION @@ -37,17 +37,17 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1 +#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1 # Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { +#REMOVEME? ynh_backup_before_upgrade +#REMOVEME? ynh_clean_setup () { ynh_clean_check_starting # Restore it if the upgrade fails - ynh_restore_upgradebackup +#REMOVEME? ynh_restore_upgradebackup } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # ENSURE DOWNWARD COMPATIBILITY @@ -60,7 +60,7 @@ then tmp="/tmp/minio" mkdir "$tmp" chown -R $app:www-data "$tmp" - pushd "$datadir/" + pushd "$data_dir/" for d in * ; do if [ "$d" == "*" ] then @@ -83,11 +83,11 @@ 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" +#REMOVEME? ynh_secure_remove --file="$data_dir" + ynh_exec_warn_less mkdir "$data_dir" + chmod 750 "$data_dir" + chmod -R o-rwx "$data_dir" + chown -R $app:www-data "$data_dir" else ynh_script_progression --message="No migration to be done" fi @@ -104,10 +104,10 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 +#REMOVEME? ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 # Create a dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir="$final_path" +#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -118,14 +118,14 @@ then ynh_script_progression --message="Upgrading source files..." --weight=5 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" --source_id="$YNH_ARCH" --keep=".env" + ynh_setup_source --dest_dir="$install_dir" --keep=".env" ynh_setup_source --dest_dir="$mc_path" --source_id="mc_$YNH_ARCH" fi -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" -chmod +x "$final_path/minio" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" +chmod +x "$install_dir/minio" chmod +x "$mc_path/mc" #================================================= @@ -141,10 +141,10 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Updating a configuration file..." -ynh_add_config --template="../conf/.env" --destination="$final_path/.env" +ynh_add_config --template="../conf/.env" --destination="$install_dir/.env" -chmod 400 "$final_path/.env" -chown $app:$app "$final_path/.env" +chmod 400 "$install_dir/.env" +chown $app:$app "$install_dir/.env" #================================================= # SETUP SYSTEMD @@ -181,9 +181,9 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --l #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 +#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 -ynh_systemd_action --service_name=nginx --action=reload +#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload #================================================= # SETUP MINIO CLIENT From 5179ee423de387219e22754f693d883b93d1bcc0 Mon Sep 17 00:00:00 2001 From: Tagada <36127788+Tagadda@users.noreply.github.com> Date: Fri, 19 May 2023 23:12:52 +0200 Subject: [PATCH 04/20] v2 --- check_process | 21 ---------- doc/DESCRIPTION.md | 28 ++++++++++++++ doc/DISCLAIMER.md | 27 ------------- manifest.json | 50 ------------------------ manifest.toml | 24 +++++------- scripts/backup | 21 ---------- scripts/change_url | 85 ----------------------------------------- scripts/install | 95 +--------------------------------------------- scripts/remove | 35 +---------------- scripts/restore | 41 +------------------- scripts/upgrade | 50 +----------------------- tests.toml | 23 +++++++++++ 12 files changed, 68 insertions(+), 432 deletions(-) delete mode 100644 check_process delete mode 100644 doc/DISCLAIMER.md delete mode 100644 manifest.json create mode 100644 tests.toml diff --git a/check_process b/check_process deleted file mode 100644 index 6cdf741..0000000 --- a/check_process +++ /dev/null @@ -1,21 +0,0 @@ -;; Test complet - ; Manifest - domain="domain.tld" - is_public=1 - admin="john" - password="1Strong-Password" - ; Checks - pkg_linter=1 - setup_sub_dir=0 - setup_root=1 - setup_nourl=0 - setup_private=1 - setup_public=1 - upgrade=1 - backup_restore=1 - multi_instance=0 - port_already_use=0 - change_url=1 -;;; Options -Email= -Notification=none diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index 3fb5acf..ef1ed65 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -1 +1,29 @@ MinIO is a High Performance Object Storage released under GNU Affero General Public License v3.0. It is API compatible with Amazon S3 cloud storage service. Use MinIO to build high performance infrastructure for machine learning, analytics and application data workloads. + +## How to create a Yunohost app using MinIO +During the install process, MinIO will install both the MinIO server and MinIO client. +If your app needs to use an Amazon S3 storage, I recommend to use the MinIO client to create and setup buckets as per your app's requirements. You can have a look at outline_ynh app for reference. + +### First step : retrieve MinIO credentials +``` +#================================================= +# SETUP MINIO CREDENTIALS +#================================================= +minio_domain=$(ynh_app_setting_get --app="minio" --key=domain) +minio_admin=$(ynh_app_setting_get --app="minio" --key=admin) +minio_password=$(ynh_app_setting_get --app="minio" --key=password) +mc_path=$(ynh_app_setting_get --app="minio" --key=mc_path) +``` + +### Second step : create and setup your bucket +``` +#================================================= +# SETUP MINIO BUCKET +#================================================= +ynh_script_progression --message="Setting up MinIO bucket for YOURAPP..." --weight=1 + +pushd "$mc_path" + ynh_exec_warn_less sudo -u minio ./mc mb minio/NAME_OF_YOUR_BUCKET --region "NAME_OF_YOUR_REGION" + ynh_exec_warn_less sudo -u minio ./mc policy set NEEDED_POLICY minio/NAME_OF_YOUR_BUCKET +popd +``` \ No newline at end of file diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md deleted file mode 100644 index 9171983..0000000 --- a/doc/DISCLAIMER.md +++ /dev/null @@ -1,27 +0,0 @@ -## How to create a Yunohost app using MinIO -During the install process, MinIO will install both the MinIO server and MinIO client. -If your app needs to use an Amazon S3 storage, I recommend to use the MinIO client to create and setup buckets as per your app's requirements. You can have a look at outline_ynh app for reference. - -### First step : retrieve MinIO credentials -``` -#================================================= -# SETUP MINIO CREDENTIALS -#================================================= -minio_domain=$(ynh_app_setting_get --app="minio" --key=domain) -minio_admin=$(ynh_app_setting_get --app="minio" --key=admin) -minio_password=$(ynh_app_setting_get --app="minio" --key=password) -mc_path=$(ynh_app_setting_get --app="minio" --key=mc_path) -``` - -### Second step : create and setup your bucket -``` -#================================================= -# SETUP MINIO BUCKET -#================================================= -ynh_script_progression --message="Setting up MinIO bucket for YOURAPP..." --weight=1 - -pushd "$mc_path" - ynh_exec_warn_less sudo -u minio ./mc mb minio/NAME_OF_YOUR_BUCKET --region "NAME_OF_YOUR_REGION" - ynh_exec_warn_less sudo -u minio ./mc policy set NEEDED_POLICY minio/NAME_OF_YOUR_BUCKET -popd -``` \ No newline at end of file diff --git a/manifest.json b/manifest.json deleted file mode 100644 index 86e8b7d..0000000 --- a/manifest.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "MinIO server", - "id": "minio", - "packaging_format": 1, - "description": { - "en": "High Performance, Kubernetes Native Object Storage", - "fr": "Serveur de stockage d'objets hautes performances" - }, - "version": "2023.05.04~ynh1", - "url": "https://min.io/", - "upstream": { - "license": "AGPL-3.0-only", - "website": "https://min.io", - "admindoc": "https://docs.min.io/", - "code": "https://github.com/minio/minio", - "cpe": "cpe:2.3:a:minio:minio" - }, - "license": "AGPL-3.0-only", - "maintainer": { - "name": "Raoul de Limezy" - }, - "requirements": { - "yunohost": ">= 11.0.9" - }, - "multi_instance": false, - "services": [ - "nginx" - ], - "arguments": { - "install": [ - { - "name": "domain", - "type": "domain" - }, - { - "name": "is_public", - "type": "boolean", - "default": true - }, - { - "name": "admin", - "type": "user" - }, - { - "name": "password", - "type": "password" - } - ] - } -} diff --git a/manifest.toml b/manifest.toml index d65283d..356d346 100644 --- a/manifest.toml +++ b/manifest.toml @@ -14,15 +14,14 @@ license = "AGPL-3.0-only" website = "https://min.io" admindoc = "https://docs.min.io/" code = "https://github.com/minio/minio" -cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number) -fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin. +cpe = " cpe:2.3:a:min:minio_console" [integration] -yunohost = ">= 11.0.9" -architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386"] +yunohost = ">= 11.1" +architectures = ["amd64", "arm64"] multi_instance = false -ldap = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "sso" key : the "ldap" key corresponds to wether or not a user *can* login on the app using its YunoHost credentials. -sso = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "ldap" key : the "sso" key corresponds to wether or not a user is *automatically logged-in* on the app when logged-in on the YunoHost portal. +ldap = "not_relevant" +sso = "not_relevant" disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... @@ -54,15 +53,12 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen amd64.url = "https://dl.min.io/server/minio/release/linux-amd64/archive/minio.RELEASE.2023-05-04T21-44-30Z" amd64.sha256 = "2dce77cec0e4536c5736dee064e478a59dc063fe2e40e3f5fed275252de5e8c7" - [resources.sources.mc_arm64] - url = "https://dl.min.io/client/mc/release/linux-arm64/archive/mc.RELEASE.2023-05-04T18-10-16Z" - sha256 = "b2beb693e09528c25dbb566abf88bb0b94fd2477730c00a496bfceb0f8e9cd2b" - in_subdir = false - - [resources.sources.mc_amd64] - url = "https://dl.min.io/client/mc/release/linux-amd64/archive/mc.RELEASE.2023-05-04T18-10-16Z" - sha256 = "cd26ea353811880704efe8eb1b3335461240c1d4f7e4f3efee1b4391697662e4" + [resources.sources.mc] in_subdir = false + arm64.url = "https://dl.min.io/client/mc/release/linux-arm64/archive/mc.RELEASE.2023-05-04T18-10-16Z" + arm64.sha256 = "b2beb693e09528c25dbb566abf88bb0b94fd2477730c00a496bfceb0f8e9cd2b" + amd64.url = "https://dl.min.io/client/mc/release/linux-amd64/archive/mc.RELEASE.2023-05-04T18-10-16Z" + amd64.sha256 = "cd26ea353811880704efe8eb1b3335461240c1d4f7e4f3efee1b4391697662e4" [resources.system_user] diff --git a/scripts/backup b/scripts/backup index 3d200ce..5e8ec3c 100755 --- a/scripts/backup +++ b/scripts/backup @@ -10,27 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -#REMOVEME? ynh_clean_setup () { - true -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_print_info --message="Loading installation settings..." - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) - #================================================= # DECLARE DATA AND CONF FILES TO BACKUP #================================================= diff --git a/scripts/change_url b/scripts/change_url index a0f2148..c5d2077 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -9,60 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# RETRIEVE ARGUMENTS -#================================================= - -#REMOVEME? old_domain=$YNH_APP_OLD_DOMAIN -#REMOVEME? old_path=$YNH_APP_OLD_PATH - -#REMOVEME? new_domain=$YNH_APP_NEW_DOMAIN -#REMOVEME? new_path=$YNH_APP_NEW_PATH - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 - -#REMOVEME? # Needed for helper "ynh_add_nginx_config" -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) - -#================================================= -# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP -#================================================= -#REMOVEME? ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=1 - -# Backup the current version of the app -#REMOVEME? ynh_backup_before_upgrade -#REMOVEME? ynh_clean_setup () { - #REMOVEME? ynh_clean_check_starting - # Remove the new domain config file, the remove script won't do it as it doesn't know yet its location. -#REMOVEME? ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" - - # Restore it if the upgrade fails -#REMOVEME? ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# CHECK WHICH PARTS SHOULD BE CHANGED -#================================================= - -#REMOVEME? change_domain=0 -#REMOVEME? if [ "$old_domain" != "$new_domain" ] -then - #REMOVEME? change_domain=1 -fi - -#REMOVEME? change_path=0 -#REMOVEME? if [ "$old_path" != "$new_path" ] -then - #REMOVEME? change_path=1 -fi - #================================================= # STANDARD MODIFICATIONS #================================================= @@ -79,30 +25,6 @@ ynh_script_progression --message="Updating NGINX web server configuration..." -- ynh_change_url_nginx_config -#REMOVEME? nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf - -# Change the path in the NGINX config file -if [ $change_path -eq 1 ] -then - # Make a backup of the original NGINX config file if modified -#REMOVEME? ynh_backup_if_checksum_is_different --file="$nginx_conf_path" - # Set global variables for NGINX helper -#REMOVEME? domain="$old_domain" -#REMOVEME? path="$new_path" - # Create a dedicated NGINX config -#REMOVEME? ynh_add_nginx_config -fi - -# Change the domain for NGINX -if [ $change_domain -eq 1 ] -then - # Delete file checksum for the old conf file location -#REMOVEME? ynh_delete_file_checksum --file="$nginx_conf_path" -#REMOVEME? mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf - # Store file checksum for the new config file location -#REMOVEME? ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" -fi - #================================================= # GENERIC FINALISATION #================================================= @@ -112,13 +34,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Console:" -#================================================= -# RELOAD NGINX -#================================================= -#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -#REMOVEME? #REMOVEME? ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/install b/scripts/install index ad184d6..d90bb93 100755 --- a/scripts/install +++ b/scripts/install @@ -9,84 +9,18 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -#REMOVEME? ynh_clean_setup () { - ynh_clean_check_starting -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# RETRIEVE ARGUMENTS FROM THE MANIFEST -#================================================= - -#REMOVEME? domain=$YNH_APP_ARG_DOMAIN -path="/" -#REMOVEME? is_public=$YNH_APP_ARG_IS_PUBLIC -#REMOVEME? admin=$YNH_APP_ARG_ADMIN -#REMOVEME? password=$YNH_APP_ARG_PASSWORD - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#================================================= -# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS -#================================================= -#REMOVEME? ynh_script_progression --message="Validating installation parameters..." --weight=1 - -#REMOVEME? install_dir=/var/www/$app -#REMOVEME? test ! -e "$install_dir" || ynh_die --message="This path already contains a folder" - mc_path=$install_dir/mc -# Register (book) web path -#REMOVEME? ynh_webpath_register --app=$app --domain=$domain --path=$path - -#================================================= -# STORE SETTINGS FROM MANIFEST -#================================================= -#REMOVEME? ynh_script_progression --message="Storing installation settings..." --weight=1 - -#REMOVEME? ynh_app_setting_set --app=$app --key=domain --value=$domain -#REMOVEME? ynh_app_setting_set --app=$app --key=path --value=$path -#REMOVEME? ynh_app_setting_set --app=$app --key=admin --value=$admin -#REMOVEME? ynh_app_setting_set --app=$app --key=password --value=$password -#REMOVEME? ynh_app_setting_set --app=$app --key=mc_path --value=$mc_path - #================================================= # STANDARD MODIFICATIONS -#================================================= -# FIND AND OPEN A PORT -#================================================= -#REMOVEME? ynh_script_progression --message="Finding an available port..." --weight=1 - -# Find an available port -#REMOVEME? port=$(ynh_find_port --port=9000) -#REMOVEME? ynh_app_setting_set --app=$app --key=port --value=$port - -# Find an available port for minio-console -#REMOVEME? console_port=$(ynh_find_port --port=36669) -#REMOVEME? ynh_app_setting_set --app=$app --key=console_port --value=$console_port - -#================================================= -# CREATE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Configuring system user..." --weight=1 - -# Create a system user -#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= ynh_script_progression --message="Setting up source files..." --weight=10 -#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" -ynh_setup_source --dest_dir="$mc_path" --source_id="mc_$YNH_ARCH" +ynh_setup_source --dest_dir="$mc_path" --source_id="mc" chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" @@ -107,12 +41,7 @@ ynh_add_nginx_config #================================================= # CREATE DATA DIRECTORY #================================================= -ynh_script_progression --message="Creating a data directory..." --weight=1 - -#REMOVEME? data_dir=/home/yunohost.app/$app -#REMOVEME? ynh_app_setting_set --app=$app --key=data_dir --value=$data_dir - -mkdir -p $data_dir +ynh_script_progression --message="Setting permissions for the data directory..." --weight=1 chmod 750 "$data_dir" chmod -R o-rwx "$data_dir" @@ -161,26 +90,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=3 # Start a systemd service ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Console:" -#================================================= -# SETUP SSOWAT -#================================================= -#REMOVEME? ynh_script_progression --message="Configuring permissions..." --weight=1 - -# Make app public if necessary -#REMOVEME? if [ $is_public -eq 1 ] -then - # Everyone can access the app. - # The "main" permission is automatically created before the install script. -#REMOVEME? ynh_permission_update --permission="main" --add="visitors" -fi - -#================================================= -# RELOAD NGINX -#================================================= -#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload - #================================================= # SETUP MINIO CLIENT #================================================= diff --git a/scripts/remove b/scripts/remove index 5a3b8d7..3d0ea77 100755 --- a/scripts/remove +++ b/scripts/remove @@ -9,17 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) - #================================================= # STANDARD REMOVE #================================================= @@ -49,25 +38,6 @@ ynh_script_progression --message="Removing logrotate configuration..." --weight= # Remove the app-specific logrotate config ynh_remove_logrotate -#================================================= -# REMOVE APP MAIN DIR -#================================================= -#REMOVEME? ynh_script_progression --message="Removing app main directory..." --weight=3 - -# Remove the app directory securely -#REMOVEME? ynh_secure_remove --file="$install_dir" - -#================================================= -# REMOVE DATA DIR -#================================================= - -# Remove the data directory if --purge option is used -if [ "${YNH_APP_PURGE:-0}" -eq 1 ] -then - ynh_script_progression --message="Removing app data directory..." --weight=1 -#REMOVEME? ynh_secure_remove --file="$data_dir" -fi - #================================================= # REMOVE NGINX CONFIGURATION #================================================= @@ -79,12 +49,9 @@ ynh_remove_nginx_config #================================================= # GENERIC FINALIZATION #================================================= -# REMOVE DEDICATED USER +# ... #================================================= -#REMOVEME? ynh_script_progression --message="Removing the dedicated system user..." --weight=1 -# Delete a system user -#REMOVEME? ynh_system_user_delete --username=$app #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index b2c1ed5..34d234b 100755 --- a/scripts/restore +++ b/scripts/restore @@ -9,37 +9,8 @@ # Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers - -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -#REMOVEME? ynh_clean_setup () { - ynh_clean_check_starting -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) -#REMOVEME? mc_path=$(ynh_app_setting_get --app=$app --key=mc_path) - -#================================================= -# CHECK IF THE APP CAN BE RESTORED -#================================================= -#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." --weight=1 - -#REMOVEME? test ! -d $install_dir \ - || ynh_die --message="There is already a directory: $install_dir " + +mc_path="$install_dir/mc" #================================================= # STANDARD RESTORATION STEPS @@ -50,14 +21,6 @@ ynh_script_progression --message="Restoring the NGINX web server configuration.. ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# RECREATE THE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 - -# Create the dedicated user (if not existing) -#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" - #================================================= # RESTORE THE APP MAIN DIR #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 5d9150b..60630b2 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,23 +9,7 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) -#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? mc_path=$(ynh_app_setting_get --app=$app --key=mc_path) -#REMOVEME? admin=$(ynh_app_setting_get --app=$app --key=admin) -#REMOVEME? password=$(ynh_app_setting_get --app=$app --key=password) -#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) -#REMOVEME? console_port=$(ynh_app_setting_get --app=$app --key=console_port) -#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) +mc_path="$install_dir/mc" #================================================= # CHECK VERSION @@ -34,21 +18,6 @@ ynh_script_progression --message="Checking version..." upgrade_type=$(ynh_check_app_version_changed) -#================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP -#================================================= -#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1 - -# Backup the current version of the app -#REMOVEME? ynh_backup_before_upgrade -#REMOVEME? ynh_clean_setup () { - ynh_clean_check_starting - # Restore it if the upgrade fails -#REMOVEME? ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= @@ -83,7 +52,7 @@ then ynh_die --message="Sorry, your MinIO instance requires a complex manual migration. Please contact Limezy on the Yunohost forum" fi popd -#REMOVEME? ynh_secure_remove --file="$data_dir" + ynh_secure_remove --file="$data_dir" ynh_exec_warn_less mkdir "$data_dir" chmod 750 "$data_dir" chmod -R o-rwx "$data_dir" @@ -101,14 +70,6 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=2 ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" -#================================================= -# CREATE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 - -# Create a dedicated user (if not existing) -#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -178,13 +139,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=3 ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Console:" -#================================================= -# RELOAD NGINX -#================================================= -#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload - #================================================= # SETUP MINIO CLIENT #================================================= diff --git a/tests.toml b/tests.toml new file mode 100644 index 0000000..d77f0b1 --- /dev/null +++ b/tests.toml @@ -0,0 +1,23 @@ +test_format = 1.0 + +[default] + + # ------------ + # Tests to run + # ------------ + + exclude = ["install.subdir", "install.nourl", "install.multi"] # The test IDs to be used in only/exclude statements are: install.root, install.subdir, install.nourl, install.multi, backup_restore, upgrade, upgrade.someCommitId change_url + # NB: you should NOT need this except if you really have a good reason... + + # ------------------------------- + # Default args to use for install + # ------------------------------- + + args.password = "acab" + + # ------------------------------- + # Commits to test upgrade from + # ------------------------------- + + # test_upgrade_from.00a1a6e7.name = "Upgrade from 5.4" + # test_upgrade_from.00a1a6e7.args.foo = "bar" From 78db8fc9ba3af507648e5f1a67e769ee672ac6c8 Mon Sep 17 00:00:00 2001 From: Tagada <36127788+Tagadda@users.noreply.github.com> Date: Fri, 19 May 2023 23:13:12 +0200 Subject: [PATCH 05/20] bump version --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 356d346..7930c6c 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "MinIO server" description.en = "High Performance, Kubernetes Native Object Storage" description.fr = "Serveur de stockage d'objets hautes performances" -version = "2023.05.04~ynh1" +version = "2023.05.04~ynh2" maintainers = ["Raoul de Limezy"] From 91945232f73f7b9401561f60c07d97887d5b4c26 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 19 May 2023 21:13:23 +0000 Subject: [PATCH 06/20] Auto-update README --- README.md | 16 +++++++--------- README_fr.md | 16 +++++++--------- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 14a4458..2800086 100644 --- a/README.md +++ b/README.md @@ -18,15 +18,6 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in MinIO is a High Performance Object Storage released under GNU Affero General Public License v3.0. It is API compatible with Amazon S3 cloud storage service. Use MinIO to build high performance infrastructure for machine learning, analytics and application data workloads. - -**Shipped version:** 2023.05.04~ynh1 - -## Screenshots - -![Screenshot of MinIO server](./doc/screenshots/minio-browser.png) - -## Disclaimers / important information - ## How to create a Yunohost app using MinIO During the install process, MinIO will install both the MinIO server and MinIO client. If your app needs to use an Amazon S3 storage, I recommend to use the MinIO client to create and setup buckets as per your app's requirements. You can have a look at outline_ynh app for reference. @@ -54,6 +45,13 @@ pushd "$mc_path" ynh_exec_warn_less sudo -u minio ./mc policy set NEEDED_POLICY minio/NAME_OF_YOUR_BUCKET popd ``` + +**Shipped version:** 2023.05.04~ynh2 + +## Screenshots + +![Screenshot of MinIO server](./doc/screenshots/minio-browser.png) + ## Documentation and resources * Official app website: diff --git a/README_fr.md b/README_fr.md index 68b63c1..7a3cce4 100644 --- a/README_fr.md +++ b/README_fr.md @@ -18,15 +18,6 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po MinIO is a High Performance Object Storage released under GNU Affero General Public License v3.0. It is API compatible with Amazon S3 cloud storage service. Use MinIO to build high performance infrastructure for machine learning, analytics and application data workloads. - -**Version incluse :** 2023.05.04~ynh1 - -## Captures d’écran - -![Capture d’écran de MinIO server](./doc/screenshots/minio-browser.png) - -## Avertissements / informations importantes - ## How to create a Yunohost app using MinIO During the install process, MinIO will install both the MinIO server and MinIO client. If your app needs to use an Amazon S3 storage, I recommend to use the MinIO client to create and setup buckets as per your app's requirements. You can have a look at outline_ynh app for reference. @@ -54,6 +45,13 @@ pushd "$mc_path" ynh_exec_warn_less sudo -u minio ./mc policy set NEEDED_POLICY minio/NAME_OF_YOUR_BUCKET popd ``` + +**Version incluse :** 2023.05.04~ynh2 + +## Captures d’écran + +![Capture d’écran de MinIO server](./doc/screenshots/minio-browser.png) + ## Documentations et ressources * Site officiel de l’app : From 37e266c0cd346ca7e74e22d896ef2f8946c13310 Mon Sep 17 00:00:00 2001 From: Tagada <36127788+Tagadda@users.noreply.github.com> Date: Fri, 19 May 2023 23:46:00 +0200 Subject: [PATCH 07/20] fix sources and mc_path --- manifest.toml | 5 +++-- scripts/install | 10 ++++------ scripts/restore | 4 +--- scripts/upgrade | 14 ++++++-------- 4 files changed, 14 insertions(+), 19 deletions(-) diff --git a/manifest.toml b/manifest.toml index 7930c6c..2d5359d 100644 --- a/manifest.toml +++ b/manifest.toml @@ -46,7 +46,8 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen [resources] [resources.sources] - [resources.sources.main] + [resources.sources.minio] + extract = false in_subdir = false arm64.url = "https://dl.min.io/server/minio/release/linux-arm64/archive/minio.RELEASE.2023-05-04T21-44-30Z" arm64.sha256 = "4948d289e75a54596e6c78a738f95a1bbec5ec159895406917c340d51c4375c9" @@ -54,13 +55,13 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen amd64.sha256 = "2dce77cec0e4536c5736dee064e478a59dc063fe2e40e3f5fed275252de5e8c7" [resources.sources.mc] + extract = false in_subdir = false arm64.url = "https://dl.min.io/client/mc/release/linux-arm64/archive/mc.RELEASE.2023-05-04T18-10-16Z" arm64.sha256 = "b2beb693e09528c25dbb566abf88bb0b94fd2477730c00a496bfceb0f8e9cd2b" amd64.url = "https://dl.min.io/client/mc/release/linux-amd64/archive/mc.RELEASE.2023-05-04T18-10-16Z" amd64.sha256 = "cd26ea353811880704efe8eb1b3335461240c1d4f7e4f3efee1b4391697662e4" - [resources.system_user] [resources.install_dir] diff --git a/scripts/install b/scripts/install index d90bb93..9650953 100755 --- a/scripts/install +++ b/scripts/install @@ -9,8 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -mc_path=$install_dir/mc - #================================================= # STANDARD MODIFICATIONS #================================================= @@ -19,14 +17,14 @@ mc_path=$install_dir/mc ynh_script_progression --message="Setting up source files..." --weight=10 # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$install_dir" -ynh_setup_source --dest_dir="$mc_path" --source_id="mc" +ynh_setup_source --dest_dir="$install_dir/minio" --source_id="minio" +ynh_setup_source --dest_dir="$install_dir/mc" --source_id="mc" chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" chmod +x "$install_dir/minio" -chmod +x "$mc_path/mc" +chmod +x "$install_dir/mc" #================================================= # NGINX CONFIGURATION @@ -95,7 +93,7 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --l #================================================= ynh_script_progression --message="Configuring MinIO client..." --weight=1 -pushd $mc_path +pushd $install_dir ynh_exec_warn_less sudo -u $app ./mc --no-color alias set minio "http://127.0.0.1:$port" "$admin" "$password" --api S3v4 popd diff --git a/scripts/restore b/scripts/restore index 34d234b..5f83d30 100755 --- a/scripts/restore +++ b/scripts/restore @@ -9,8 +9,6 @@ # Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers - -mc_path="$install_dir/mc" #================================================= # STANDARD RESTORATION STEPS @@ -32,7 +30,7 @@ chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" chmod +x "$install_dir/minio" -chmod +x "$mc_path/mc" +chmod +x "$install_dir/mc" #================================================= # RESTORE THE DATA DIRECTORY diff --git a/scripts/upgrade b/scripts/upgrade index 60630b2..6be3134 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,8 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -mc_path="$install_dir/mc" - #================================================= # CHECK VERSION #================================================= @@ -36,7 +34,7 @@ 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" + ynh_exec_warn_less sudo -u $app $install_dir/mc mirror --preserve "minio/$d" "$tmp/$d" fi done if ynh_compare_current_package_version --comparison eq --version 2022.09.01~ynh1 @@ -79,15 +77,15 @@ then ynh_script_progression --message="Upgrading source files..." --weight=5 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" --keep=".env" - ynh_setup_source --dest_dir="$mc_path" --source_id="mc_$YNH_ARCH" + ynh_setup_source --dest_dir="$install_dir/minio" + ynh_setup_source --dest_dir="$install_dir/mc" --source_id="mc" fi chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" chmod +x "$install_dir/minio" -chmod +x "$mc_path/mc" +chmod +x "$install_dir/mc" #================================================= # NGINX CONFIGURATION @@ -144,7 +142,7 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --l #================================================= ynh_script_progression --message="Configuring MinIO client..." --weight=1 -pushd $mc_path +pushd $install_dir ynh_exec_warn_less sudo -u $app ./mc --no-color alias set minio "https://$domain" "$admin" "$password" --api S3v4 popd @@ -163,7 +161,7 @@ then ynh_script_progression --message="No buckets to migrate" else ynh_script_progression --message="Migrating bucket $d" - pushd $mc_path + pushd $install_dir ynh_exec_warn_less sudo -u $app ./mc mb 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 ! From 31ce1fd95e5b5289fe89a62751a61cf59921ef6f Mon Sep 17 00:00:00 2001 From: Tagada <36127788+Tagadda@users.noreply.github.com> Date: Fri, 19 May 2023 23:52:02 +0200 Subject: [PATCH 08/20] v2 --- conf/.env | 2 +- conf/nginx.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/.env b/conf/.env index a5fdb53..9987ad1 100644 --- a/conf/.env +++ b/conf/.env @@ -1,4 +1,4 @@ MINIO_ROOT_USER=__ADMIN__ MINIO_ROOT_PASSWORD=__PASSWORD__ MINIO_VOLUMES="__DATA_DIR__/" -MINIO_OPTS="-C __FINAL_PATH__/ --address 127.0.0.1:__PORT__ --console-address :__CONSOLE_PORT__" +MINIO_OPTS="-C __FINAL_PATH__/ --address 127.0.0.1:__PORT__ --console-address :__PORT_CONSOLE__" diff --git a/conf/nginx.conf b/conf/nginx.conf index d699684..923afcc 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,7 +1,7 @@ rewrite ^$ /; location ~ ^(/ws|/api|/images|/Loader.svg|/apple-icon-180x180.png|/favicon-96x96.png|/favicon-16x16.png|/favicon-32x32.png|/login|/styles|/static|/manifest.json|/$) { - proxy_pass http://127.0.0.1:__CONSOLE_PORT__; + proxy_pass http://127.0.0.1:__PORT_CONSOLE__; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; From b4eec09d9a44884f014891803ef87b3f773851ea Mon Sep 17 00:00:00 2001 From: Tagada <36127788+Tagadda@users.noreply.github.com> Date: Fri, 19 May 2023 23:55:36 +0200 Subject: [PATCH 09/20] v2 --- conf/.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/.env b/conf/.env index 9987ad1..742d54f 100644 --- a/conf/.env +++ b/conf/.env @@ -1,4 +1,4 @@ MINIO_ROOT_USER=__ADMIN__ MINIO_ROOT_PASSWORD=__PASSWORD__ MINIO_VOLUMES="__DATA_DIR__/" -MINIO_OPTS="-C __FINAL_PATH__/ --address 127.0.0.1:__PORT__ --console-address :__PORT_CONSOLE__" +MINIO_OPTS="-C __INSTALL_DIR__/ --address 127.0.0.1:__PORT__ --console-address :__PORT_CONSOLE__" From 0640ca56a3cdf0fa43d392d874899898e141d62b Mon Sep 17 00:00:00 2001 From: Tagada <36127788+Tagadda@users.noreply.github.com> Date: Sat, 20 May 2023 11:42:01 +0200 Subject: [PATCH 10/20] v2 --- scripts/install | 4 ++-- scripts/upgrade | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index 9650953..a785615 100755 --- a/scripts/install +++ b/scripts/install @@ -17,8 +17,8 @@ source /usr/share/yunohost/helpers ynh_script_progression --message="Setting up source files..." --weight=10 # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$install_dir/minio" --source_id="minio" -ynh_setup_source --dest_dir="$install_dir/mc" --source_id="mc" +ynh_setup_source --dest_dir="$install_dir" --source_id="minio" +ynh_setup_source --dest_dir="$install_dir" --source_id="mc" chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" diff --git a/scripts/upgrade b/scripts/upgrade index 6be3134..010f215 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -77,8 +77,8 @@ then ynh_script_progression --message="Upgrading source files..." --weight=5 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir/minio" - ynh_setup_source --dest_dir="$install_dir/mc" --source_id="mc" + ynh_setup_source --dest_dir="$install_dir" --source_id="minio" + ynh_setup_source --dest_dir="$install_dir" --source_id="mc" fi chmod 750 "$install_dir" From 6a3f107f3caaff9690be6f3198117f57a42030c1 Mon Sep 17 00:00:00 2001 From: Tagada <36127788+Tagadda@users.noreply.github.com> Date: Sat, 20 May 2023 12:07:15 +0200 Subject: [PATCH 11/20] stronger password for tests --- tests.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests.toml b/tests.toml index d77f0b1..4652b1d 100644 --- a/tests.toml +++ b/tests.toml @@ -13,7 +13,7 @@ test_format = 1.0 # Default args to use for install # ------------------------------- - args.password = "acab" + args.password = "acab1312" # ------------------------------- # Commits to test upgrade from From fcb3c7d98e74a1f7531f890c709c17bdcddfa01a Mon Sep 17 00:00:00 2001 From: Tagada <36127788+Tagadda@users.noreply.github.com> Date: Sat, 20 May 2023 13:17:54 +0200 Subject: [PATCH 12/20] v2 --- scripts/upgrade | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 010f215..5ae09ba 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -59,6 +59,12 @@ else ynh_script_progression --message="No migration to be done" fi +# Retrieve the password from the .env file +if [ -z $password ]; +then + password = $(ynh_read_var_in_file --file="$install_dir/.env" --key="MINIO_ROOT_PASSWORD") +fi + #================================================= # STANDARD UPGRADE STEPS #================================================= From fbb151e90c821ba8a8f9489f7ef5dcf2157d942e Mon Sep 17 00:00:00 2001 From: Tagada <36127788+Tagadda@users.noreply.github.com> Date: Sat, 20 May 2023 13:39:28 +0200 Subject: [PATCH 13/20] bash and me :D --- scripts/upgrade | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 5ae09ba..1fef0bf 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -60,9 +60,8 @@ else fi # Retrieve the password from the .env file -if [ -z $password ]; -then - password = $(ynh_read_var_in_file --file="$install_dir/.env" --key="MINIO_ROOT_PASSWORD") +if [ -z $password ]; then + password=$(ynh_read_var_in_file --file="$install_dir/.env" --key="MINIO_ROOT_PASSWORD") fi #================================================= From 2d4cf863ed3d13f25d2cc6b244fbfbcff021aa48 Mon Sep 17 00:00:00 2001 From: Tagada <36127788+Tagadda@users.noreply.github.com> Date: Sat, 20 May 2023 14:54:43 +0200 Subject: [PATCH 14/20] zblerg --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 1fef0bf..995b7a7 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -60,7 +60,7 @@ else fi # Retrieve the password from the .env file -if [ -z $password ]; then +if [ -z "$password" ]; then password=$(ynh_read_var_in_file --file="$install_dir/.env" --key="MINIO_ROOT_PASSWORD") fi From e1a68a8c275ccf10b71161b58e0fc8966630218c Mon Sep 17 00:00:00 2001 From: Tagada <36127788+Tagadda@users.noreply.github.com> Date: Sat, 20 May 2023 19:52:29 +0200 Subject: [PATCH 15/20] bash again --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 995b7a7..0198bfb 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -60,7 +60,7 @@ else fi # Retrieve the password from the .env file -if [ -z "$password" ]; then +if [ -z "${password:-}" ]; then password=$(ynh_read_var_in_file --file="$install_dir/.env" --key="MINIO_ROOT_PASSWORD") fi From ac18143239fd518b8be5766621d1dfbb6685f3f8 Mon Sep 17 00:00:00 2001 From: Tagada <36127788+Tagadda@users.noreply.github.com> Date: Tue, 23 May 2023 13:45:26 +0200 Subject: [PATCH 16/20] Update manifest.toml --- manifest.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/manifest.toml b/manifest.toml index 2d5359d..9d820a4 100644 --- a/manifest.toml +++ b/manifest.toml @@ -14,7 +14,7 @@ license = "AGPL-3.0-only" website = "https://min.io" admindoc = "https://docs.min.io/" code = "https://github.com/minio/minio" -cpe = " cpe:2.3:a:min:minio_console" +cpe = "cpe:2.3:a:minio:minio" [integration] yunohost = ">= 11.1" @@ -22,9 +22,9 @@ architectures = ["amd64", "arm64"] multi_instance = false ldap = "not_relevant" sso = "not_relevant" -disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... -ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... -ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... +disk = "150M" +ram.build = "700M" +ram.runtime = "700M" [install] [install.domain] From 5ea337ab48e6642f4da0d065662600c777b406bd Mon Sep 17 00:00:00 2001 From: Tagada <36127788+Tagadda@users.noreply.github.com> Date: Mon, 5 Jun 2023 17:49:29 +0200 Subject: [PATCH 17/20] Update manifest.toml --- manifest.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/manifest.toml b/manifest.toml index 9d820a4..c7cb099 100644 --- a/manifest.toml +++ b/manifest.toml @@ -70,6 +70,7 @@ ram.runtime = "700M" [resources.permissions] main.url = "/" + main.auth_header = false [resources.ports] main.default = 9000 From fd9870ffaf1ff8cccb013f8f6c1695ffa5f6d864 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 15 Sep 2023 16:59:43 +0200 Subject: [PATCH 18/20] cleaning --- .github/workflows/updater.sh | 137 ---------------------------------- .github/workflows/updater.yml | 50 ------------- doc/DESCRIPTION.md | 4 +- manifest.toml | 8 +- scripts/install | 44 ++--------- scripts/remove | 27 +------ scripts/restore | 44 +++-------- scripts/upgrade | 34 ++------- 8 files changed, 33 insertions(+), 315 deletions(-) delete mode 100644 .github/workflows/updater.sh delete mode 100644 .github/workflows/updater.yml diff --git a/.github/workflows/updater.sh b/.github/workflows/updater.sh deleted file mode 100644 index c938f96..0000000 --- a/.github/workflows/updater.sh +++ /dev/null @@ -1,137 +0,0 @@ -#!/bin/bash - -#================================================= -# PACKAGE UPDATING HELPER -#================================================= - -# This script is meant to be run by GitHub Actions -# The YunoHost-Apps organisation offers a template Action to run this script periodically -# Since each app is different, maintainers can adapt its contents so as to perform -# automatic actions when a new upstream release is detected. - -#================================================= -# FETCHING LATEST RELEASE AND ITS ASSETS -#================================================= - -# Fetching information -current_version=$(cat manifest.json | jq -j '.version|split("~")[0]') -repo=$(cat manifest.json | jq -j '.upstream.code|split("https://github.com/")[1]') -# Some jq magic is needed, because the latest upstream release is not always the latest version (e.g. security patches for older versions) -version=$(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '.[] | select( .prerelease != true ) | .tag_name' | sort -V | tail -1) -mc_version=$(curl --silent "https://api.github.com/repos/minio/mc/releases" | jq -r '.[] | select( .prerelease != true ) | .tag_name' | sort -V | tail -1) - -# Later down the script, we assume the version has only digits and dots -# Sometimes the release name starts with a "v", so let's filter it out. -# You may need more tweaks here if the upstream repository has different naming conventions. -if [[ ${version:0:1} == "v" || ${version:0:1} == "V" ]]; then - version=${version:1} -fi - -# Setting up the environment variables -echo "Current version: $current_version" -echo "Latest release from upstream: $version" -echo "VERSION=$version" >> $GITHUB_ENV -echo "REPO=$repo" >> $GITHUB_ENV -# For the time being, let's assume the script will fail -echo "PROCEED=false" >> $GITHUB_ENV - -# Proceed only if the retrieved version is greater than the current one -if [[ ! "$version" > "$current_version" ]] ; then - echo "::warning ::No new version available" - exit 0 -# Proceed only if a PR for this new version does not already exist -elif git ls-remote -q --exit-code --heads https://github.com/$GITHUB_REPOSITORY.git ci-auto-update-v$version ; then - echo "::warning ::A branch already exists for this update" - exit 0 -fi - -#================================================= -# UPDATE SOURCE FILES -#================================================= - -# Here we use the $assets variable to get the resources published in the upstream release. -# Here is an example for Grav, it has to be adapted in accordance with how the upstream releases look like. - -# Let's loop over the array of assets URLs -for src in mc_amd64 mc_arm64 amd64 arm64; do - -case $src in - "amd64") - asset_url="https://dl.min.io/server/minio/release/linux-amd64/archive/minio.$version" - src_filename=minio - ;; - "arm64") - asset_url="https://dl.min.io/server/minio/release/linux-arm64/archive/minio.$version" - src_filename=minio - ;; - "mc_amd64") - asset_url="https://dl.min.io/client/mc/release/linux-amd64/archive/mc.$mc_version" - src_filename=mc - ;; - "mc_arm64") - asset_url="https://dl.min.io/client/mc/release/linux-arm64/archive/mc.$mc_version" - src_filename=mc - ;; -esac - -echo "Handling asset at $asset_url" - - -# If $src is not empty, let's process the asset -if [ ! -z "$src" ]; then - -# Create the temporary directory -tempdir="$(mktemp -d)" - -# Download sources and calculate checksum -filename=${asset_url##*/} -curl --silent -4 -L $asset_url -o "$tempdir/$filename" -checksum=$(sha256sum "$tempdir/$filename" | head -c 64) - -# Delete temporary directory -rm -rf $tempdir - -# Get extension -if [[ $filename == *.tar.gz ]]; then - extension=tar.gz -else - extension=${filename##*.} -fi - -# Rewrite source file -cat < conf/$src.src -SOURCE_URL=$asset_url -SOURCE_SUM=$checksum -SOURCE_SUM_PRG=sha256sum -SOURCE_IN_SUBDIR=false -SOURCE_FILENAME=$src_filename -SOURCE_EXTRACT=false -EOT -echo "... conf/$src.src updated" - -else -echo "... asset ignored" -fi - -done - -#================================================= -# SPECIFIC UPDATE STEPS -#================================================= - -# Any action on the app's source code can be done. -# The GitHub Action workflow takes care of committing all changes after this script ends. - -#================================================= -# GENERIC FINALIZATION -#================================================= - -# Replace new version in manifest -version=$(sed -E "s/RELEASE\.([0-9-]+)T.+/\1/g" <<< $version | sed -E "s/-/./g") -echo "$(jq -s --indent 4 ".[] | .version = \"$version~ynh1\"" manifest.json)" > manifest.json - -# No need to update the README, yunohost-bot takes care of it - -# The Action will proceed only if the PROCEED environment variable is set to true -echo "PROCEED=true" >> $GITHUB_ENV -exit 0 diff --git a/.github/workflows/updater.yml b/.github/workflows/updater.yml deleted file mode 100644 index 415f76c..0000000 --- a/.github/workflows/updater.yml +++ /dev/null @@ -1,50 +0,0 @@ -# This workflow allows GitHub Actions to automagically update your app whenever a new upstream release is detected. -# You need to enable Actions in your repository settings, and fetch this Action from the YunoHost-Apps organization. -# This file should be enough by itself, but feel free to tune it to your needs. -# It calls updater.sh, which is where you should put the app-specific update steps. -name: Check for new upstream releases -on: - # Allow to manually trigger the workflow - workflow_dispatch: - # Run it at 6:00 UTC every 1st or 15th of the month - schedule: - - cron: '0 6 1,15 * *' -jobs: - updater: - runs-on: ubuntu-latest - steps: - - name: Fetch the source code - uses: actions/checkout@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: Run the updater script - id: run_updater - run: | - # Setting up Git user - git config --global user.name 'yunohost-bot' - git config --global user.email 'yunohost-bot@users.noreply.github.com' - # Run the updater script - /bin/bash .github/workflows/updater.sh - - name: Commit changes - id: commit - if: ${{ env.PROCEED == 'true' }} - run: | - git commit -am "Upgrade to v$VERSION" - - name: Create Pull Request - id: cpr - if: ${{ env.PROCEED == 'true' }} - uses: peter-evans/create-pull-request@v4 - with: - token: ${{ secrets.GITHUB_TOKEN }} - commit-message: Update to version ${{ env.VERSION }} - committer: 'yunohost-bot ' - author: 'yunohost-bot ' - signoff: false - base: testing - branch: ci-auto-update-v${{ env.VERSION }} - delete-branch: true - title: 'Upgrade to version ${{ env.VERSION }}' - body: | - Upgrade to v${{ env.VERSION }} - draft: false - diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index ef1ed65..cbefc00 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -4,7 +4,7 @@ MinIO is a High Performance Object Storage released under GNU Affero General Pub During the install process, MinIO will install both the MinIO server and MinIO client. If your app needs to use an Amazon S3 storage, I recommend to use the MinIO client to create and setup buckets as per your app's requirements. You can have a look at outline_ynh app for reference. -### First step : retrieve MinIO credentials +### First step: retrieve MinIO credentials ``` #================================================= # SETUP MINIO CREDENTIALS @@ -15,7 +15,7 @@ minio_password=$(ynh_app_setting_get --app="minio" --key=password) mc_path=$(ynh_app_setting_get --app="minio" --key=mc_path) ``` -### Second step : create and setup your bucket +### Second step: create and setup your bucket ``` #================================================= # SETUP MINIO BUCKET diff --git a/manifest.toml b/manifest.toml index c7cb099..0c766dc 100644 --- a/manifest.toml +++ b/manifest.toml @@ -17,8 +17,8 @@ code = "https://github.com/minio/minio" cpe = "cpe:2.3:a:minio:minio" [integration] -yunohost = ">= 11.1" -architectures = ["amd64", "arm64"] +yunohost = ">= 11.2" +architectures = ["amd64", "arm64"] multi_instance = false ldap = "not_relevant" sso = "not_relevant" @@ -28,20 +28,16 @@ ram.runtime = "700M" [install] [install.domain] - # this is a generic question - ask strings are automatically handled by Yunohost's core type = "domain" - full_domain = true [install.init_main_permission] type = "group" default = "visitors" [install.admin] - # this is a generic question - ask strings are automatically handled by Yunohost's core type = "user" [install.password] - # this is a generic question - ask strings are automatically handled by Yunohost's core type = "password" [resources] diff --git a/scripts/install b/scripts/install index a785615..1739c6e 100755 --- a/scripts/install +++ b/scripts/install @@ -27,23 +27,20 @@ chmod +x "$install_dir/minio" chmod +x "$install_dir/mc" #================================================= -# NGINX CONFIGURATION +# SYSTEM CONFIGURATION #================================================= -ynh_script_progression --message="Configuring NGINX web server..." --weight=4 +ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# SPECIFIC SETUP -#================================================= -# CREATE DATA DIRECTORY -#================================================= -ynh_script_progression --message="Setting permissions for the data directory..." --weight=1 +# Create a dedicated systemd config +ynh_add_systemd_config -chmod 750 "$data_dir" -chmod -R o-rwx "$data_dir" -chown -R $app:www-data "$data_dir" +# Use logrotate to manage application logfile(s) +ynh_use_logrotate + +yunohost service add $app --description="A High Performance, Kubernetes Native Object Storage" --log="/var/log/$app/$app.log" #================================================= # ADD A CONFIGURATION @@ -55,31 +52,6 @@ ynh_add_config --template="../conf/.env" --destination="$install_dir/.env" chmod 400 "$install_dir/.env" chown $app:$app "$install_dir/.env" -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Configuring a systemd service..." --weight=1 - -# Create a dedicated systemd config -ynh_add_systemd_config - -#================================================= -# GENERIC FINALIZATION -#================================================= -# SETUP LOGROTATE -#================================================= -ynh_script_progression --message="Configuring log rotation..." --weight=1 - -# Use logrotate to manage application logfile(s) -ynh_use_logrotate - -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=2 - -yunohost service add $app --description="A High Performance, Kubernetes Native Object Storage" --log="/var/log/$app/$app.log" - #================================================= # START SYSTEMD SERVICE #================================================= diff --git a/scripts/remove b/scripts/remove index 3d0ea77..14783f7 100755 --- a/scripts/remove +++ b/scripts/remove @@ -10,10 +10,11 @@ source _common.sh source /usr/share/yunohost/helpers #================================================= -# STANDARD REMOVE +# REMOVE SYSTEM CONFIGURATIONS #================================================= -# REMOVE SERVICE INTEGRATION IN YUNOHOST +# REMOVE SYSTEMD SERVICE #================================================= +ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 # Remove the service from the list of services known by YunoHost (added from `yunohost service add`) if ynh_exec_warn_less yunohost service status $app >/dev/null @@ -22,37 +23,15 @@ then yunohost service remove $app fi -#================================================= -# STOP AND REMOVE SERVICE -#================================================= -ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1 - # Remove the dedicated systemd config ynh_remove_systemd_config -#================================================= -# REMOVE LOGROTATE CONFIGURATION -#================================================= -ynh_script_progression --message="Removing logrotate configuration..." --weight=1 - # Remove the app-specific logrotate config ynh_remove_logrotate -#================================================= -# REMOVE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 - # Remove the dedicated NGINX config ynh_remove_nginx_config -#================================================= -# GENERIC FINALIZATION -#================================================= -# ... -#================================================= - - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index 5f83d30..395ae9a 100755 --- a/scripts/restore +++ b/scripts/restore @@ -10,15 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# STANDARD RESTORATION STEPS -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1 - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - #================================================= # RESTORE THE APP MAIN DIR #================================================= @@ -39,47 +30,32 @@ ynh_script_progression --message="Restoring the data directory..." --weight=3 ynh_restore_file --origin_path="$data_dir" --not_mandatory -mkdir -p $data_dir - -chmod 750 "$data_dir" -chmod -R o-rwx "$data_dir" chown -R $app:www-data "$data_dir" #================================================= -# RESTORE SYSTEMD +# RESTORE SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Restoring the systemd configuration..." --weight=1 +# RESTORE THE PHP-FPM CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 + +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable $app.service --quiet -#================================================= -# RESTORE THE LOGROTATE CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1 - ynh_restore_file --origin_path="/etc/logrotate.d/$app" -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -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" -#================================================= -# START SYSTEMD SERVICE -#================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=3 - -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Console:" - #================================================= # GENERIC FINALIZATION #================================================= -# RELOAD NGINX +# RELOAD NGINX AND PHP-FPM OR THE APP SERVICE #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 +ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 + +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Console:" ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index 0198bfb..d3b6ec2 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,7 +12,6 @@ source /usr/share/yunohost/helpers #================================================= # CHECK VERSION #================================================= -ynh_script_progression --message="Checking version..." upgrade_type=$(ynh_check_app_version_changed) @@ -100,6 +99,14 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." - # Create a dedicated NGINX config ynh_add_nginx_config +# Create a dedicated systemd config +ynh_add_systemd_config + +# Use logrotate to manage app-specific logfile(s) +ynh_use_logrotate --non-append + +yunohost service add $app --description="A High Performance, Kubernetes Native Object Storage" --log="/var/log/$app/$app.log" + #================================================= # UPDATE A CONFIG FILE #================================================= @@ -110,31 +117,6 @@ ynh_add_config --template="../conf/.env" --destination="$install_dir/.env" chmod 400 "$install_dir/.env" chown $app:$app "$install_dir/.env" -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 - -# Create a dedicated systemd config -ynh_add_systemd_config - -#================================================= -# GENERIC FINALIZATION -#================================================= -# SETUP LOGROTATE -#================================================= -ynh_script_progression --message="Upgrading logrotate configuration..." --weight=1 - -# Use logrotate to manage app-specific logfile(s) -ynh_use_logrotate --non-append - -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -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" - #================================================= # START SYSTEMD SERVICE #================================================= From a7ab1c240f7d130e8630a65b158414cc366a6a6b Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 15 Sep 2023 14:59:49 +0000 Subject: [PATCH 19/20] Auto-update README --- README.md | 4 ++-- README_fr.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2800086..938d49b 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ MinIO is a High Performance Object Storage released under GNU Affero General Pub During the install process, MinIO will install both the MinIO server and MinIO client. If your app needs to use an Amazon S3 storage, I recommend to use the MinIO client to create and setup buckets as per your app's requirements. You can have a look at outline_ynh app for reference. -### First step : retrieve MinIO credentials +### First step: retrieve MinIO credentials ``` #================================================= # SETUP MINIO CREDENTIALS @@ -33,7 +33,7 @@ minio_password=$(ynh_app_setting_get --app="minio" --key=password) mc_path=$(ynh_app_setting_get --app="minio" --key=mc_path) ``` -### Second step : create and setup your bucket +### Second step: create and setup your bucket ``` #================================================= # SETUP MINIO BUCKET diff --git a/README_fr.md b/README_fr.md index 7a3cce4..302010c 100644 --- a/README_fr.md +++ b/README_fr.md @@ -22,7 +22,7 @@ MinIO is a High Performance Object Storage released under GNU Affero General Pub During the install process, MinIO will install both the MinIO server and MinIO client. If your app needs to use an Amazon S3 storage, I recommend to use the MinIO client to create and setup buckets as per your app's requirements. You can have a look at outline_ynh app for reference. -### First step : retrieve MinIO credentials +### First step: retrieve MinIO credentials ``` #================================================= # SETUP MINIO CREDENTIALS @@ -33,7 +33,7 @@ minio_password=$(ynh_app_setting_get --app="minio" --key=password) mc_path=$(ynh_app_setting_get --app="minio" --key=mc_path) ``` -### Second step : create and setup your bucket +### Second step: create and setup your bucket ``` #================================================= # SETUP MINIO BUCKET From 87dfbc0da85955b23c449709c79999488c9b8e53 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 15 Sep 2023 19:09:53 +0000 Subject: [PATCH 20/20] Auto-update README --- README.md | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/README.md b/README.md index 00d1f31..41a0cb7 100644 --- a/README.md +++ b/README.md @@ -18,15 +18,6 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in MinIO is a High Performance Object Storage released under GNU Affero General Public License v3.0. It is API compatible with Amazon S3 cloud storage service. Use MinIO to build high performance infrastructure for machine learning, analytics and application data workloads. - -**Shipped version:** 2023.09.07~ynh1 - -## Screenshots - -![Screenshot of MinIO server](./doc/screenshots/minio-browser.png) - -## Disclaimers / important information - ## How to create a Yunohost app using MinIO During the install process, MinIO will install both the MinIO server and MinIO client. If your app needs to use an Amazon S3 storage, I recommend to use the MinIO client to create and setup buckets as per your app's requirements. You can have a look at outline_ynh app for reference. @@ -55,7 +46,7 @@ pushd "$mc_path" popd ``` -**Shipped version:** 2023.05.04~ynh2 +**Shipped version:** 2023.09.07~ynh1 ## Screenshots