diff --git a/manifest.toml b/manifest.toml index d6eb608..f78ab3b 100644 --- a/manifest.toml +++ b/manifest.toml @@ -15,7 +15,7 @@ website = "https://monicahq.com" code = "https://github.com/monicahq/monica" [integration] -yunohost = ">= 11.1.19" +yunohost = ">= 11.2" architectures = "all" multi_instance = true ldap = false @@ -39,7 +39,7 @@ ram.runtime = "50M" [install.language] ask.en = "Choose the application language" ask.fr = "Choisissez la langue de l'application" - type = "string" + type = "select" choices = ["cs", "de", "en", "es", "fr", "he", "it", "nl", "pt", "ru", "zh"] default = "en" @@ -66,7 +66,7 @@ ram.runtime = "50M" main.url = "/" [resources.apt] - 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" + 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" diff --git a/scripts/install b/scripts/install index a1f6e33..ce15a03 100755 --- a/scripts/install +++ b/scripts/install @@ -55,11 +55,6 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=1 ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Configuring NGINX web server..." - # Create a dedicated NGINX config ynh_add_nginx_config @@ -81,9 +76,7 @@ chown -R $app:www-data "$install_dir" #================================================= ynh_script_progression --message="Adding a configuration file..." --weight=1 -config="$install_dir/.env" - -ynh_add_config --template=../conf/.env --destination=$install_dir/.env +ynh_add_config --template=".env" --destination="$install_dir/.env" chmod 600 $install_dir/.env chown $app:$app $install_dir/.env @@ -124,7 +117,7 @@ update-alternatives --set php /usr/bin/php${YNH_DEFAULT_PHP_VERSION} #================================================= ynh_script_progression --message="Setuping a cron..." --weight=1 -ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" +ynh_add_config --template="cron" --destination="/etc/cron.d/$app" chown root: "/etc/cron.d/$app" chmod 644 "/etc/cron.d/$app" diff --git a/scripts/remove b/scripts/remove index 1c16c0b..bb1b76f 100755 --- a/scripts/remove +++ b/scripts/remove @@ -17,29 +17,12 @@ ynh_script_progression --message="Removing NGINX web server configuration..." -- # Remove the dedicated NGINX config ynh_remove_nginx_config -#================================================= -# REMOVE PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=1 - # Remove the dedicated PHP-FPM config ynh_remove_fpm_config -#================================================= -# REMOVE DEPENDENCIES -#================================================= -ynh_script_progression --message="Removing dependencies..." --weight=1 - # Remove metapackage and its dependencies ynh_remove_nodejs -#================================================= -# SPECIFIC REMOVE -#================================================= -# REMOVE VARIOUS FILES -#================================================= -ynh_script_progression --message="Removing various files..." --weight=1 - # Remove a cron file ynh_secure_remove --file="/etc/cron.d/$app" diff --git a/scripts/restore b/scripts/restore index 39643a4..102d959 100755 --- a/scripts/restore +++ b/scripts/restore @@ -20,6 +20,13 @@ ynh_restore_file --origin_path="$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" +#================================================= +# RESTORE THE MYSQL DATABASE +#================================================= +ynh_script_progression --message="Restoring the MySQL database..." --weight=1 + +ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql + #================================================= # SPECIFIC RESTORATION #================================================= @@ -37,28 +44,8 @@ ynh_script_progression --message="Restoring the PHP-FPM configuration..." ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" -# Recreate a dedicated php-fpm config -ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$phpversion - -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the NGINX web server configuration..." - ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# RESTORE THE MYSQL DATABASE -#================================================= -ynh_script_progression --message="Restoring the MySQL database..." --weight=1 - -ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql - -#================================================= -# RESTORE VARIOUS FILES -#================================================= -ynh_script_progression --message="Restoring various files..." --weight=1 - ynh_restore_file --origin_path="/etc/cron.d/$app" #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index e8547b1..0b38640 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -76,11 +76,6 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1 # Create a dedicated PHP-FPM config ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." - # Create a dedicated NGINX config ynh_add_nginx_config @@ -105,7 +100,7 @@ ynh_script_progression --message="Updating a configuration file..." --weight=1 ynh_backup_if_checksum_is_different --file="$install_dir/.env" -ynh_add_config --template=../conf/.env --destination=$install_dir/.env +ynh_add_config --template=".env" --destination="$install_dir/.env" #================================================= # DEPLOYMENT @@ -156,7 +151,7 @@ ynh_store_file_checksum --file="$install_dir/.env" chmod 400 "$install_dir/.env" chown $app:$app "$install_dir/.env" -update-alternatives --set php /usr/bin/php${YNH_DEFAULT_PHP_VERSION} +update-alternatives --set php /usr/bin/php${YNH_PHP_VERSION} #================================================= # END OF SCRIPT