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:
parent
156a08929e
commit
aaf722cd84
6 changed files with 17 additions and 46 deletions
|
@ -10,7 +10,7 @@ $config['db'] = 'mysql';
|
|||
$config['mysql.host'] = "localhost";
|
||||
$config['mysql.db'] = "__DB_NAME__";
|
||||
$config['mysql.user'] = "__DB_NAME__";
|
||||
$config['mysql.password'] = "__DB_PASSWORD__";
|
||||
$config['mysql.password'] = "__DB_PWD__";
|
||||
|
||||
# Tables prefix
|
||||
$config['prefix'] = "mtt_";
|
||||
|
|
|
@ -8,13 +8,13 @@
|
|||
},
|
||||
"url": "http://www.mytinytodo.net/",
|
||||
"license": "GPL-2.0",
|
||||
"version": "1.6.3~ynh1",
|
||||
"version": "1.6.3~ynh2",
|
||||
"maintainer": {
|
||||
"name": "plabuse",
|
||||
"email": "pierre.levasseur@free.fr"
|
||||
},
|
||||
"requirements": {
|
||||
"yunohost": ">= 3.8.1"
|
||||
"yunohost": ">= 4.1.7"
|
||||
},
|
||||
"multi_instance": false,
|
||||
"services": [
|
||||
|
@ -27,29 +27,17 @@
|
|||
{
|
||||
"name": "domain",
|
||||
"type": "domain",
|
||||
"ask": {
|
||||
"en": "Choose a domain name for myTinyTodo",
|
||||
"fr": "Choisissez un nom de domaine pour myTinyTodo"
|
||||
},
|
||||
"example": "domaine.org"
|
||||
},
|
||||
{
|
||||
"name": "path",
|
||||
"type": "path",
|
||||
"ask": {
|
||||
"en": "Choose a path for myTinyTodo",
|
||||
"fr": "Choisissez un chemin pour myTinyTodo"
|
||||
},
|
||||
"example": "/mytinytodo",
|
||||
"default": "/mytinytodo"
|
||||
},
|
||||
{
|
||||
"name": "is_public",
|
||||
"type": "boolean",
|
||||
"ask": {
|
||||
"en": "Is it a public application?",
|
||||
"fr": "Est-ce une application publique ?"
|
||||
},
|
||||
"help": {
|
||||
"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 n’ayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin."
|
||||
|
|
|
@ -29,11 +29,6 @@ ynh_script_progression --message="Loading installation settings..." --weight=1
|
|||
# Needed for helper "ynh_add_nginx_config"
|
||||
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
|
||||
#=================================================
|
||||
|
|
|
@ -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=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
|
||||
|
||||
#=================================================
|
||||
|
@ -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
|
||||
# # 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="__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="__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_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/db/todolist.db"
|
||||
|
@ -127,12 +128,12 @@ chown -R $app: $final_path
|
|||
#=================================================
|
||||
# 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
|
||||
if [ $is_public -eq 1 ]
|
||||
then
|
||||
ynh_permission_update --permission "main" --add "visitors"
|
||||
ynh_permission_update --permission="main" --add="visitors"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -25,7 +25,6 @@ app=$YNH_APP_INSTANCE_NAME
|
|||
|
||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||
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)
|
||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||
db_user=$db_name
|
||||
|
|
|
@ -18,7 +18,6 @@ app=$YNH_APP_INSTANCE_NAME
|
|||
|
||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||
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)
|
||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||
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
|
||||
|
||||
#
|
||||
# N.B. : the followings setting migrations snippets are provided as *EXAMPLES*
|
||||
# of what you may want to do in some cases (e.g. a setting was not defined on
|
||||
# some legacy installs and you therefore want to initiaze stuff during upgrade)
|
||||
#
|
||||
# Cleaning legacy permissions
|
||||
if ynh_legacy_permissions_exists; then
|
||||
ynh_legacy_permissions_delete_all
|
||||
|
||||
# If db_name doesn't exist, create it
|
||||
#if [ -z "$db_name" ]; then
|
||||
# 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
|
||||
ynh_app_setting_delete --app=$app --key=is_public
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||
|
|
Loading…
Reference in a new issue