1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/tiddlywiki_ynh.git synced 2024-09-03 20:26:34 +02:00

Merge pull request #2 from YunoHost-Apps/testing

Testing
This commit is contained in:
Éric Gaspar 2021-03-27 18:43:02 +01:00 committed by GitHub
commit d349a04bb8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 40 additions and 18 deletions

View file

@ -14,7 +14,7 @@
"email": "" "email": ""
}, },
"requirements": { "requirements": {
"yunohost": ">= 4.0.0" "yunohost": ">= 4.1.7"
}, },
"multi_instance": true, "multi_instance": true,
"services": [ "services": [
@ -25,34 +25,32 @@
{ {
"name": "domain", "name": "domain",
"type": "domain", "type": "domain",
"ask": {
"en": "Choose a domain for TiddlyWiki",
"fr": "Choisissez un nom de domaine pour TiddlyWiki"
},
"example": "domain.org" "example": "domain.org"
}, },
{ {
"name": "path", "name": "path",
"type": "path", "type": "path",
"ask": {
"en": "Choose a path for TiddlyWiki",
"fr": "Choisissez un chemin pour TiddlyWiki"
},
"example": "/tiddlywiki", "example": "/tiddlywiki",
"default": "/tiddlywiki" "default": "/tiddlywiki"
}, },
{ {
"name": "is_public", "name": "is_public",
"type": "boolean", "type": "boolean",
"ask": {
"en": "Is it a public application?",
"fr": "Est-ce une application publique ?"
},
"help": { "help": {
"en": "If enabled, TiddlyWiki will be accessible by people who doesnt have an account. This can be changed later via the webadmin.", "en": "If enabled, TiddlyWiki will be accessible by people who doesnt have an account. This can be changed later via the webadmin.",
"fr": "Si cette case est cochée, TiddlyWiki sera accessible aux personnes nayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin." "fr": "Si cette case est cochée, TiddlyWiki sera accessible aux personnes nayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin."
}, },
"default": true "default": true
},
{
"name": "language",
"type": "string",
"ask": {
"en": "Choose the application language",
"fr": "Choisissez la langue de l'application"
},
"choices": ["fr", "en"],
"default": "fr"
} }
] ]
} }

View file

@ -8,8 +8,6 @@
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
ynh_abort_if_errors
#================================================= #=================================================
# RETRIEVE ARGUMENTS # RETRIEVE ARGUMENTS
#================================================= #=================================================

View file

@ -22,6 +22,7 @@ ynh_abort_if_errors
domain=$YNH_APP_ARG_DOMAIN domain=$YNH_APP_ARG_DOMAIN
path_url=$YNH_APP_ARG_PATH path_url=$YNH_APP_ARG_PATH
is_public=$YNH_APP_ARG_IS_PUBLIC is_public=$YNH_APP_ARG_IS_PUBLIC
language=$YNH_APP_ARG_LANGUAGE
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
@ -42,8 +43,9 @@ ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
#================================================= #=================================================
ynh_script_progression --message="Storing installation settings..." --weight=2 ynh_script_progression --message="Storing installation settings..." --weight=2
ynh_app_setting_set --app=$app --key=domain --value=$domain 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=path --value=$path_url
ynh_app_setting_set --app=$app --key=language --value=$language
#================================================= #=================================================
# STANDARD MODIFICATIONS # STANDARD MODIFICATIONS
@ -58,7 +60,12 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path
#ynh_setup_source --dest_dir="$final_path" #ynh_setup_source --dest_dir="$final_path"
mkdir -p $final_path mkdir -p $final_path
cp -a ../sources/empty.html $final_path/empty.html
if [ "$language" = "fr" ]; then
cp -a ../sources/empty_fr.html $final_path/empty.html
else
cp -a ../sources/empty.html $final_path/empty.html
fi
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION

View file

@ -18,6 +18,7 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain) domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path) path_url=$(ynh_app_setting_get --app=$app --key=path)
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
language=$(ynh_app_setting_get --app=$app --key=language)
#================================================= #=================================================
# CHECK VERSION # CHECK VERSION
@ -36,6 +37,19 @@ if [ -z "$final_path" ]; then
ynh_app_setting_set --app=$app --key=final_path --value=$final_path ynh_app_setting_set --app=$app --key=final_path --value=$final_path
fi fi
# Save the language used if not present
if [ -z "$language" ]; then
language="en"
ynh_app_setting_set --app=$app --key=language --value=$language
fi
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all
ynh_app_setting_delete --app=$app --key=is_public
fi
#================================================= #=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#================================================= #=================================================
@ -61,7 +75,12 @@ then
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
#ynh_setup_source --dest_dir="$final_path" #ynh_setup_source --dest_dir="$final_path"
mkdir -p $final_path mkdir -p $final_path
if [ "$language" = "fr" ]; then
cp -a ../sources/empty_fr.html $final_path/empty.html
else
cp -a ../sources/empty.html $final_path/empty.html cp -a ../sources/empty.html $final_path/empty.html
fi
fi fi
#================================================= #=================================================