From 89d0e395460fe5c0501d95c1223a866a53bdff6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davi=20Ant=C3=B4nio=20da=20Silva=20Santos?= Date: Wed, 1 Mar 2023 23:47:05 -0300 Subject: Fix chown usage in maintainer scripts The maintainer scripts used by boca-common and boca-web used points to separate the user from its group, which is discouraged. The point has been replaced with a colon as recommended by chown's manpage. This fixes the Lintian warnings: * boca-common: maintainer-script-calls-chown-improperly "chown www-data.www-data" [postinst:51] * boca-web: maintainer-script-calls-chown-improperly "chown -R www-data.www-data" [postinst:5] --- debian/boca-web.postinst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'debian/boca-web.postinst') diff --git a/debian/boca-web.postinst b/debian/boca-web.postinst index 2006bff..ca537f5 100644 --- a/debian/boca-web.postinst +++ b/debian/boca-web.postinst @@ -2,7 +2,7 @@ . /usr/share/debconf/confmodule -chown -R www-data.www-data /var/www/boca +chown -R www-data:www-data /var/www/boca chmod -R go-rwx /var/www/boca/src/private a2enmod socache_shmcb -- cgit v1.2.3 From b08843cae0ae8aa428a2a654fc48fbd15c65c714 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davi=20Ant=C3=B4nio=20da=20Silva=20Santos?= Date: Wed, 1 Mar 2023 23:55:08 -0300 Subject: Abort maintainer scripts on failure The `set -e` flag has been enabled in the maintainer scripts. This fixes the Lintian warnings: * boca-autojudge: maintainer-script-ignores-errors [postinst] * boca-submission-tools: maintainer-script-ignores-errors [postinst] * boca-web: maintainer-script-ignores-errors [postinst] The packages boca-common and boca-db were altered to set the flag as early as possible in their maintainer scripts. --- debian/boca-web.postinst | 1 + 1 file changed, 1 insertion(+) (limited to 'debian/boca-web.postinst') diff --git a/debian/boca-web.postinst b/debian/boca-web.postinst index ca537f5..31fa7e7 100644 --- a/debian/boca-web.postinst +++ b/debian/boca-web.postinst @@ -1,4 +1,5 @@ #!/bin/bash +set -e . /usr/share/debconf/confmodule -- cgit v1.2.3 From 6695d2384069b7016398b2a55fc6962b1d8e6985 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davi=20Ant=C3=B4nio=20da=20Silva=20Santos?= Date: Thu, 2 Mar 2023 00:02:32 -0300 Subject: Enable debhelper automatic generation of shell code The maintainer scripts have been modified with the addition of `#DEBHELPER#`. This enables dh_installdeb to automatically generate shell code on maintainer scripts. The following Lintian warnings have been addressed: * boca source: maintainer-script-lacks-debhelper-token [debian/boca-autojudge.postinst] * boca source: maintainer-script-lacks-debhelper-token [debian/boca-common.postinst] * boca source: maintainer-script-lacks-debhelper-token [debian/boca-db.postinst] * boca source: maintainer-script-lacks-debhelper-token [debian/boca-submission-tools.postinst] * boca source: maintainer-script-lacks-debhelper-token [debian/boca-web.postinst] --- debian/boca-web.postinst | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'debian/boca-web.postinst') diff --git a/debian/boca-web.postinst b/debian/boca-web.postinst index 31fa7e7..108693e 100644 --- a/debian/boca-web.postinst +++ b/debian/boca-web.postinst @@ -20,4 +20,9 @@ service apache2 restart || true #remember to reset possible stored password from debconf db_reset boca-common/dbpassword || true +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + exit 0 -- cgit v1.2.3 From edee1c1af975e885903d2207f657c36275c2e220 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davi=20Ant=C3=B4nio=20da=20Silva=20Santos?= Date: Thu, 2 Mar 2023 15:42:50 -0300 Subject: Migrate dependencies and maintainer scripts to PHP 8.1 The dependencies on PHP packages have been explicitly set to use PHP version 8.1. The boca-web post installation maintainer script has been updated with extra descriptions and a the required steps to migrate from PHP 7.4. --- debian/boca-web.postinst | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) (limited to 'debian/boca-web.postinst') diff --git a/debian/boca-web.postinst b/debian/boca-web.postinst index 108693e..bcfce75 100644 --- a/debian/boca-web.postinst +++ b/debian/boca-web.postinst @@ -6,19 +6,39 @@ set -e chown -R www-data:www-data /var/www/boca chmod -R go-rwx /var/www/boca/src/private +# Stop the apache2 server before changing enabled modules +systemctl stop apache2 + +# Ensure that apache's embedded php module is not loaded +a2dismod php8.1 + +# Enable apache's shared object cache provider that uses a high-performance +# cyclic buffer inside a shared memory segment +# See https://httpd.apache.org/docs/2.4/socache.html a2enmod socache_shmcb -a2enmod proxy_fcgi -# Make sure embedded apache php module is not loaded -a2dismod php7.4 || true +# Recommended setup before enabling the php-fpm with apache httpd 2.4: enable +# fast CGI and set its environment variables +# Older tutorials recommended disabling the mpm_prefork module and enabling the +# mpm_event one before setting Fast CGI up, e.g. +# https://askubuntu.com/questions/1319861/how-to-configure-apache-http-to-php-fpm-on-ubuntu-20-10 +# Fortunately, Apache HTTPD version 2.4 already enables the mpm_event by default +# according the project's documentation +# https://cwiki.apache.org/confluence/display/HTTPD/PHP-FPM +a2enmod proxy_fcgi setenvif + +# Enable php-fpm module for apache +a2enconf php8.1-fpm -#enable php fpm instead -a2enconf php7.4-fpm +# Check the syntax of apache2's configuration file +# This DOES NOT CATCH ALL ERRORS +apache2ctl configtest -service apache2 restart || true +# Restart apache2 with the new configuration +systemctl start apache2 -#remember to reset possible stored password from debconf -db_reset boca-common/dbpassword || true +# Remember to reset possible stored password from debconf +db_reset boca-common/dbpassword # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. -- cgit v1.2.3 From f17e3be93d425f5554a806c0e847c34504a68873 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davi=20Ant=C3=B4nio=20da=20Silva=20Santos?= Date: Thu, 2 Mar 2023 16:23:25 -0300 Subject: Remove Apache HTTPD commands from Makefile The package Makefile contained Apache HTTPD commands, and some of them were repeated in the boca-web post installation maintainer script. The commands were removed from the Makefile, as this requires having a valid apache2 installation as a build dependency. --- debian/boca-web.postinst | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'debian/boca-web.postinst') diff --git a/debian/boca-web.postinst b/debian/boca-web.postinst index bcfce75..824654c 100644 --- a/debian/boca-web.postinst +++ b/debian/boca-web.postinst @@ -12,6 +12,14 @@ systemctl stop apache2 # Ensure that apache's embedded php module is not loaded a2dismod php8.1 +# Configure HTTPS in Apache +# See https://www.arubacloud.com/tutorial/how-to-enable-https-protocol-with-apache-2-on-ubuntu-20-04.aspx +# Enable SSL module +a2enmod ssl + +# Enable default SSL Virtual Host +a2ensite default-ssl + # Enable apache's shared object cache provider that uses a high-performance # cyclic buffer inside a shared memory segment # See https://httpd.apache.org/docs/2.4/socache.html -- cgit v1.2.3 From 55dbd0e43d4744aa5e1eb4f4f7c8a9cbc68df581 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davi=20Ant=C3=B4nio=20da=20Silva=20Santos?= Date: Fri, 3 Mar 2023 11:36:20 -0300 Subject: Conflict with mod_php instead of disabling it The boca-web package will not try to disable Apache's php8.1 module (mod_php for PHP 8.1) anymore. It will conflict with the package that provides the offending module for the distribution's current PHP version, libapache2-mod-php. --- debian/boca-web.postinst | 3 --- 1 file changed, 3 deletions(-) (limited to 'debian/boca-web.postinst') diff --git a/debian/boca-web.postinst b/debian/boca-web.postinst index 824654c..5191e34 100644 --- a/debian/boca-web.postinst +++ b/debian/boca-web.postinst @@ -9,9 +9,6 @@ chmod -R go-rwx /var/www/boca/src/private # Stop the apache2 server before changing enabled modules systemctl stop apache2 -# Ensure that apache's embedded php module is not loaded -a2dismod php8.1 - # Configure HTTPS in Apache # See https://www.arubacloud.com/tutorial/how-to-enable-https-protocol-with-apache-2-on-ubuntu-20-04.aspx # Enable SSL module -- cgit v1.2.3 From d8e874c3b1d980c9f8407bbc25d84730fbc24240 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davi=20Ant=C3=B4nio=20da=20Silva=20Santos?= Date: Sat, 4 Mar 2023 00:35:18 -0300 Subject: Enable boca's virtual host on HTTP (web interface) This fixes the access to the boca's web interface --- debian/boca-web.postinst | 3 +++ 1 file changed, 3 insertions(+) (limited to 'debian/boca-web.postinst') diff --git a/debian/boca-web.postinst b/debian/boca-web.postinst index 5191e34..091905b 100644 --- a/debian/boca-web.postinst +++ b/debian/boca-web.postinst @@ -17,6 +17,9 @@ a2enmod ssl # Enable default SSL Virtual Host a2ensite default-ssl +# Enable boca HTTP Virtual Host +a2ensite 000-boca.conf + # Enable apache's shared object cache provider that uses a high-performance # cyclic buffer inside a shared memory segment # See https://httpd.apache.org/docs/2.4/socache.html -- cgit v1.2.3