1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/lufi_ynh.git synced 2024-09-03 19:36:28 +02:00

Keep config

This commit is contained in:
ericgaspar 2021-05-09 11:00:08 +02:00
parent 9a1a7dfbe0
commit ee218168cf
No known key found for this signature in database
GPG key ID: 574F281483054D44
2 changed files with 2 additions and 35 deletions

View file

@ -14,7 +14,7 @@
"email": "win10@tutanota.com, cyp@rouquin.me"
},
"requirements": {
"yunohost": ">= 4.1.7"
"yunohost": ">= 4.2.4"
},
"multi_instance": true,
"services": [

View file

@ -112,7 +112,7 @@ then
ynh_script_progression --message="Upgrading source files..."
# 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" --keep="$final_path/lufi.conf"
fi
#=================================================
@ -130,39 +130,6 @@ ynh_script_progression --message="Upgrading dependencies..."
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
#=================================================
# SETUP LUFI
#=================================================
ynh_script_progression --message="Configuring Lufi..."
config=${final_path}/lufi.conf
ynh_backup_if_checksum_is_different --file="$config"
cp ../conf/lufi.conf.template "$config"
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$config"
ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file="$config"
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$config"
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$config"
ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$config"
ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="$config"
ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$config"
ynh_replace_string --match_string="__SECRET__" --replace_string="$secret" --target_file="$config"
ynh_replace_string --match_string="__MAX_FILE_SIZE__" --replace_string="$max_file_size" --target_file="$config"
if [ $max_file_size -eq 0 ]; then # Comment the limitation line if no limit
ynh_replace_string --match_string="max_file_size" --replace_string="#max_file_size" --target_file="$config"
fi
if [ $is_public -eq 0 ];
then
ynh_replace_string --match_string="__IS_PUBLIC__" --replace_string="" --target_file="$config"
else
ynh_replace_string --match_string="__IS_PUBLIC__" --replace_string="#" --target_file="$config"
fi
ynh_store_file_checksum --file="$config"
chmod 600 $final_path/lufi.conf
chown $app:$app $final_path/lufi.conf
#=================================================
# BUILD LUFI
#=================================================