mirror of
https://github.com/YunoHost-Apps/monica_ynh.git
synced 2024-09-03 19:46:23 +02:00
Fix upgrade and add backward compatibility
This commit is contained in:
parent
8bf2ba8835
commit
c58d88313c
2 changed files with 27 additions and 3 deletions
|
@ -236,9 +236,9 @@ then
|
||||||
ynh_permission_update --permission="main" --add="visitors"
|
ynh_permission_update --permission="main" --add="visitors"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Giver API permission to visitors
|
# Give API permission to visitors
|
||||||
ynh_permission_create --permission="api" --url="/api" --allowed="visitors" --show_tile="false" --protected="true"
|
ynh_permission_create --permission="api" --url="/api" --allowed="visitors" --show_tile="false" --protected="true"
|
||||||
# Giver DAV permission to visitors
|
# Give DAV permission to visitors
|
||||||
ynh_permission_create --permission="dav" --url="/dav" --allowed="visitors" --show_tile="false" --protected="true"
|
ynh_permission_create --permission="dav" --url="/dav" --allowed="visitors" --show_tile="false" --protected="true"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -70,11 +70,34 @@ if [ -z "$final_path" ]; then
|
||||||
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# If dav_support doesn't exist, create it
|
||||||
|
if [ -z "$dav_support" ]; then
|
||||||
|
dav_support=0
|
||||||
|
ynh_app_setting_set --app=$app --key=dav_support --value=$dav_support
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If signup doesn't exist, create it
|
||||||
|
if [ -z "$signup" ]; then
|
||||||
|
signup=0
|
||||||
|
ynh_app_setting_set --app=$app --key=signup --value=$signup
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If signup doesn't exist, create it
|
||||||
|
if [ -z "$two_factor" ]; then
|
||||||
|
two_factor=0
|
||||||
|
ynh_app_setting_set --app=$app --key=two_factor --value=$two_factor
|
||||||
|
fi
|
||||||
|
|
||||||
# Create a permission if needed
|
# Create a permission if needed
|
||||||
if ! ynh_permission_exists --permission="api"; then
|
if ! ynh_permission_exists --permission="api"; then
|
||||||
ynh_permission_create --permission="api" --url="/api" --allowed="visitors" --show_tile="false" --protected="true"
|
ynh_permission_create --permission="api" --url="/api" --allowed="visitors" --show_tile="false" --protected="true"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Create a permission if needed
|
||||||
|
if ! ynh_permission_exists --permission="dav"; then
|
||||||
|
ynh_permission_create --permission="dav" --url="/dav" --allowed="visitors" --show_tile="false" --protected="true"
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE DEDICATED USER
|
# CREATE DEDICATED USER
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -157,6 +180,7 @@ ynh_exec_warn_less ynh_composer_exec --phpversion="$phpversion" --workdir="$fina
|
||||||
ynh_script_progression --message="Updating a configuration file..."
|
ynh_script_progression --message="Updating a configuration file..."
|
||||||
|
|
||||||
config="$final_path/.env"
|
config="$final_path/.env"
|
||||||
|
db_user=$db_name
|
||||||
|
|
||||||
# Enable or disable DAV support for users
|
# Enable or disable DAV support for users
|
||||||
if [ $dav_support -eq 0 ]
|
if [ $dav_support -eq 0 ]
|
||||||
|
@ -195,7 +219,7 @@ ynh_script_progression --message="Deploying..."
|
||||||
|
|
||||||
update-alternatives --set php /usr/bin/php$phpversion
|
update-alternatives --set php /usr/bin/php$phpversion
|
||||||
|
|
||||||
pushd "$final_path"
|
pushd "$final_path"
|
||||||
ynh_use_nodejs
|
ynh_use_nodejs
|
||||||
yarn install
|
yarn install
|
||||||
yarn run production
|
yarn run production
|
||||||
|
|
Loading…
Add table
Reference in a new issue