diff --git a/README_fr.md b/README_fr.md index 836f3df..1cb13de 100644 --- a/README_fr.md +++ b/README_fr.md @@ -45,4 +45,4 @@ ou sudo yunohost app upgrade pydio -u https://github.com/YunoHost-Apps/pydio_ynh/tree/testing --debug ``` -**Plus d’infos sur le packaging d’applications :** \ No newline at end of file +**Plus d’infos sur le packaging d’applications :** diff --git a/manifest.toml b/manifest.toml index d29cd83..cd95fc1 100644 --- a/manifest.toml +++ b/manifest.toml @@ -9,7 +9,7 @@ description.fr = "Plateforme de partage de fichiers" version = "4.3.1~ynh1" -maintainers = ["salamandar"] +maintainers = ["julienmalik"] [upstream] license = "AGPL-3.0" @@ -28,8 +28,8 @@ ldap = false sso = false disk = "50M" -ram.build = "50M" -ram.runtime = "50M" +ram.build = "500M" +ram.runtime = "500M" [install] [install.domain] @@ -77,7 +77,10 @@ ram.runtime = "50M" grpc.default = 50052 [resources.apt] - packages = "mariadb-server" + packages = [ + "acl", + "mariadb-server", + ] [resources.database] type = "mysql" diff --git a/scripts/backup b/scripts/backup index 4606e12..49546aa 100755 --- a/scripts/backup +++ b/scripts/backup @@ -25,7 +25,6 @@ ynh_backup --src_path="$install_dir" # BACKUP THE DATA DIR #================================================= -# Only relevant if there is a "data_dir" resource for this app ynh_backup --src_path="$data_dir" --is_big #================================================= diff --git a/scripts/install b/scripts/install index 6224e9b..65e225d 100755 --- a/scripts/install +++ b/scripts/install @@ -9,53 +9,52 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# APP "BUILD" (DEPLOYING SOURCES, VENV, COMPILING ETC) #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= ynh_script_progression --message="Setting up source files..." --weight=1 +# Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" -chown -R "$app:www-data" "$install_dir" chmod +x "$install_dir/cells" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R "$app:www-data" "$install_dir" + +#================================================= +# ADD A CONFIGURATION +#================================================= +ynh_script_progression --message="Configuring $app..." --weight=1 + +ynh_add_config --template="../conf/install-conf.yml" --destination="$install_dir/install-conf.yml" +ynh_delete_file_checksum --file="$install_dir/install-conf.yml" + +pushd "$install_dir" + ynh_exec_as "$app" ./cells configure --cli --yaml "./install-conf.yml" +popd +ynh_secure_remove --file="$install_dir/install-conf.yml" + #================================================= # SYSTEM CONFIGURATION #================================================= ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 +# Create a dedicated NGINX config ynh_add_nginx_config +# Create a dedicated systemd config ynh_add_systemd_config - yunohost service add "$app" --description="File sharing platform" --log="/var/log/$app/$app.log" -#================================================= -# APP INITIAL CONFIGURATION -#================================================= -# ADD A CONFIGURATION -#================================================= -ynh_script_progression --message="Configuring $app..." --weight=1 - -ynh_add_config --template="install-conf.yml" --destination="$install_dir/install-conf.yml" - -pushd "$install_dir" - ynh_exec_as $app ./cells configure --cli --yaml "$install_dir/install-conf.yml" -popd - -ynh_secure_remove --file="$install_dir/install-conf.yml" -ynh_delete_file_checksum --file="$install_dir/install-conf.yml" - -#================================================= -# GENERIC FINALIZATION #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" +# Start a systemd service +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="Restart done" #================================================= # END OF SCRIPT diff --git a/scripts/remove b/scripts/remove index 46cdd26..e2a26db 100755 --- a/scripts/remove +++ b/scripts/remove @@ -12,19 +12,26 @@ source /usr/share/yunohost/helpers #================================================= # REMOVE SYSTEM CONFIGURATIONS #================================================= -# 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; then - ynh_script_progression --message="Removing $app service integration..." --weight=1 - yunohost service remove "$app" + yunohost service remove "$app" fi +# Remove the dedicated systemd config ynh_remove_systemd_config +# Remove the dedicated NGINX config ynh_remove_nginx_config +#================================================= +# SPECIFIC REMOVE +#================================================= +# REMOVE VARIOUS FILES +#================================================= +# ynh_script_progression --message="Removing various files..." + #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index 4a92bc2..099e2f6 100755 --- a/scripts/restore +++ b/scripts/restore @@ -17,8 +17,7 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$install_dir" -chown -R "$app:www-data" "$install_dir" -chmod +x "$install_dir/cells" +chown -R $app:www-data "$install_dir" #================================================= # RESTORE THE DATA DIRECTORY @@ -45,7 +44,6 @@ 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 - yunohost service add "$app" --description="File sharing platform" --log="/var/log/$app/$app.log" #================================================= @@ -55,7 +53,7 @@ yunohost service add "$app" --description="File sharing platform" --log="/var/lo #================================================= 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" +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="Restart done" ynh_systemd_action --service_name=nginx --action=reload #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index b8b166f..ba82bc6 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,8 +9,8 @@ source _common.sh source /usr/share/yunohost/helpers -upgrade_type=$(ynh_check_app_version_changed) - +#================================================= +# STANDARD UPGRADE STEPS #================================================= # STOP SYSTEMD SERVICE #================================================= @@ -19,21 +19,24 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_systemd_action --service_name="$app" --action="stop" --log_path="systemd" #================================================= -# "REBUILD" THE APP (DEPLOY NEW SOURCES, RERUN NPM BUILD...) +# ENSURE DOWNWARD COMPATIBILITY +#================================================= +ynh_script_progression --message="Ensuring downward compatibility..." + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= +ynh_script_progression --message="Upgrading source files..." -if [ "$upgrade_type" == "UPGRADE_APP" ]; then - ynh_script_progression --message="Upgrading source files..." --weight=1 +# Download, check integrity, uncompress and patch the source from app.src +ynh_setup_source --dest_dir="$install_dir" --full_replace=1 --keep=".config .minio" - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" -fi - -chown -R "$app:www-data" "$install_dir" chmod +x "$install_dir/cells" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R "$app:www-data" "$install_dir" + #================================================= # REAPPLY SYSTEM CONFIGURATIONS #================================================= @@ -41,8 +44,8 @@ ynh_script_progression --message="Upgrading system configurations related to $ap ynh_add_nginx_config +# Create a dedicated systemd config ynh_add_systemd_config - yunohost service add "$app" --description="File sharing platform" --log="/var/log/$app/$app.log" #================================================= @@ -50,7 +53,7 @@ yunohost service add "$app" --description="File sharing platform" --log="/var/lo #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="Restart done" #================================================= # END OF SCRIPT diff --git a/tests.toml b/tests.toml index 3081978..b2d03a7 100644 --- a/tests.toml +++ b/tests.toml @@ -4,5 +4,6 @@ test_format = 1.0 [default] - # test_upgrade_from.00a1a6e7.name = "Upgrade from 5.4" - # test_upgrade_from.00a1a6e7.args.foo = "bar" + exclude = ["change_url"] + + test_upgrade_from.5725c85c09f1d3b76d12a4dc4d367ec911cd0019.name = "Last packaging v2 version"