|
|
@ -29,7 +29,7 @@ user=$(ynh_app_setting_get $app user) |
|
|
|
|
|
|
|
|
([[ -n "$with_mysql" ]] && [[ -n "$password" ]] && [[ -n "$user" ]]) \ |
|
|
([[ -n "$with_mysql" ]] && [[ -n "$password" ]] && [[ -n "$user" ]]) \ |
|
|
|| ynh_die "The app changed and can not be automatically upgraded. \ |
|
|
|| ynh_die "The app changed and can not be automatically upgraded. \ |
|
|
You will have to manually upgrade it following those instructions: \ |
|
|
|
|
|
|
|
|
You will have to manually upgrade it following these instructions: \ |
|
|
https://github.com/YunoHost-Apps/my_webapp_ynh#upgrade" |
|
|
https://github.com/YunoHost-Apps/my_webapp_ynh#upgrade" |
|
|
|
|
|
|
|
|
#================================================= |
|
|
#================================================= |
|
|
@ -76,15 +76,15 @@ is_checksum_different () { |
|
|
local checksum_value=$(ynh_app_setting_get $app $checksum_setting_name) |
|
|
local checksum_value=$(ynh_app_setting_get $app $checksum_setting_name) |
|
|
if [ -n "$checksum_value" ] |
|
|
if [ -n "$checksum_value" ] |
|
|
then # Proceed only if a value was stored into the app settings |
|
|
then # Proceed only if a value was stored into the app settings |
|
|
if ! echo "$checksum_value $file" | sudo md5sum -c --status |
|
|
|
|
|
then # If the checksum is now different |
|
|
|
|
|
echo "File $file has been manually modified since the installation or last upgrade. So it will be not replace." >&2 |
|
|
|
|
|
echo "1" |
|
|
|
|
|
else |
|
|
|
|
|
echo "0" |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
if ! echo "$checksum_value $file" | sudo md5sum -c --status |
|
|
|
|
|
then # If the checksum is now different |
|
|
|
|
|
echo "File $file has been manually modified since the installation or last upgrade. So it will not be replaced." >&2 |
|
|
|
|
|
echo "1" |
|
|
|
|
|
else |
|
|
|
|
|
echo "0" |
|
|
|
|
|
fi |
|
|
else |
|
|
else |
|
|
echo "0" |
|
|
|
|
|
|
|
|
echo "0" |
|
|
fi |
|
|
fi |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -102,7 +102,7 @@ fi |
|
|
# CREATE DEDICATED USER |
|
|
# CREATE DEDICATED USER |
|
|
#================================================= |
|
|
#================================================= |
|
|
|
|
|
|
|
|
# Create a standart user (not a system user for sftp) |
|
|
|
|
|
|
|
|
# Create a standard user (not a system user for sftp) |
|
|
ynh_system_user_exists "$user" || \ |
|
|
ynh_system_user_exists "$user" || \ |
|
|
useradd -d "$final_path" -M --user-group "$user" |
|
|
useradd -d "$final_path" -M --user-group "$user" |
|
|
# Add the password to this user |
|
|
# Add the password to this user |
|
|
@ -146,7 +146,7 @@ systemctl reload ssh |
|
|
# SECURE FILES AND DIRECTORIES |
|
|
# SECURE FILES AND DIRECTORIES |
|
|
#================================================= |
|
|
#================================================= |
|
|
|
|
|
|
|
|
# Home directory of the user need to be owned by root to allow |
|
|
|
|
|
|
|
|
# Home directory of the user needs to be owned by root to allow |
|
|
# SFTP connections |
|
|
# SFTP connections |
|
|
chown root: "$final_path" |
|
|
chown root: "$final_path" |
|
|
|
|
|
|
|
|
|