diff --git a/manifest.toml b/manifest.toml index 6f78dff..ce58804 100644 --- a/manifest.toml +++ b/manifest.toml @@ -1,3 +1,5 @@ +#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/manifest.v2.schema.json + packaging_format = 2 id = "scratch" @@ -5,7 +7,7 @@ name = "Scratch" description.en = "Programming language to create your own interactive stories, games, and animations" description.fr = "Langage de programmation pour créer vos propres histoires, jeux et animations interactifs" -version = "4.0.1~ynh1" +version = "4.0.4~ynh1" maintainers = [] @@ -42,10 +44,10 @@ ram.runtime = "50M" default = "visitors" [resources] - [resources.sources.main] - url = "https://github.com/scratchfoundation/scratch-gui/releases/download/v4.0.1/scratch-gui-4.0.1.tgz" - sha256 = "ad9a25110bc981d5aacb0bbb7816b822ec752ba9abc8a45c90a229c99c7a5913" - autoupdate.strategy = "latest_github_release" + [resources.sources.main] + url = "https://github.com/scratchfoundation/scratch-gui/archive/refs/tags/v4.0.4.tar.gz" + sha256 = "04910a021c104ac2cedf71b224ea13253ea582a829d20fc7fab75eae0e7cbb2e" + autoupdate.strategy = "latest_github_tag" [resources.system_user] @@ -55,4 +57,3 @@ ram.runtime = "50M" main.url = "/" [resources.ports] - diff --git a/scripts/_common.sh b/scripts/_common.sh index 1a6a327..8bf600d 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,7 +5,7 @@ #================================================= # NodeJS version -nodejs_version=14 +nodejs_version=18 #================================================= # PERSONAL HELPERS diff --git a/scripts/backup b/scripts/backup index f31d78a..e73d3fc 100644 --- a/scripts/backup +++ b/scripts/backup @@ -1,7 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= diff --git a/scripts/change_url b/scripts/change_url index 4ba8cf7..cfcb0d6 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -1,7 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC STARTING #================================================= # IMPORT GENERIC HELPERS #================================================= diff --git a/scripts/install b/scripts/install index d5fa6b9..f6076fa 100644 --- a/scripts/install +++ b/scripts/install @@ -25,7 +25,19 @@ ynh_script_progression --message="Setting up source files..." --weight=5 ynh_setup_source --dest_dir="$install_dir" chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" +chown -R "$app:www-data" "$install_dir" + +#================================================= +# Build +#================================================= +ynh_script_progression --message="Installing $app..." --weight=40 + +pushd "$install_dir" + ynh_use_nodejs + ynh_exec_warn_less ynh_exec_as "$app" env "$ynh_node_load_PATH" "$ynh_npm" install + ynh_exec_warn_less ynh_exec_as "$app" env "$ynh_node_load_PATH" BUILD_MODE=dist "$ynh_npm" run build + ynh_exec_warn_less ynh_exec_as "$app" env "$ynh_node_load_PATH" BUILD_MODE=dist "$ynh_npm" link +popd #================================================= # SYSTEM CONFIGURATION @@ -37,24 +49,8 @@ ynh_add_nginx_config # Create a dedicated systemd config ynh_add_systemd_config - yunohost service add "$app" --description="Language to create your own interactive stories" --log="/var/log/$app/$app.log" -#================================================= -# INSTALL ETHERPAD -#================================================= -ynh_script_progression --message="Installing $app..." --weight=40 - -pushd "$install_dir" - ynh_use_nodejs - npm install - BUILD_MODE=dist npm run build - npm link - #ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm install - #ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH BUILD_MODE=dist $ynh_npm run build - #ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH BUILD_MODE=dist $ynh_npm link -popd - #================================================= # START SYSTEMD SERVICE #================================================= diff --git a/scripts/remove b/scripts/remove index d5f8f6c..4298270 100644 --- a/scripts/remove +++ b/scripts/remove @@ -16,7 +16,6 @@ ynh_script_progression --message="Removing system configurations related to $app # 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" fi diff --git a/scripts/restore b/scripts/restore index d40859c..3ccca72 100644 --- a/scripts/restore +++ b/scripts/restore @@ -1,7 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -18,7 +16,7 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$install_dir" chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" +chown -R "$app:www-data" "$install_dir" #================================================= # RESTORE THE NGINX CONFIGURATION @@ -31,7 +29,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="Language to create your own interactive stories" --log="/var/log/$app/$app.log" #================================================= @@ -39,7 +36,6 @@ yunohost service add "$app" --description="Language to create your own interacti #================================================= ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 -### Typically you only have either $app or php-fpm but not both at the same time... ynh_systemd_action --service_name="$app" --action="start" --log_path="/var/log/$app/$app.log" ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index 2ffa286..ae07409 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,7 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -25,18 +23,29 @@ ynh_script_progression --message="Upgrading source files..." --weight=5 ynh_setup_source --dest_dir="$install_dir" chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" +chown -R "$app:www-data" "$install_dir" #================================================= -# UPDATE A CONFIG FILE +# Build #================================================= -ynh_script_progression --message="Updating $app's configuration files..." --weight=1 +ynh_script_progression --message="Installing $app..." --weight=40 + +pushd "$install_dir" + ynh_use_nodejs + ynh_exec_warn_less ynh_exec_as "$app" env "$ynh_node_load_PATH" "$ynh_npm" install + ynh_exec_warn_less ynh_exec_as "$app" env "$ynh_node_load_PATH" BUILD_MODE=dist "$ynh_npm" run build + ynh_exec_warn_less ynh_exec_as "$app" env "$ynh_node_load_PATH" BUILD_MODE=dist "$ynh_npm" link +popd + +#================================================= +# REAPPLY SYSTEM CONFIGURATIONS +#================================================= +ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config ynh_add_systemd_config - yunohost service add "$app" --description="Language to create your own interactive stories" --log="/var/log/$app/$app.log" #=================================================