1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/svgedit_ynh.git synced 2024-09-03 20:26:24 +02:00
This commit is contained in:
ericgaspar 2021-09-04 09:18:52 +02:00
parent f934ccebd4
commit 003961015c
No known key found for this signature in database
GPG key ID: 574F281483054D44
8 changed files with 52 additions and 56 deletions

View file

@ -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

View file

@ -2,7 +2,7 @@
location __PATH__/ {
# Path to source
alias __FINALPATH__/editor/ ;
alias __FINALPATH__/editor/;
index svg-editor.html ;

1
doc/DESCRIPTION.md Normal file
View file

@ -0,0 +1 @@
SVG-edit is a fast, web-based, JavaScript-driven SVG drawing editor that works in any modern browser.

Binary file not shown.

After

Width:  |  Height:  |  Size: 508 KiB

View file

@ -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": [

View file

@ -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
#=================================================

View file

@ -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

View file

@ -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
#=================================================