1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mytinytodo_ynh.git synced 2024-09-03 19:46:01 +02:00

Cleaning up (#10)

This commit is contained in:
Éric Gaspar 2021-03-16 17:46:33 +01:00 committed by GitHub
parent 156a08929e
commit aaf722cd84
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 17 additions and 46 deletions

View file

@ -10,7 +10,7 @@ $config['db'] = 'mysql';
$config['mysql.host'] = "localhost"; $config['mysql.host'] = "localhost";
$config['mysql.db'] = "__DB_NAME__"; $config['mysql.db'] = "__DB_NAME__";
$config['mysql.user'] = "__DB_NAME__"; $config['mysql.user'] = "__DB_NAME__";
$config['mysql.password'] = "__DB_PASSWORD__"; $config['mysql.password'] = "__DB_PWD__";
# Tables prefix # Tables prefix
$config['prefix'] = "mtt_"; $config['prefix'] = "mtt_";

View file

@ -8,13 +8,13 @@
}, },
"url": "http://www.mytinytodo.net/", "url": "http://www.mytinytodo.net/",
"license": "GPL-2.0", "license": "GPL-2.0",
"version": "1.6.3~ynh1", "version": "1.6.3~ynh2",
"maintainer": { "maintainer": {
"name": "plabuse", "name": "plabuse",
"email": "pierre.levasseur@free.fr" "email": "pierre.levasseur@free.fr"
}, },
"requirements": { "requirements": {
"yunohost": ">= 3.8.1" "yunohost": ">= 4.1.7"
}, },
"multi_instance": false, "multi_instance": false,
"services": [ "services": [
@ -27,29 +27,17 @@
{ {
"name": "domain", "name": "domain",
"type": "domain", "type": "domain",
"ask": {
"en": "Choose a domain name for myTinyTodo",
"fr": "Choisissez un nom de domaine pour myTinyTodo"
},
"example": "domaine.org" "example": "domaine.org"
}, },
{ {
"name": "path", "name": "path",
"type": "path", "type": "path",
"ask": {
"en": "Choose a path for myTinyTodo",
"fr": "Choisissez un chemin pour myTinyTodo"
},
"example": "/mytinytodo", "example": "/mytinytodo",
"default": "/mytinytodo" "default": "/mytinytodo"
}, },
{ {
"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, myTinyTodo will be accessible by people who do not have an account. This can be changed later via the webadmin.", "en": "If enabled, myTinyTodo will be accessible by people who do not have an account. This can be changed later via the webadmin.",
"fr": "Si cette case est cochée, myTinyTodo sera accessible aux personnes nayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin." "fr": "Si cette case est cochée, myTinyTodo sera accessible aux personnes nayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin."

View file

@ -29,11 +29,6 @@ ynh_script_progression --message="Loading installation settings..." --weight=1
# Needed for helper "ynh_add_nginx_config" # Needed for helper "ynh_add_nginx_config"
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
# Add settings here as needed by your application
#db_name=$(ynh_app_setting_get --app=$app --key=db_name)
#db_user=$db_name
#db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd)
#================================================= #=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#================================================= #=================================================

View file

@ -45,7 +45,6 @@ ynh_script_progression --message="Storing installation settings..." --weight=1
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=is_public --value=$is_public
ynh_app_setting_set --app=$app --key=language --value=$language ynh_app_setting_set --app=$app --key=language --value=$language
#================================================= #=================================================
@ -104,11 +103,13 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
# # la nom de la base et l'utilisateur de la base on la même valeur # # la nom de la base et l'utilisateur de la base on la même valeur
# # mise en place de la config de la base au niveau de myTinyTodo # # mise en place de la config de la base au niveau de myTinyTodo
cp ../conf/config.php $final_path/db/config.php # cp ../conf/config.php $final_path/db/config.php
ynh_replace_string --match_string="__LANGUAGE__" --replace_string="$language" --target_file="$final_path/db/config.php" # ynh_replace_string --match_string="__LANGUAGE__" --replace_string="$language" --target_file="$final_path/db/config.php"
ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/db/config.php" # ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/db/config.php"
ynh_replace_string --match_string="__DB_PASSWORD__" --replace_string="$db_pwd" --target_file="$final_path/db/config.php" # ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/db/config.php"
ynh_add_config --template="../conf/config.php" --destination="$final_path/db/config.php"
ynh_secure_remove --file="$final_path/setup.php" ynh_secure_remove --file="$final_path/setup.php"
ynh_secure_remove --file="$final_path/db/todolist.db" ynh_secure_remove --file="$final_path/db/todolist.db"
@ -127,12 +128,12 @@ chown -R $app: $final_path
#================================================= #=================================================
# SETUP SSOWAT # SETUP SSOWAT
#================================================= #=================================================
ynh_script_progression --message="Configuring SSOwat..." --weight=1 ynh_script_progression --message="Configuring permissions..." --weight=1
# Make app public if necessary or protect it # Make app public if necessary or protect it
if [ $is_public -eq 1 ] if [ $is_public -eq 1 ]
then then
ynh_permission_update --permission "main" --add "visitors" ynh_permission_update --permission="main" --add="visitors"
fi fi
#================================================= #=================================================

View file

@ -25,7 +25,6 @@ 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)
is_public=$(ynh_app_setting_get --app=$app --key=is_public)
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_user=$db_name db_user=$db_name

View file

@ -18,7 +18,6 @@ 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)
is_public=$(ynh_app_setting_get --app=$app --key=is_public)
language=$(ynh_app_setting_get --app=$app --key=language) language=$(ynh_app_setting_get --app=$app --key=language)
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_name=$(ynh_app_setting_get --app=$app --key=db_name)
@ -36,23 +35,12 @@ upgrade_type=$(ynh_check_app_version_changed)
#================================================= #=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
# # Cleaning legacy permissions
# N.B. : the followings setting migrations snippets are provided as *EXAMPLES* if ynh_legacy_permissions_exists; then
# of what you may want to do in some cases (e.g. a setting was not defined on ynh_legacy_permissions_delete_all
# some legacy installs and you therefore want to initiaze stuff during upgrade)
#
# If db_name doesn't exist, create it ynh_app_setting_delete --app=$app --key=is_public
#if [ -z "$db_name" ]; then fi
# db_name=$(ynh_sanitize_dbid --db_name=$app)
# ynh_app_setting_set --app=$app --key=db_name --value=$db_name
#fi
# If final_path doesn't exist, create it
#if [ -z "$final_path" ]; then
# final_path=/var/www/$app
# ynh_app_setting_set --app=$app --key=final_path --value=$final_path
#fi
#================================================= #=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP