1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mautic_ynh.git synced 2024-09-03 19:36:26 +02:00
This commit is contained in:
YunoHost Bot 2024-08-31 13:21:53 +02:00 committed by GitHub
commit decc6b1946
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 69 additions and 86 deletions

View file

@ -1,8 +1,8 @@
0,5,10,15,20,25,30,35,40,45,50,55 * * * * __APP__ /usr/bin/php__PHPVERSION__ __INSTALL_DIR__/console mautic:segments:update > /dev/null 2>&1 0,5,10,15,20,25,30,35,40,45,50,55 * * * * __APP__ /usr/bin/php__PHP_VERSION__ __INSTALL_DIR__/console mautic:segments:update > /dev/null 2>&1
3,8,12,17,22,27.32.37,42,47,52,57 * * * * __APP__ /usr/bin/php__PHPVERSION__ __INSTALL_DIR__/console mautic:campaigns:update > /dev/null 2>&1 3,8,12,17,22,27.32.37,42,47,52,57 * * * * __APP__ /usr/bin/php__PHP_VERSION__ __INSTALL_DIR__/console mautic:campaigns:update > /dev/null 2>&1
1,6,11,16,21,26,31,36,41,46,51,56 * * * * __APP__ /usr/bin/php__PHPVERSION__ __INSTALL_DIR__/console mautic:campaigns:trigger > /dev/null 2>&1 1,6,11,16,21,26,31,36,41,46,51,56 * * * * __APP__ /usr/bin/php__PHP_VERSION__ __INSTALL_DIR__/console mautic:campaigns:trigger > /dev/null 2>&1
*/10 * * * * __APP__ /usr/bin/php__PHPVERSION__ __INSTALL_DIR__/console mautic:broadcasts:send > /dev/null 2>&1 */10 * * * * __APP__ /usr/bin/php__PHP_VERSION__ __INSTALL_DIR__/console mautic:broadcasts:send > /dev/null 2>&1
0,15,30,45 * * * * __APP__ /usr/bin/php__PHPVERSION__ __INSTALL_DIR__/console mautic:emails:send > /dev/null 2>&1 0,15,30,45 * * * * __APP__ /usr/bin/php__PHP_VERSION__ __INSTALL_DIR__/console mautic:emails:send > /dev/null 2>&1
15 * * * * __APP__ /usr/bin/php__PHPVERSION__ __INSTALL_DIR__/console mautic:webhooks:process > /dev/null 2>&1 15 * * * * __APP__ /usr/bin/php__PHP_VERSION__ __INSTALL_DIR__/console mautic:webhooks:process > /dev/null 2>&1
0 0 1 * * __APP__ /usr/bin/php__PHPVERSION__ __INSTALL_DIR__/console mautic:maintenance:cleanup -days-old=90 no-interaction > /dev/null 2>&1 0 0 1 * * __APP__ /usr/bin/php__PHP_VERSION__ __INSTALL_DIR__/console mautic:maintenance:cleanup -days-old=90 no-interaction > /dev/null 2>&1
0 4 * * * __APP__ /usr/bin/php__PHPVERSION__ __INSTALL_DIR__/console mautic:iplookup:download > /dev/null 2>&1 0 4 * * * __APP__ /usr/bin/php__PHP_VERSION__ __INSTALL_DIR__/console mautic:iplookup:download > /dev/null 2>&1

View file

@ -1,5 +0,0 @@
; Additional php.ini defines, specific to this pool of workers.
php_admin_value[upload_max_filesize] = 100M
php_admin_value[post_max_size] = 100M
php_admin_value[memory_limit] = 512M

View file

@ -15,7 +15,7 @@ location __PATH__/ {
location ~ [^/]\.php(/|$) { location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.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; fastcgi_index index.php;
include fastcgi_params; include fastcgi_params;
fastcgi_param REMOTE_USER $remote_user; fastcgi_param REMOTE_USER $remote_user;

View file

@ -17,7 +17,8 @@ admindoc = "https://docs.mautic.org/en"
code = "https://github.com/mautic/mautic" code = "https://github.com/mautic/mautic"
[integration] [integration]
yunohost = ">= 11.2" yunohost = ">= 11.2.18"
helpers_version = "2.1"
architectures = "all" architectures = "all"
multi_instance = true multi_instance = true
@ -50,6 +51,7 @@ ram.runtime = "50M"
allow_email = true allow_email = true
[resources.install_dir] [resources.install_dir]
group = "www-data:r-x"
[resources.permissions] [resources.permissions]
main.url = "/" main.url = "/"

View file

@ -1,23 +1,7 @@
#!/bin/bash #!/bin/bash
#================================================= #=================================================
# COMMON VARIABLES # COMMON VARIABLES AND CUSTOM HELPERS
#================================================= #=================================================
timezone="$(cat /etc/timezone)" timezone="$(cat /etc/timezone)"
#=================================================
# PERSONAL HELPERS
#=================================================
#=================================================
# EXPERIMENTAL HELPERS
#=================================================
#=================================================
# FUTURE OFFICIAL HELPERS
#=================================================
#=================================================
# EXPERIMENTAL HELPERS
#=================================================

View file

@ -7,36 +7,33 @@
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#================================================= ynh_print_info "Declaring files to be backed up..."
# DECLARE DATA AND CONF FILES TO BACKUP
#=================================================
ynh_print_info --message="Declaring files to be backed up..."
#================================================= #=================================================
# BACKUP THE APP MAIN DIR # BACKUP THE APP MAIN DIR
#================================================= #=================================================
ynh_backup --src_path="$install_dir" ynh_backup "$install_dir"
#================================================= #=================================================
# SYSTEM CONFIGURATION # 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"
ynh_backup --src_path="/etc/cron.d/$app" ynh_backup "/etc/cron.d/$app"
#================================================= #=================================================
# BACKUP THE MYSQL DATABASE # 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 # 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)."

View file

@ -10,12 +10,12 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
# MODIFY URL IN NGINX CONF # MODIFY URL IN NGINX CONF
#================================================= #=================================================
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=5 ynh_script_progression "Updating NGINX web server configuration..."
ynh_change_url_nginx_config ynh_config_change_url_nginx
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Change of URL completed for $app" --last ynh_script_progression "Change of URL completed for $app"

View file

@ -7,17 +7,20 @@
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
ynh_app_setting_set --key=php_upload_max_filesize --value=100M
ynh_app_setting_set --key=php_memory_limit --value=512M
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
ynh_script_progression --message="Setting up source files..." --weight=2 ynh_script_progression "Setting up source files..."
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir" ynh_setup_source --dest_dir="$install_dir"
chmod -R o-rwx "$install_dir" #REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir"
chown -R "$app:www-data" "$install_dir" #REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R "$app:www-data" "$install_dir"
chmod -R g+w "$install_dir/app/config/" chmod -R g+w "$install_dir/app/config/"
chmod -R g+w "$install_dir/media/files/" chmod -R g+w "$install_dir/media/files/"
chmod -R g+w "$install_dir/media/images/" chmod -R g+w "$install_dir/media/images/"
@ -26,19 +29,19 @@ chmod -R g+w "$install_dir/translations/"
#================================================= #=================================================
# SYSTEM CONFIGURATION # SYSTEM CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 ynh_script_progression "Adding system configurations related to $app..."
# Create a dedicated PHP-FPM config # Create a dedicated PHP-FPM config
ynh_add_fpm_config ynh_config_add_phpfpm
# Create a dedicated NGINX config # Create a dedicated NGINX config
ynh_add_nginx_config ynh_config_add_nginx
ynh_add_config --template="cron" --destination="/etc/cron.d/$app" ynh_config_add --template="cron" --destination="/etc/cron.d/$app"
chmod 644 "/etc/cron.d/$app" #REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 644 "/etc/cron.d/$app"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Installation of $app completed" --last ynh_script_progression "Installation of $app completed"

View file

@ -10,19 +10,19 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
# REMOVE SYSTEM CONFIGURATIONS # 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 # Remove the dedicated NGINX config
ynh_remove_nginx_config ynh_config_remove_nginx
# Remove the dedicated PHP-FPM config # Remove the dedicated PHP-FPM config
ynh_remove_fpm_config ynh_config_remove_phpfpm
# Remove a cron file # Remove a cron file
ynh_secure_remove --file="/etc/cron.d/$app" ynh_safe_rm "/etc/cron.d/$app"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Removal of $app completed" --last ynh_script_progression "Removal of $app completed"

View file

@ -11,13 +11,12 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
# RESTORE THE APP MAIN DIR # RESTORE THE APP MAIN DIR
#================================================= #=================================================
ynh_script_progression --message="Restoring the app main directory..." --weight=2 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"
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir"
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R "$app:www-data" "$install_dir"
chmod -R g+w "$install_dir/app/config/" chmod -R g+w "$install_dir/app/config/"
chmod -R g+w "$install_dir/media/files/" chmod -R g+w "$install_dir/media/files/"
chmod -R g+w "$install_dir/media/images/" chmod -R g+w "$install_dir/media/images/"
@ -26,32 +25,32 @@ chmod -R g+w "$install_dir/translations/"
#================================================= #=================================================
# RESTORE THE MYSQL DATABASE # RESTORE THE MYSQL DATABASE
#================================================= #=================================================
ynh_script_progression --message="Restoring the MySQL database..." --weight=2 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 # 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"
ynh_restore_file --origin_path="/etc/cron.d/$app" ynh_restore "/etc/cron.d/$app"
chmod 644 "/etc/cron.d/$app" #REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 644 "/etc/cron.d/$app"
#================================================= #=================================================
# RELOAD NGINX AND PHP-FPM # 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 # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Restoration completed for $app" --last ynh_script_progression "Restoration completed for $app"

View file

@ -7,17 +7,20 @@
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
ynh_app_setting_set_default --key=php_upload_max_filesize --value=100M
ynh_app_setting_set_default --key=php_memory_limit --value=512M
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
ynh_script_progression --message="Upgrading source files..." --weight=1 ynh_script_progression "Upgrading source files..."
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir" --full_replace=1 --keep="config/local.php media/files media/images translations" ynh_setup_source --dest_dir="$install_dir" --full_replace --keep="config/local.php media/files media/images translations"
chmod -R o-rwx "$install_dir"
chown -R "$app:www-data" "$install_dir"
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir"
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R "$app:www-data" "$install_dir"
chmod -R g+w "$install_dir/app/config/" chmod -R g+w "$install_dir/app/config/"
chmod -R g+w "$install_dir/media/files/" chmod -R g+w "$install_dir/media/files/"
chmod -R g+w "$install_dir/media/images/" chmod -R g+w "$install_dir/media/images/"
@ -26,16 +29,16 @@ chmod -R g+w "$install_dir/translations/"
#================================================= #=================================================
# REAPPLY SYSTEM CONFIGURATIONS # REAPPLY SYSTEM CONFIGURATIONS
#================================================= #=================================================
ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 ynh_script_progression "Upgrading system configurations related to $app..."
# Create a dedicated PHP-FPM config # Create a dedicated PHP-FPM config
ynh_add_fpm_config ynh_config_add_phpfpm
# Create a dedicated NGINX config # Create a dedicated NGINX config
ynh_add_nginx_config ynh_config_add_nginx
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Upgrade of $app completed" --last ynh_script_progression "Upgrade of $app completed"