diff --git a/check_process b/check_process index 75b6eb6..80786f9 100644 --- a/check_process +++ b/check_process @@ -1,9 +1,9 @@ ;; Test complet ; Manifest - domain="domain.tld" (DOMAIN) - path="/path" (PATH) - admin="john" (USER) - is_public=1 (PUBLIC|public=1|private=0) + domain="domain.tld" + path="/path" + admin="john" + is_public=1 ; Checks pkg_linter=1 setup_sub_dir=1 diff --git a/conf/nginx.conf b/conf/nginx.conf index 2b769fb..366d225 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -2,7 +2,7 @@ location __PATH__/ { # Path to source - alias __FINALPATH__/editor/ ; + alias __FINALPATH__/editor/; index svg-editor.html ; diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md new file mode 100644 index 0000000..e9e21e7 --- /dev/null +++ b/doc/DESCRIPTION.md @@ -0,0 +1 @@ +SVG-edit is a fast, web-based, JavaScript-driven SVG drawing editor that works in any modern browser. \ No newline at end of file diff --git a/doc/screenshots/screenshot.png b/doc/screenshots/screenshot.png new file mode 100644 index 0000000..fbfe3f4 Binary files /dev/null and b/doc/screenshots/screenshot.png differ diff --git a/manifest.json b/manifest.json index 7c871f9..e2ec12e 100644 --- a/manifest.json +++ b/manifest.json @@ -3,11 +3,18 @@ "id": "svgedit", "packaging_format": 1, "description": { - "en": "Web-based SVG drawing editor working on any modern browser.", - "fr": "Édition de SVG en ligne fonctionnent avec tout navigateur moderne." + "en": "Web-based SVG drawing editor working on any modern browser", + "fr": "Édition de SVG en ligne fonctionnent avec tout navigateur moderne" }, - "url": "https://github.com/SVG-Edit/svgedit", "version": "5.1.0~ynh1", + "url": "https://github.com/SVG-Edit/svgedit", + "upstream": { + "license": "free", + "website": "https://example.com", + "demo": "https://svg-edit.github.io/svgedit/dist/editor/index.html", + "admindoc": "https://github.com/SVG-Edit/svgedit/tree/master/docs", + "code": "https://github.com/SVG-Edit/svgedit" + }, "license": "MIT", "maintainer": { "name": "ljf", @@ -18,7 +25,7 @@ "name": "Luc Didry" }, "requirements": { - "yunohost": ">> 4.1.7" + "yunohost": ">> 4.2.4" }, "multi_instance": true, "services": [ diff --git a/scripts/install b/scripts/install index 3b37710..5eeffc8 100755 --- a/scripts/install +++ b/scripts/install @@ -13,9 +13,6 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { - true -} # Exit if an error occurs during the execution of the script ynh_abort_if_errors @@ -54,6 +51,14 @@ ynh_script_progression --message="Installing dependencies..." --weight=3 ynh_install_app_dependencies $pkg_dependencies +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Configuring system user..." --weight=3 + +# Create a system user +ynh_system_user_create --username=$app --home_dir="$final_path" + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -63,13 +68,9 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Configuring system user..." --weight=3 - -# Create a system user -ynh_system_user_create --username=$app +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" #================================================= # NGINX CONFIGURATION @@ -86,12 +87,6 @@ ynh_add_nginx_config ynh_configure svgedit-config-iife.js "$final_path/svgedit-config-iife.js" ynh_configure svgedit-custom.css "$final_path/svgedit-custom.css" -#================================================= -# SECURE FILES AND DIRECTORIES -#================================================= - -chown -R $app: $final_path - #================================================= # SETUP SSOWAT #================================================= diff --git a/scripts/restore b/scripts/restore index 4139dba..d9325ed 100755 --- a/scripts/restore +++ b/scripts/restore @@ -35,14 +35,13 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= ynh_script_progression --message="Validating restoration parameters..." --weight=1 -ynh_webpath_available --domain=$domain --path_url=$path_url \ - || ynh_die --message="Path not available: ${domain}${path_url}" test ! -d $final_path \ || ynh_die --message="There is already a directory: $final_path " #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= +ynh_script_progression --message="Restoring the NGINX configuration..." --weight=1 ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" @@ -53,6 +52,14 @@ ynh_script_progression --message="Installing dependencies..." --weight=2 ynh_install_app_dependencies $pkg_dependencies +#================================================= +# RECREATE THE DEDICATED USER +#================================================= +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" + #================================================= # RESTORE THE APP MAIN DIR #================================================= @@ -60,20 +67,9 @@ ynh_script_progression --message="Restoring SVG-edit main directory..." --weight ynh_restore_file --origin_path="$final_path" -#================================================= -# RECREATE THE DEDICATED USER -#================================================= -ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 - -# Create the dedicated user (if not existing) -ynh_system_user_create --username=$app - -#================================================= -# RESTORE USER RIGHTS -#================================================= - -# Restore permissions on app files -chown -R $app: $final_path +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index 6b58d76..77f7146 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -58,6 +58,14 @@ ynh_clean_setup () { # Exit if an error occurs during the execution of the script ynh_abort_if_errors +#================================================= +# CREATE DEDICATED USER +#================================================= +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" + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -71,6 +79,10 @@ then ynh_setup_source --dest_dir="$final_path" fi +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" + #================================================= # UPGRADE DEPENDENCIES #================================================= @@ -78,14 +90,6 @@ ynh_script_progression --message="Upgrading dependencies..." --weight=6 ynh_install_app_dependencies $pkg_dependencies -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Configuring system user..." --weight=3 - -# Create a system user -ynh_system_user_create --username=$app - #================================================= # CUSTOM INSTRUCTION #================================================= @@ -93,13 +97,6 @@ ynh_system_user_create --username=$app ynh_configure svgedit-config-iife.js "$final_path/svgedit-config-iife.js" ynh_configure svgedit-custom.css "$final_path/svgedit-custom.css" -#================================================= -# SECURE FILES AND DIRECTORIES -#================================================= - -# Set permissions on app files -chown -R $app: $final_path - #================================================= # RELOAD NGINX #=================================================