diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8f144f3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*~ +*.sw[op] +.DS_Store diff --git a/README.md b/README.md index c2ccce3..3dbfedc 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ All your e-mail, from all your accounts, in one place. Cypht is not your father' Cypht is an application built entirely of plugins, or as we call them, module sets (which is obviously way cooler sounding than plugins), that are executed by the framework. Modules provide a flexible way to add new features or customize the program without hacking the code. -**Shipped version:** 2.2.0~ynh1 +**Shipped version:** 2.3.0~ynh1 ## Screenshots diff --git a/README_es.md b/README_es.md index 5afe4d5..47fa84b 100644 --- a/README_es.md +++ b/README_es.md @@ -21,7 +21,7 @@ All your e-mail, from all your accounts, in one place. Cypht is not your father' Cypht is an application built entirely of plugins, or as we call them, module sets (which is obviously way cooler sounding than plugins), that are executed by the framework. Modules provide a flexible way to add new features or customize the program without hacking the code. -**Versión actual:** 2.2.0~ynh1 +**Versión actual:** 2.3.0~ynh1 ## Capturas diff --git a/README_eu.md b/README_eu.md index 685036e..94e8f3f 100644 --- a/README_eu.md +++ b/README_eu.md @@ -21,7 +21,7 @@ All your e-mail, from all your accounts, in one place. Cypht is not your father' Cypht is an application built entirely of plugins, or as we call them, module sets (which is obviously way cooler sounding than plugins), that are executed by the framework. Modules provide a flexible way to add new features or customize the program without hacking the code. -**Paketatutako bertsioa:** 2.2.0~ynh1 +**Paketatutako bertsioa:** 2.3.0~ynh1 ## Pantaila-argazkiak diff --git a/README_fr.md b/README_fr.md index b170057..2b931a7 100644 --- a/README_fr.md +++ b/README_fr.md @@ -18,7 +18,7 @@ Il NE doit PAS être modifié à la main. Cypht est un client de messagerie web. Vous pouvez accéder à vos comptes de messagerie qui supportent IMAP, POP3 ou SMTP - comme la plupart. -**Version incluse :** 2.2.0~ynh1 +**Version incluse :** 2.3.0~ynh1 ## Captures d’écran diff --git a/README_gl.md b/README_gl.md index 78e64af..f8f7456 100644 --- a/README_gl.md +++ b/README_gl.md @@ -21,7 +21,7 @@ All your e-mail, from all your accounts, in one place. Cypht is not your father' Cypht is an application built entirely of plugins, or as we call them, module sets (which is obviously way cooler sounding than plugins), that are executed by the framework. Modules provide a flexible way to add new features or customize the program without hacking the code. -**Versión proporcionada:** 2.2.0~ynh1 +**Versión proporcionada:** 2.3.0~ynh1 ## Capturas de pantalla diff --git a/README_id.md b/README_id.md index 9dc30db..edb0b36 100644 --- a/README_id.md +++ b/README_id.md @@ -21,7 +21,7 @@ All your e-mail, from all your accounts, in one place. Cypht is not your father' Cypht is an application built entirely of plugins, or as we call them, module sets (which is obviously way cooler sounding than plugins), that are executed by the framework. Modules provide a flexible way to add new features or customize the program without hacking the code. -**Versi terkirim:** 2.2.0~ynh1 +**Versi terkirim:** 2.3.0~ynh1 ## Tangkapan Layar diff --git a/README_ru.md b/README_ru.md index 7375ee1..dee2961 100644 --- a/README_ru.md +++ b/README_ru.md @@ -21,7 +21,7 @@ All your e-mail, from all your accounts, in one place. Cypht is not your father' Cypht is an application built entirely of plugins, or as we call them, module sets (which is obviously way cooler sounding than plugins), that are executed by the framework. Modules provide a flexible way to add new features or customize the program without hacking the code. -**Поставляемая версия:** 2.2.0~ynh1 +**Поставляемая версия:** 2.3.0~ynh1 ## Снимки экрана diff --git a/README_zh_Hans.md b/README_zh_Hans.md index 788c146..156560c 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -21,7 +21,7 @@ All your e-mail, from all your accounts, in one place. Cypht is not your father' Cypht is an application built entirely of plugins, or as we call them, module sets (which is obviously way cooler sounding than plugins), that are executed by the framework. Modules provide a flexible way to add new features or customize the program without hacking the code. -**分发版本:** 2.2.0~ynh1 +**分发版本:** 2.3.0~ynh1 ## 截图 diff --git a/conf/extra_php-fpm.conf b/conf/extra_php-fpm.conf deleted file mode 100644 index 14c8d27..0000000 --- a/conf/extra_php-fpm.conf +++ /dev/null @@ -1,4 +0,0 @@ -; Additional php.ini defines, specific to this pool of workers. - -php_admin_value[upload_max_filesize] = 50M -php_admin_value[post_max_size] = 50M \ No newline at end of file diff --git a/conf/nginx.conf b/conf/nginx.conf index 2dad80d..3bd06b4 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -12,7 +12,7 @@ location __PATH__/ { try_files $uri $uri/ index.php; location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; - fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; + fastcgi_pass unix:/var/run/php/php__PHP_VERSION__-fpm-__APP__.sock; fastcgi_index index.php; include fastcgi_params; diff --git a/manifest.toml b/manifest.toml index d204ab4..67a9901 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Cypht" description.en = "Lightweight Open Source webmail" description.fr = "Webmail Open Source léger" -version = "2.2.0~ynh1" +version = "2.3.0~ynh1" maintainers = [] @@ -16,7 +16,8 @@ admindoc = "https://cypht.org/install.html" code = "https://github.com/cypht-org/cypht" [integration] -yunohost = ">= 11.2" +yunohost = ">= 11.2.20" +helpers_version = "2.1" architectures = "all" multi_instance = true ldap = true @@ -53,8 +54,8 @@ ram.runtime = "50M" [resources] [resources.sources.main] - url= "https://github.com/cypht-org/cypht/archive/refs/tags/v2.2.0.tar.gz" - sha256 = "7476aeeb55377e67d19aca40f5bc7758646396fcfca252c4631f81b36c717a8f" + url= "https://github.com/cypht-org/cypht/archive/refs/tags/v2.3.0.tar.gz" + sha256 = "7adae938a3fd5b7b2cfa473baf7855ea9fc8203ca780b14bf3f91eb7887b19e0" autoupdate.strategy = "latest_github_tag" [resources.system_user] diff --git a/scripts/_common.sh b/scripts/_common.sh index f3ada9d..6413387 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -1,22 +1,10 @@ #!/bin/bash #================================================= -# COMMON VARIABLES +# COMMON VARIABLES AND CUSTOM HELPERS #================================================= # PHP APP SPECIFIC #================================================= # Composer version -YNH_COMPOSER_VERSION="2.7.6" - -#================================================= -# PERSONAL HELPERS -#================================================= - -#================================================= -# EXPERIMENTAL HELPERS -#================================================= - -#================================================= -# FUTURE OFFICIAL HELPERS -#================================================= +composer_version="2.7.6" diff --git a/scripts/backup b/scripts/backup index c1767e6..ff26a6b 100755 --- a/scripts/backup +++ b/scripts/backup @@ -1,51 +1,42 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - # Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# DECLARE DATA AND CONF FILES TO BACKUP -#================================================= -ynh_print_info --message="Declaring files to be backed up..." +ynh_print_info "Declaring files to be backed up..." #================================================= # BACKUP THE APP MAIN DIR #================================================= -ynh_backup --src_path="$install_dir" +ynh_backup "$install_dir" #================================================= # BACKUP THE DATA DIR #================================================= -ynh_backup --src_path="$data_dir" --is_big +ynh_backup "$data_dir" #================================================= # SYSTEM CONFIGURATION #================================================= -ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" +ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" -ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" +ynh_backup "/etc/php/$php_version/fpm/pool.d/$app.conf" #================================================= # SPECIFIC BACKUP #================================================= # BACKUP THE MYSQL DATABASE #================================================= -ynh_print_info --message="Backing up the MySQL database..." +ynh_print_info "Backing up the MySQL database..." -ynh_mysql_dump_db --database="$db_name" > db.sql +ynh_mysql_dump_db > db.sql #================================================= # END OF SCRIPT #================================================= -ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." +ynh_print_info "Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." diff --git a/scripts/change_url b/scripts/change_url index a4fcb69..39d37fc 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -1,25 +1,17 @@ #!/bin/bash -#================================================= -# GENERIC STARTING -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers -#================================================= -# STANDARD MODIFICATIONS #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 +ynh_script_progression "Updating NGINX web server configuration..." -ynh_change_url_nginx_config +ynh_config_change_url_nginx #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Change of URL completed for $app" --last +ynh_script_progression "Change of URL completed for $app" diff --git a/scripts/install b/scripts/install index d205fc0..252c3fb 100755 --- a/scripts/install +++ b/scripts/install @@ -1,11 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers @@ -15,14 +9,16 @@ timezone=$(cat /etc/timezone) # CREATE A MYSQL DATABASE #================================================= -ynh_mysql_execute_as_root --sql="CREATE TABLE hm_user_session (hm_id varchar(180), data longblob, date timestamp, primary key (hm_id));" --database=$db_name -ynh_mysql_execute_as_root --sql="CREATE TABLE hm_user (username varchar(250), hash varchar(250), primary key (username));" --database=$db_name -ynh_mysql_execute_as_root --sql="CREATE TABLE hm_user_settings(username varchar(250), settings longblob, primary key (username));" --database=$db_name +ynh_mysql_db_shell <<< "CREATE TABLE hm_user_session (hm_id varchar(180), data longblob, date timestamp, primary key (hm_id));" + +ynh_mysql_db_shell <<< "CREATE TABLE hm_user (username varchar(250), hash varchar(250), primary key (username));" + +ynh_mysql_db_shell <<< "CREATE TABLE hm_user_settings(username varchar(250), settings longblob, primary key (username));" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Setting up source files..." --weight=3 +ynh_script_progression "Setting up source files..." # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" @@ -33,29 +29,30 @@ chown -R $app:www-data "$install_dir" #================================================= # SYSTEM CONFIGURATION #================================================= -ynh_script_progression --message="Adding system configurations related to $app..." --weight=3 +ynh_script_progression "Adding system configurations related to $app..." # Create a dedicated PHP-FPM config -ynh_add_fpm_config +ynh_config_add_phpfpm # Create a dedicated NGINX config -ynh_add_nginx_config +ynh_config_add_nginx #================================================= # SPECIFIC SETUP #================================================= # INSTALL CYPHT WITH COMPOSER #================================================= -ynh_script_progression --message="Installing $app with Composer..." --weight=10 +ynh_script_progression "Installing $app with Composer..." -ynh_install_composer --install_args="--ignore-platform-reqs" +ynh_composer_install +ynh_composer_exec install --no-dev --ignore-platform-reqs #================================================= # ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Adding a configuration file..." --weight=1 +ynh_script_progression "Adding $app's configuration..." -ynh_add_config --template=".env" --destination="$install_dir/.env" +ynh_config_add --template=".env" --destination="$install_dir/.env" chmod 400 "$install_dir/.env" chown $app:$app "$install_dir/.env" @@ -63,16 +60,16 @@ chown $app:$app "$install_dir/.env" #================================================= # ADD AN ADMIN USER #================================================= -ynh_script_progression --message="Adding an admin..." --weight=3 +ynh_script_progression "Adding an admin..." #Generate the run-time configuration -php$phpversion $install_dir/scripts/config_gen.php +php$php_version $install_dir/scripts/config_gen.php # create an admin account -php$phpversion $install_dir/scripts/create_account.php $admin $password +php$php_version $install_dir/scripts/create_account.php $admin $password #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of $app completed" --last +ynh_script_progression "Installation of $app completed" diff --git a/scripts/remove b/scripts/remove index 5b17c2d..ee9c6ec 100755 --- a/scripts/remove +++ b/scripts/remove @@ -1,27 +1,19 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers #================================================= # REMOVE SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 +ynh_script_progression "Removing system configurations related to $app..." -# Remove the dedicated NGINX config -ynh_remove_nginx_config +ynh_config_remove_nginx -# Remove the dedicated PHP-FPM config -ynh_remove_fpm_config +ynh_config_remove_phpfpm #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Removal of $app completed" --last +ynh_script_progression "Removal of $app completed" diff --git a/scripts/restore b/scripts/restore index 300f8e9..56aefdc 100755 --- a/scripts/restore +++ b/scripts/restore @@ -1,11 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - # Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers @@ -13,9 +7,9 @@ source /usr/share/yunohost/helpers #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring the app main directory..." --weight=3 +ynh_script_progression "Restoring the app main directory..." -ynh_restore_file --origin_path="$install_dir" +ynh_restore "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" @@ -23,41 +17,39 @@ chown -R $app:www-data "$install_dir" #================================================= # RESTORE THE DATA DIRECTORY #================================================= -ynh_script_progression --message="Restoring the data directory..." --weight=1 +ynh_script_progression "Restoring the data directory..." -ynh_restore_file --origin_path="$data_dir" --not_mandatory +ynh_restore "$data_dir" chown -R $app:www-data "$data_dir" #================================================= # RESTORE THE MYSQL DATABASE #================================================= -ynh_script_progression --message="Restoring the MySQL database..." --weight=1 +ynh_script_progression "Restoring the MySQL database..." -ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" < ./db.sql +ynh_mysql_db_shell < ./db.sql #================================================= # RESTORE SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 +ynh_script_progression "Restoring system configurations related to $app..." -ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" +ynh_restore "/etc/php/$php_version/fpm/pool.d/$app.conf" -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" +ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# GENERIC FINALIZATION #================================================= # RELOAD NGINX AND PHP-FPM #================================================= -ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --weight=1 +ynh_script_progression "Reloading NGINX web server and PHP-FPM..." -ynh_systemd_action --service_name=php$phpversion-fpm --action=reload +ynh_systemctl --service=php$php_version-fpm --action=reload -ynh_systemd_action --service_name=nginx --action=reload +ynh_systemctl --service=nginx --action=reload #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Restoration completed for $app" --last +ynh_script_progression "Restoration completed for $app" diff --git a/scripts/upgrade b/scripts/upgrade index b04ebba..1da1b45 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,11 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers @@ -18,10 +12,9 @@ timezone=$(cat /etc/timezone) #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Upgrading source files..." --weight=4 +ynh_script_progression "Upgrading source files..." -# Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$install_dir" #--full_replace=1 #--keep=".env" +ynh_setup_source --dest_dir="$install_dir" #--full_replace --keep=".env" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" @@ -29,29 +22,26 @@ chown -R $app:www-data "$install_dir" #================================================= # REAPPLY SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=3 +ynh_script_progression "Upgrading system configurations related to $app..." -# Create a dedicated PHP-FPM config -ynh_add_fpm_config +ynh_config_add_phpfpm -# Create a dedicated NGINX config -ynh_add_nginx_config +ynh_config_add_nginx #================================================= # INSTALL CYPHT WITH COMPOSER #================================================= -ynh_script_progression --message="Installing $app with Composer..." --weight=10 +ynh_script_progression "Installing $app with Composer..." -ynh_install_composer --install_args="--ignore-platform-reqs" +ynh_composer_install +ynh_composer_exec install --no-dev --ignore-platform-reqs -#================================================= -# SPECIFIC UPGRADE #================================================= # UPDATE A CONFIG FILE #================================================= -ynh_script_progression --message="Adding a configuration file..." --weight=1 +ynh_script_progression "Adding $app's configuration..." -ynh_add_config --template=".env" --destination="$install_dir/.env" +ynh_config_add --template=".env" --destination="$install_dir/.env" chmod 400 "$install_dir/.env" chown $app:$app "$install_dir/.env" @@ -60,4 +50,4 @@ chown $app:$app "$install_dir/.env" # END OF SCRIPT #================================================= -ynh_script_progression --message="Upgrade of $app completed" --last +ynh_script_progression "Upgrade of $app completed"