mirror of
https://github.com/YunoHost-Apps/mineweb_ynh.git
synced 2024-09-03 19:45:54 +02:00
parent
b8e6752821
commit
505678faca
5 changed files with 26 additions and 25 deletions
|
@ -1,8 +1,6 @@
|
|||
# See here for more informations
|
||||
# https://github.com/YunoHost/package_check#syntax-check_process-file
|
||||
|
||||
# Move this file from check_process.default to check_process when you have filled it.
|
||||
|
||||
;; Test complet
|
||||
; Manifest
|
||||
domain="domain.tld" (DOMAIN)
|
||||
|
|
|
@ -5,9 +5,9 @@ class DATABASE_CONFIG {
|
|||
'datasource' => 'Database/Mysql',
|
||||
'persistent' => false,
|
||||
'host' => 'localhost',
|
||||
'login' => '__DBUSER__',
|
||||
'password' => '__DBPWD__',
|
||||
'database' => '__DBNAME__',
|
||||
'login' => '__DB_USER__',
|
||||
'password' => '__DB_PWD__',
|
||||
'database' => '__DB_NAME__',
|
||||
'encoding' => 'utf8',
|
||||
];
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
"en": "Customizable and intuitive CMS.",
|
||||
"fr": "CMS personnalisable et intuitif."
|
||||
},
|
||||
"version": "1.13.0~ynh1",
|
||||
"version": "1.13.0~ynh2",
|
||||
"url": "https://mineweb.org/",
|
||||
"license": "AGPL-3.0-only",
|
||||
"maintainer": {
|
||||
|
@ -14,7 +14,7 @@
|
|||
"email": "liberodark@gmail.com"
|
||||
},
|
||||
"requirements": {
|
||||
"yunohost": ">= 4.0.0"
|
||||
"yunohost": ">= 4.1.7"
|
||||
},
|
||||
"multi_instance": true,
|
||||
"services": [
|
||||
|
|
|
@ -47,7 +47,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
|
||||
|
||||
#=================================================
|
||||
# STANDARD MODIFICATIONS
|
||||
|
@ -101,9 +100,11 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
|||
|
||||
cp -a ../conf/database.php $final_path/app/Config/database.php
|
||||
|
||||
ynh_replace_string --match_string="__DBUSER__" --replace_string="$db_name" --target_file="$final_path/app/Config/database.php"
|
||||
ynh_replace_string --match_string="__DBPWD__" --replace_string="$db_pwd" --target_file="$final_path/app/Config/database.php"
|
||||
ynh_replace_string --match_string="__DBNAME__" --replace_string="$db_name" --target_file="$final_path/app/Config/database.php"
|
||||
ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_name" --target_file="$final_path/app/Config/database.php"
|
||||
ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/app/Config/database.php"
|
||||
ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/app/Config/database.php"
|
||||
|
||||
ynh_store_file_checksum --file="$final_path/app/Config/database.php"
|
||||
|
||||
#=================================================
|
||||
# MODIFY FIRST.CTP
|
||||
|
@ -111,13 +112,6 @@ ynh_replace_string --match_string="__DBNAME__" --replace_string="$db_name" --tar
|
|||
|
||||
ynh_replace_string --match_string="app/webroot/" --replace_string="" --target_file="$final_path/app/View/Install/first.ctp"
|
||||
|
||||
#=================================================
|
||||
# STORE THE CONFIG FILE CHECKSUM
|
||||
#=================================================
|
||||
|
||||
# Calculate and store the config file checksum into the app settings
|
||||
ynh_store_file_checksum "$final_path/app/Config/database.php"
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
|
@ -132,14 +126,12 @@ chmod -R 775 $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
|
||||
# Everyone can access the app.
|
||||
# The "main" permission is automatically created before the install script.
|
||||
ynh_permission_update --permission "main" --add "visitors"
|
||||
ynh_permission_update --permission="main" --add="visitors"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -46,6 +46,13 @@ if [ -z "$db_name" ]; then
|
|||
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
||||
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
|
||||
#=================================================
|
||||
|
@ -102,11 +109,15 @@ ynh_add_fpm_config --package="$extra_php_dependencies"
|
|||
# MODIFY A CONFIG FILE
|
||||
#=================================================
|
||||
|
||||
ynh_backup_if_checksum_is_different --file="$final_path/app/Config/database.php"
|
||||
|
||||
cp -a ../conf/database.php $final_path/app/Config/database.php
|
||||
|
||||
ynh_replace_string --match_string="__DBUSER__" --replace_string="$db_name" --target_file="$final_path/app/Config/database.php"
|
||||
ynh_replace_string --match_string="__DBPWD__" --replace_string="$db_pwd" --target_file="$final_path/app/Config/database.php"
|
||||
ynh_replace_string --match_string="__DBNAME__" --replace_string="$db_name" --target_file="$final_path/app/Config/database.php"
|
||||
ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_name" --target_file="$final_path/app/Config/database.php"
|
||||
ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/app/Config/database.php"
|
||||
ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/app/Config/database.php"
|
||||
|
||||
ynh_store_file_checksum --file="$final_path/app/Config/database.php"
|
||||
|
||||
#=================================================
|
||||
# MODIFY FIRST.CTP
|
||||
|
|
Loading…
Add table
Reference in a new issue