1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/monica_ynh.git synced 2024-09-03 19:46:23 +02:00
This commit is contained in:
Thomas 2024-06-16 19:48:15 +02:00 committed by GitHub
parent fbd6ae42ea
commit de3a991ae7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 18 additions and 21 deletions

View file

@ -5,7 +5,7 @@ name = "Monica"
description.en = "Personal Relationship Manager"
description.fr = "Gestionnaire de relations personnelles"
version = "4.1.2~ynh1"
version = "4.0.0~ynh3"
maintainers = ["Sebastian Gumprich"]
@ -57,8 +57,8 @@ ram.runtime = "50M"
[resources.sources]
[resources.sources.main]
url = "https://github.com/monicahq/monica/archive/v4.1.2.zip"
sha256 = "792bb0af6bfb33abd3c4694eed309cf6c33001e589328c418bb1231e063d60d6"
url = "https://github.com/monicahq/monica/archive/v4.0.0.zip"
sha256 = "5b108525a2f5fedc0a2bb82a49d3de47d087b33082fb21e64f874d387304ed9f"
autoupdate.strategy = "latest_github_tag"
[resources.system_user]
@ -70,11 +70,11 @@ ram.runtime = "50M"
main.url = "/"
[resources.apt]
packages = "mariadb-server, php8.2-bcmath, php8.2-cli, php8.2-curl, php8.2-dom, php8.2-gd, php8.2-gmp, php8.2-iconv, php8.2-intl, php8.2-mbstring, php8.2-mysql, php8.2-mysqli, php8.2-opcache, php8.2-redis, php8.2-xml, php8.2-zip"
packages = "mariadb-server, php8.1-bcmath, php8.1-cli, php8.1-curl, php8.1-dom, php8.1-gd, php8.1-gmp, php8.1-iconv, php8.1-intl, php8.1-mbstring, php8.1-mysql, php8.1-mysqli, php8.1-opcache, php8.1-redis, php8.1-xml, php8.1-zip"
extras.yarn.repo = "deb https://dl.yarnpkg.com/debian/ stable main"
extras.yarn.key = "https://dl.yarnpkg.com/debian/pubkey.gpg"
extras.yarn.packages = "yarn"
[resources.database]
type = "mysql"
type = "mysql"

View file

@ -15,12 +15,18 @@ source /usr/share/yunohost/helpers
random_key=$(ynh_string_random --length=32)
email=$(ynh_user_get_info --username=$admin --key="mail")
fpm_footprint="low"
fpm_free_footprint=0
fpm_usage="low"
#=================================================
# STORE SETTINGS FROM MANIFEST
#=================================================
ynh_app_setting_set --app=$app --key=random_key --value=$random_key
ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint
ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint
ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage
#=================================================
# STANDARD MODIFICATIONS
@ -47,7 +53,7 @@ chown -R $app:www-data "$install_dir"
#=================================================
ynh_script_progression --message="Configuring PHP-FPM..." --weight=1
ynh_add_fpm_config
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint
# Create a dedicated NGINX config
ynh_add_nginx_config
@ -57,9 +63,9 @@ ynh_add_nginx_config
#=================================================
# INSTALL COMPOSER DEPENDENCIES
#=================================================
ynh_script_progression --message="Installing Composer dependencies..."
ynh_script_progression --message="Installing composer dependencies..."
ynh_exec_warn_less ynh_install_composer --phpversion="$phpversion" --composerversion="$YNH_COMPOSER_VERSION" --workdir="$install_dir"
ynh_exec_warn_less ynh_install_composer --phpversion="$phpversion" --workdir="$install_dir"
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir"
@ -85,14 +91,12 @@ ynh_replace_string --target_file="$install_dir/package.json" --match_string="php
#=================================================
# DEPLOY
#=================================================
ynh_script_progression --message="Deploying $app..."
ynh_script_progression --message="Deploying..."
pushd "$install_dir"
ynh_use_nodejs
yarn cache clean
ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH APP_ENV=local yarn add moment-locales-webpack-plugin
ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH NODE_ENV=production APP_ENV=local yarn install --production
ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH NODE_ENV=production APP_ENV=local yarn run production
ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH yarn install
ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH yarn run production
ynh_exec_warn_less ynh_exec_as $app php$phpversion artisan setup:production --force --email=$email --password=$password
ynh_exec_warn_less ynh_exec_as $app php$phpversion artisan passport:client --password -n > key.txt
mobile_id=$( cd $install_dir && tail -2 key.txt | head -1 | cut -c 12- )
@ -111,13 +115,6 @@ ynh_store_file_checksum --file="$install_dir/.env"
chmod 400 "$install_dir/.env"
chown $app:$app "$install_dir/.env"
#==================================================
# FIX PHP VERSION
#==================================================
ynh_script_progression --message="Fixing PHP version in package.json..." --weight=1
ynh_replace_string --target_file="$install_dir/package.json" --match_string="php artisan lang:generate -vvv" --replace_string="php$phpversion artisan lang:generate -vvv"
#=================================================
# INSTALL THE CRON FILE
#=================================================
@ -132,4 +129,4 @@ chmod 644 "/etc/cron.d/$app"
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Installation of $app completed" --last
ynh_script_progression --message="Installation of $app completed" --last