1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/monica_ynh.git synced 2024-09-03 19:46:23 +02:00

Merge branch 'testing' into Fix

This commit is contained in:
ericgaspar 2021-12-10 10:22:56 +01:00
commit dd9458f586
No known key found for this signature in database
GPG key ID: 574F281483054D44
3 changed files with 30 additions and 15 deletions

View file

@ -69,8 +69,6 @@ ynh_app_setting_set --app=$app --key=version --value=$version
#================================================= #=================================================
ynh_script_progression --message="Installing dependencies..." ynh_script_progression --message="Installing dependencies..."
ynh_install_app_dependencies $pkg_dependencies
ynh_install_nodejs --nodejs_version=$NODEJS_VERSION ynh_install_nodejs --nodejs_version=$NODEJS_VERSION
ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg"
@ -186,7 +184,7 @@ pushd "$final_path"
ynh_use_nodejs ynh_use_nodejs
yarn install yarn install
yarn run production yarn run production
php$phpversion artisan setup:production --email=$email --password=$password -n --force php$phpversion artisan setup:production --email=$email --password=$password -n --force
php$phpversion artisan passport:client --password -n > key.txt php$phpversion artisan passport:client --password -n > key.txt
mobile_id=$( cd $final_path && tail -2 key.txt | head -1 | cut -c 12- ) mobile_id=$( cd $final_path && tail -2 key.txt | head -1 | cut -c 12- )
@ -229,9 +227,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"
#================================================= #=================================================

View file

@ -83,9 +83,6 @@ ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
#================================================= #=================================================
ynh_script_progression --message="Reinstalling dependencies..." ynh_script_progression --message="Reinstalling dependencies..."
# Define and install dependencies
ynh_install_app_dependencies $pkg_dependencies
ynh_install_nodejs --nodejs_version=$NODEJS_VERSION ynh_install_nodejs --nodejs_version=$NODEJS_VERSION
ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg"

View file

@ -33,7 +33,6 @@ version=$(curl -s https://api.github.com/repos/monicahq/monica/releases/latest |
#================================================= #=================================================
# CHECK VERSION # CHECK VERSION
#================================================= #=================================================
ynh_script_progression --message="Checking version..."
upgrade_type=$(ynh_check_app_version_changed) upgrade_type=$(ynh_check_app_version_changed)
@ -75,6 +74,23 @@ if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all ynh_legacy_permissions_delete_all
ynh_app_setting_delete --app=$app --key=is_public ynh_app_setting_delete --app=$app --key=is_public
# 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 fi
# Create a permission if needed # Create a permission if needed
@ -82,6 +98,11 @@ 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
#================================================= #=================================================
@ -127,8 +148,6 @@ ynh_add_nginx_config
#================================================= #=================================================
ynh_script_progression --message="Upgrading dependencies..." ynh_script_progression --message="Upgrading dependencies..."
ynh_install_app_dependencies $pkg_dependencies
ynh_install_nodejs --nodejs_version=$NODEJS_VERSION ynh_install_nodejs --nodejs_version=$NODEJS_VERSION
ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg"
@ -157,6 +176,7 @@ ynh_install_composer --commands="update"
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,11 +215,11 @@ 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 ynh_exec_warn_less yarn install
yarn run production ynh_exec_warn_less yarn run production
php$phpversion artisan monica:update --force ynh_exec_warn_less php$phpversion artisan monica:update --force
popd popd
if [ -f $final_path/storage/oauth-private.key ]; then if [ -f $final_path/storage/oauth-private.key ]; then