mirror of
https://github.com/YunoHost-Apps/jirafeau_ynh.git
synced 2024-09-03 19:35:53 +02:00
Do not output upload password in logs (fix #60)
This commit is contained in:
parent
2f46c5d166
commit
8e7cc8531a
2 changed files with 8 additions and 0 deletions
|
@ -23,7 +23,9 @@ 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
|
||||||
admin_user=$YNH_APP_ARG_ADMIN_USER
|
admin_user=$YNH_APP_ARG_ADMIN_USER
|
||||||
|
ynh_print_OFF
|
||||||
upload_password=$YNH_APP_ARG_UPLOAD_PASSWORD
|
upload_password=$YNH_APP_ARG_UPLOAD_PASSWORD
|
||||||
|
ynh_print_ON
|
||||||
is_public=$YNH_APP_ARG_IS_PUBLIC
|
is_public=$YNH_APP_ARG_IS_PUBLIC
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
@ -94,6 +96,7 @@ jirafeauconfigfile="$final_path/lib/config.local.php"
|
||||||
cp "../conf/config.local.php" "$jirafeauconfigfile"
|
cp "../conf/config.local.php" "$jirafeauconfigfile"
|
||||||
|
|
||||||
# Set and save upload password, allowing an empty one
|
# Set and save upload password, allowing an empty one
|
||||||
|
ynh_print_OFF
|
||||||
if [ -z "$upload_password" ]
|
if [ -z "$upload_password" ]
|
||||||
then
|
then
|
||||||
ynh_replace_string --match_string="__YNH_UPLOAD_PASSWORD__" --replace_string="" --target_file="$jirafeauconfigfile"
|
ynh_replace_string --match_string="__YNH_UPLOAD_PASSWORD__" --replace_string="" --target_file="$jirafeauconfigfile"
|
||||||
|
@ -102,6 +105,7 @@ else
|
||||||
ynh_replace_string --match_string="__YNH_UPLOAD_PASSWORD__" --replace_string="'$upload_password'" --target_file="$jirafeauconfigfile"
|
ynh_replace_string --match_string="__YNH_UPLOAD_PASSWORD__" --replace_string="'$upload_password'" --target_file="$jirafeauconfigfile"
|
||||||
ynh_app_setting_set --app=$app --key=upload_password --value="$upload_password"
|
ynh_app_setting_set --app=$app --key=upload_password --value="$upload_password"
|
||||||
fi
|
fi
|
||||||
|
ynh_print_ON
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CONFIGURE JIRAFEAU
|
# CONFIGURE JIRAFEAU
|
||||||
|
|
|
@ -21,7 +21,9 @@ path_url=$(ynh_app_setting_get --app=$app --key=path)
|
||||||
admin_user=$(ynh_app_setting_get --app=$app --key=admin_user)
|
admin_user=$(ynh_app_setting_get --app=$app --key=admin_user)
|
||||||
is_public=$(ynh_app_setting_get --app=$app --key=is_public)
|
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)
|
||||||
|
ynh_print_OFF
|
||||||
upload_password=$(ynh_app_setting_get --app=$app --key=upload_password)
|
upload_password=$(ynh_app_setting_get --app=$app --key=upload_password)
|
||||||
|
ynh_print_ON
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK VERSION
|
# CHECK VERSION
|
||||||
|
@ -121,6 +123,7 @@ ynh_backup_if_checksum_is_different --file="$final_path/lib/config.local.php"
|
||||||
cp "../conf/config.local.php" "$final_path/lib/config.local.php"
|
cp "../conf/config.local.php" "$final_path/lib/config.local.php"
|
||||||
|
|
||||||
# Set and save upload password, allowing an empty one
|
# Set and save upload password, allowing an empty one
|
||||||
|
ynh_print_OFF
|
||||||
if [ -z "$upload_password" ]
|
if [ -z "$upload_password" ]
|
||||||
then
|
then
|
||||||
ynh_replace_string --match_string="__YNH_UPLOAD_PASSWORD__" --replace_string="" --target_file="$jirafeauconfigfile"
|
ynh_replace_string --match_string="__YNH_UPLOAD_PASSWORD__" --replace_string="" --target_file="$jirafeauconfigfile"
|
||||||
|
@ -129,6 +132,7 @@ else
|
||||||
ynh_replace_string --match_string="__YNH_UPLOAD_PASSWORD__" --replace_string="'$upload_password'" --target_file="$jirafeauconfigfile"
|
ynh_replace_string --match_string="__YNH_UPLOAD_PASSWORD__" --replace_string="'$upload_password'" --target_file="$jirafeauconfigfile"
|
||||||
ynh_app_setting_set --app=$app --key=upload_password --value="$upload_password"
|
ynh_app_setting_set --app=$app --key=upload_password --value="$upload_password"
|
||||||
fi
|
fi
|
||||||
|
ynh_print_ON
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CONFIGURE JIRAFEAU
|
# CONFIGURE JIRAFEAU
|
||||||
|
|
Loading…
Reference in a new issue