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

Upgrade to 3.0.1

This commit is contained in:
yalh76 2021-05-23 11:40:31 +02:00
parent a78a1a42e7
commit 405a0e8c4a
8 changed files with 40 additions and 22 deletions

View file

@ -10,7 +10,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
## Overview
Monica is an open-source web application to organize the interactions with your loved ones. I call it a PRM, or Personal Relationship Management. Think of it as a [CRM](https://en.wikipedia.org/wiki/Customer_relationship_management) (a popular tool used by sales teams in the corporate world) for your friends or family.
**Shipped version:** 2.19.1
**Shipped version:** 3.0.1
## Screenshots

View file

@ -138,8 +138,8 @@ MFA_ENABLED=__TWOF_BOOLEAN__
DAV_ENABLED=__DAV_BOOLEAN__
# CLIENT ID and SECRET used for OAuth authentication
PASSPORT_PERSONAL_ACCESS_CLIENT_ID=__IDENTITY__
PASSPORT_PERSONAL_ACCESS_CLIENT_SECRET==__KEY__
PASSPORT_PERSONAL_ACCESS_CLIENT_ID=_IDENTITY_
PASSPORT_PERSONAL_ACCESS_CLIENT_SECRET==_KEY_
# Allow to access general statistics about your instance through a public API
# call

View file

@ -1,6 +1,6 @@
SOURCE_URL=https://github.com/monicahq/monica/archive/v2.19.1.zip
SOURCE_SUM=f7ea6258fbc852453ca0dcb30685987d5e83a413dd0218ed99bdc5819ef597f7
SOURCE_URL=https://github.com/monicahq/monica/archive/v3.0.1.zip
SOURCE_SUM=92e182b4b9fdeb11ff03390b22a5bb1931fdd643fca99ca697642b5f1e009736
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=zip
SOURCE_IN_SUBDIR=true
SOURCE_FILENAME=v2.19.1.zip
SOURCE_FILENAME=v3.0.1.zip

View file

@ -5,7 +5,7 @@
"description": {
"en": " Personal Relationship Manager - a new kind of CRM to organize interactions with your friends and family."
},
"version": "2.19.1~ynh1",
"version": "3.0.1~ynh1",
"url": "https://monicahq.com",
"license": "GPL-3.0",
"maintainer": {

View file

@ -8,8 +8,10 @@
pkg_dependencies="redis-server"
YNH_COMPOSER_VERSION="2.0.11"
YNH_PHP_VERSION="7.4"
NODEJS_VERSION=14
extra_php_dependencies="php${YNH_PHP_VERSION}-imagick php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-opcache php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-bcmath php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-gmp php${YNH_PHP_VERSION}-redis"
extra_php_dependencies="php${YNH_PHP_VERSION}-bcmath php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-gmp php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-redis php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-zip \
php${YNH_PHP_VERSION}-imagick php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-opcache"
#=================================================
# PERSONAL HELPERS

View file

@ -71,6 +71,9 @@ ynh_script_progression --message="Installing dependencies..."
ynh_install_app_dependencies $pkg_dependencies
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"
#=================================================
# CREATE DEDICATED USER
#=================================================
@ -124,13 +127,6 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#=================================================
# SPECIFIC SETUP
#=================================================
# INSTALL COMPOSER DEPENDENCIES
#=================================================
ynh_script_progression --message="Installing Composer dependencies..."
ynh_exec_warn_less ynh_install_composer --phpversion="$phpversion" --workdir="$final_path"
#=================================================
# ADD A CONFIGURATION
#=================================================
@ -168,20 +164,31 @@ fi
ynh_add_config --template="../conf/.env" --destination="$config"
#=================================================
# INSTALL COMPOSER DEPENDENCIES
#=================================================
ynh_script_progression --message="Installing Composer dependencies..."
ynh_exec_warn_less ynh_install_composer --phpversion="$phpversion" --workdir="$final_path"
#=================================================
# DEPLOY
#=================================================
ynh_script_progression --message="Deploying..."
pushd "$final_path"
ynh_use_nodejs
yarn install
yarn run production
php$phpversion artisan setup:production --email=$email --password=$password -n --force
php$phpversion artisan passport:client --password -n > key.txt
mobile_id=$( cd $final_path && tail -2 key.txt | head -1 | cut -c 12- )
mobile_key=$( cd $final_path && tail -1 key.txt | cut -c 16- )
private_key=$(sed -E ':a;N;$!ba;s/\r{0,1}\n/\\n/g' storage/oauth-private.key)
public_key=$(sed -E ':a;N;$!ba;s/\r{0,1}\n/\\n/g' storage/oauth-public.key)
ynh_replace_string --match_string="__IDENTITY__" --replace_string="$mobile_id" --target_file="$config"
ynh_replace_string --match_string="__KEY__" --replace_string="$mobile_key" --target_file="$config"
ynh_replace_string --match_string="_IDENTITY_" --replace_string="$mobile_id" --target_file="$config"
ynh_replace_string --match_string="_KEY_" --replace_string="$mobile_key" --target_file="$config"
ynh_app_setting_set --app=$app --key=mobile_id --value=$mobile_id
ynh_app_setting_set --app=$app --key=mobile_key --value=$mobile_key
ynh_app_setting_set --app=$app --key=private_key --value=$private_key

View file

@ -92,6 +92,9 @@ 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_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg"
#=================================================
# RESTORE THE MYSQL DATABASE
#=================================================

View file

@ -133,6 +133,9 @@ ynh_script_progression --message="Upgrading dependencies..."
ynh_install_app_dependencies $pkg_dependencies
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"
#=================================================
# PHP-FPM CONFIGURATION
#=================================================
@ -193,7 +196,10 @@ ynh_add_config --template="../conf/.env" --destination="$config"
#=================================================
ynh_script_progression --message="Deploying..."
pushd "$final_path"
pushd "$final_path"
ynh_use_nodejs
yarn install
yarn run production
php$phpversion artisan monica:update --force
popd
@ -206,8 +212,8 @@ if [ -f $final_path/storage/oauth-private.key ]; then
ynh_app_setting_set --app=$app --key=private_key --value=$private_key
ynh_app_setting_set --app=$app --key=private_key --value=$public_key
fi
ynh_replace_string --match_string="__IDENTITY__" --replace_string="$mobile_id" --target_file="$config"
ynh_replace_string --match_string="__KEY__" --replace_string="$mobile_key" --target_file="$config"
ynh_replace_string --match_string="_IDENTITY_" --replace_string="$mobile_id" --target_file="$config"
ynh_replace_string --match_string="_KEY_" --replace_string="$mobile_key" --target_file="$config"
else
pushd "$final_path"
php$phpversion artisan passport:keys
@ -217,8 +223,8 @@ else
mobile_key=$( cd $final_path && tail -1 key.txt | cut -c 16- )
private_key=$(sed -E ':a;N;$!ba;s/\r{0,1}\n/\\n/g' storage/oauth-private.key)
public_key=$(sed -E ':a;N;$!ba;s/\r{0,1}\n/\\n/g' storage/oauth-public.key)
ynh_replace_string --match_string="__IDENTITY__" --replace_string="$mobile_id" --target_file="$config"
ynh_replace_string --match_string="__KEY__" --replace_string="$mobile_key" --target_file="$config"
ynh_replace_string --match_string="_IDENTITY_" --replace_string="$mobile_id" --target_file="$config"
ynh_replace_string --match_string="_KEY_" --replace_string="$mobile_key" --target_file="$config"
ynh_app_setting_set --app=$app --key=mobile_id --value=$mobile_id
ynh_app_setting_set --app=$app --key=mobile_key --value=$mobile_key
ynh_app_setting_set --app=$app --key=private_key --value=$private_key