diff --git a/README.md b/README.md index 37522e8..7234005 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/conf/.env b/conf/.env index 179fc22..d8d54d2 100644 --- a/conf/.env +++ b/conf/.env @@ -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 diff --git a/conf/app.src b/conf/app.src index fc26531..22ade3d 100644 --- a/conf/app.src +++ b/conf/app.src @@ -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 diff --git a/manifest.json b/manifest.json index 42ea66f..5bfd32b 100644 --- a/manifest.json +++ b/manifest.json @@ -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": { diff --git a/scripts/_common.sh b/scripts/_common.sh index 87839e5..840a8ba 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -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 diff --git a/scripts/install b/scripts/install index 64cbb4d..0e554b5 100755 --- a/scripts/install +++ b/scripts/install @@ -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 diff --git a/scripts/restore b/scripts/restore index 37530e7..215ec0f 100755 --- a/scripts/restore +++ b/scripts/restore @@ -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 #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index ada3a2e..8ff79c2 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -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