From 3ef261d813e0f075c7eb59375bd7243f615313a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davi=20Ant=C3=B4nio=20da=20Silva=20Santos?= Date: Wed, 1 Mar 2023 10:58:59 -0300 Subject: Add vim .swp files to .gitignore Do not track Vim .swp files. --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index a78607f..688aa05 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,5 @@ debian/boca.substvars debian/boca/ debian/debhelper-build-stamp debian/files + +*.swp -- cgit v1.2.3 From a9192809bffccf842fc2ef37ad67d5121c0a4ad9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davi=20Ant=C3=B4nio=20da=20Silva=20Santos?= Date: Wed, 1 Mar 2023 11:00:31 -0300 Subject: Move project to the new debhelper dependency The debian/compat file is not recommended to configure debhelper as a build dependency. Therefore, the aformenetioned package has been deleted and replaced with the debhelper-compat (= 13) dependency stated in the debian/control file. The recommended debhelper level for Ubuntu Jammy (22.04 LTS) is 13. This required a version bump from the older level, 10. For more information, please check: * https://nthykier.wordpress.com/2019/01/04/debhelper-compat-12-is-now-released/ * https://manpages.ubuntu.com/manpages/jammy/en/man7/debhelper.7.html --- debian/compat | 1 - debian/control | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) delete mode 100644 debian/compat diff --git a/debian/compat b/debian/compat deleted file mode 100644 index f599e28..0000000 --- a/debian/compat +++ /dev/null @@ -1 +0,0 @@ -10 diff --git a/debian/control b/debian/control index 62135f4..20c7828 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: misc Priority: optional Maintainer: BOCA Development Team Uploaders: Cassio Polpo de Campos , Bruno Cesar Ribas -Build-Depends: debhelper, build-essential +Build-Depends: debhelper-compat (= 13), build-essential Package: boca Architecture: all -- cgit v1.2.3 From 290dc700f73725caae6287c63df515af3c3d7b1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davi=20Ant=C3=B4nio=20da=20Silva=20Santos?= Date: Wed, 1 Mar 2023 12:59:47 -0300 Subject: Drop build dependency on build-essential The build dependency on build-essential was unnecessary, as this dependency is presumed for building debian packages and is already included on buildd machines. --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 20c7828..1a693e7 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: misc Priority: optional Maintainer: BOCA Development Team Uploaders: Cassio Polpo de Campos , Bruno Cesar Ribas -Build-Depends: debhelper-compat (= 13), build-essential +Build-Depends: debhelper-compat (= 13) Package: boca Architecture: all -- cgit v1.2.3 From 05553d1ca7a4eba5c7487cff31384bd90b2b067f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davi=20Ant=C3=B4nio=20da=20Silva=20Santos?= Date: Wed, 1 Mar 2023 13:02:47 -0300 Subject: Update and change package type to '3.0 (quilt)' The package type was upgraded from the implicit '1.0 (native)' to the explicitly defined in debian/source/format '3.0 (quilt)'. The 3.0 format enables various improvements, including xz compression. The quilt format is used for regular (non-native) debian packages, and requires an upstream tarball in the directory above the git repository. The upstream tarball contains only the source code, which means that the presence of the .git and the debian directories is not recommended. For build instructions, please check: * https://www.debian.org/doc/manuals/debmake-doc/ch05.en.html * https://wiki.debian.org/Packaging/Intro --- debian/source/format | 1 + 1 file changed, 1 insertion(+) create mode 100644 debian/source/format diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) -- cgit v1.2.3 From 13485d6bd7012f24d1183ac6f2bd0217fadc1c50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davi=20Ant=C3=B4nio=20da=20Silva=20Santos?= Date: Wed, 1 Mar 2023 19:09:16 -0300 Subject: Correct data and remove dh_make boilerplate The debian/copyright contained boilerplate data from the automatically generated example made by dh_make. It was removed as such situation is considered an error by Lintian (copyright-contains-dh_make-todo-boilerplate). The upstream name field has been corrected, as well as copyright fields concerning the source location and general copyright information. --- debian/copyright | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/debian/copyright b/debian/copyright index a51c332..82c29f7 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,14 +1,16 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: maratona-background -Source: +Upstream-Name: boca +Upstream-Contact: BOCA Development Team +Source: Files: * -Copyright: - +Copyright: 2012-2023 BOCA Development Team License: GPL-2.0+ Files: debian/* -Copyright: 2016 Bruno Ribas +Copyright: 2016-2022 Bruno Ribas + 2016-2018 Cassio de Campos + 2023 Davi Antônio da Silva Santos License: GPL-2.0+ License: GPL-2.0+ @@ -27,8 +29,3 @@ License: GPL-2.0+ . On Debian systems, the complete text of the GNU General Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". - -# Please also look if there are files or directories which have a -# different copyright/license attached and list them here. -# Please avoid picking licenses with terms that are more restrictive than the -# packaged work, as it may make Debian's contributions unacceptable upstream. -- cgit v1.2.3 From c7ae39681753497b8c1ab1b99685a89c89caad03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davi=20Ant=C3=B4nio=20da=20Silva=20Santos?= Date: Wed, 1 Mar 2023 19:15:30 -0300 Subject: Fix descriptions' syntax The debian/control file had problems with the syntax of the descriptions: they had extra spaces, leading to parse errors. --- debian/control | 59 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/debian/control b/debian/control index 1a693e7..8961ccc 100644 --- a/debian/control +++ b/debian/control @@ -10,60 +10,59 @@ Architecture: all Depends: boca-common, boca-web, boca-db, boca-autojudge Provides: maratona-boca Description: BOCA is a software created to control a contest with the ACM ICPC rules. - BOCA is a software created to control a contest with the ACM International - Collegiate Programming Contest rules. It has been developed in PHP and the - interaction between judges and the system is done through a web browser. - . - This package install all boca related packages to run everything in one - single machine. + BOCA is a software created to control a contest with the ACM International + Collegiate Programming Contest rules. It has been developed in PHP and the + interaction between judges and the system is done through a web browser. + . + This package install all boca related packages to run everything in one + single machine. Package: boca-db Architecture: all Pre-depends: postgresql Depends: boca-common Description: BOCA - database - BOCA is a software created to control a contest with the ACM International - Collegiate Programming Contest rules. It has been developed in PHP and the - interaction between judges and the system is done through a web browser. - . - This package provides a full database to run a contest on. + BOCA is a software created to control a contest with the ACM International + Collegiate Programming Contest rules. It has been developed in PHP and the + interaction between judges and the system is done through a web browser. + . + This package provides a full database to run a contest on. Package: boca-web Architecture: all Depends: boca-common, apache2, php-fpm, php Description: BOCA - WEB files - BOCA is a software created to control a contest with the ACM International - Collegiate Programming Contest rules. It has been developed in PHP and the - interaction between judges and the system is done through a web browser. - . - This package provides only web contents. + BOCA is a software created to control a contest with the ACM International + Collegiate Programming Contest rules. It has been developed in PHP and the + interaction between judges and the system is done through a web browser. + . + This package provides only web contents. Package: boca-common Architecture: all Pre-Depends: debconf, makepasswd, coreutils, sharutils Depends: php-zip, wget, php-cli, php-pgsql, php-gd, postgresql-client, php-xml, openssl, libany-uri-escape-perl Description: BOCA - Common files - BOCA is a software created to control a contest with the ACM International - Collegiate Programming Contest rules. It has been developed in PHP and the - interaction between judges and the system is done through a web browser. - . - This package contains shared files with all BOCA packages. + BOCA is a software created to control a contest with the ACM International + Collegiate Programming Contest rules. It has been developed in PHP and the + interaction between judges and the system is done through a web browser. + . + This package contains shared files with all BOCA packages. Package: boca-autojudge Architecture: amd64 Depends: boca-common, debootstrap, schroot, quotatool, makepasswd Description: BOCA - AutoJudge - BOCA is a software created to control a contest with the ACM International - Collegiate Programming Contest rules. It has been developed in PHP and the - interaction between judges and the system is done through a web browser. - . - This package contains files to generate and run the autojudge system for - BOCA. + BOCA is a software created to control a contest with the ACM International + Collegiate Programming Contest rules. It has been developed in PHP and the + interaction between judges and the system is done through a web browser. + . + This package contains files to generate and run the autojudge system for + BOCA. Package: boca-submission-tools Architecture: amd64 Depends: sharutils, wget, coreutils, libany-uri-escape-perl, openssl, openssh-server, logkeys Description: BOCA submission tools. - This package provides tools to submit codes to a running boca server - without using the web interface. - + This package provides tools to submit codes to a running boca server + without using the web interface. -- cgit v1.2.3 From 48c01087ee39d8a7a03df28e4ce76ab5dcfc2d46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davi=20Ant=C3=B4nio=20da=20Silva=20Santos?= Date: Wed, 1 Mar 2023 21:03:05 -0300 Subject: Use debhelper to find missing dependencies The project already used debhelper, but it did not use the automatic dependency and shared library finder. Adding the expansion varibles `${misc:Depends}` and ${shlibs:Depends}` solves this problem and the error found by lintian's static analysis (missing-dependency-on-libc). --- debian/control | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/debian/control b/debian/control index 8961ccc..882ee8e 100644 --- a/debian/control +++ b/debian/control @@ -7,7 +7,7 @@ Build-Depends: debhelper-compat (= 13) Package: boca Architecture: all -Depends: boca-common, boca-web, boca-db, boca-autojudge +Depends: ${misc:Depends}, ${shlibs:Depends}, boca-common, boca-web, boca-db, boca-autojudge Provides: maratona-boca Description: BOCA is a software created to control a contest with the ACM ICPC rules. BOCA is a software created to control a contest with the ACM International @@ -20,7 +20,7 @@ Description: BOCA is a software created to control a contest with the ACM ICPC r Package: boca-db Architecture: all Pre-depends: postgresql -Depends: boca-common +Depends: ${misc:Depends}, ${shlibs:Depends}, boca-common Description: BOCA - database BOCA is a software created to control a contest with the ACM International Collegiate Programming Contest rules. It has been developed in PHP and the @@ -30,7 +30,7 @@ Description: BOCA - database Package: boca-web Architecture: all -Depends: boca-common, apache2, php-fpm, php +Depends: ${misc:Depends}, ${shlibs:Depends}, boca-common, apache2, php-fpm, php Description: BOCA - WEB files BOCA is a software created to control a contest with the ACM International Collegiate Programming Contest rules. It has been developed in PHP and the @@ -41,7 +41,7 @@ Description: BOCA - WEB files Package: boca-common Architecture: all Pre-Depends: debconf, makepasswd, coreutils, sharutils -Depends: php-zip, wget, php-cli, php-pgsql, php-gd, postgresql-client, php-xml, openssl, libany-uri-escape-perl +Depends: ${misc:Depends}, ${shlibs:Depends}, php-zip, wget, php-cli, php-pgsql, php-gd, postgresql-client, php-xml, openssl, libany-uri-escape-perl Description: BOCA - Common files BOCA is a software created to control a contest with the ACM International Collegiate Programming Contest rules. It has been developed in PHP and the @@ -51,7 +51,7 @@ Description: BOCA - Common files Package: boca-autojudge Architecture: amd64 -Depends: boca-common, debootstrap, schroot, quotatool, makepasswd +Depends: ${misc:Depends}, ${shlibs:Depends}, boca-common, debootstrap, schroot, quotatool, makepasswd Description: BOCA - AutoJudge BOCA is a software created to control a contest with the ACM International Collegiate Programming Contest rules. It has been developed in PHP and the @@ -62,7 +62,7 @@ Description: BOCA - AutoJudge Package: boca-submission-tools Architecture: amd64 -Depends: sharutils, wget, coreutils, libany-uri-escape-perl, openssl, openssh-server, logkeys +Depends: ${misc:Depends}, ${shlibs:Depends}, sharutils, wget, coreutils, libany-uri-escape-perl, openssl, openssh-server, logkeys Description: BOCA submission tools. This package provides tools to submit codes to a running boca server without using the web interface. -- cgit v1.2.3 From 5a2eff0685e4e1cd4040365c3a00252cbdbcc4dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davi=20Ant=C3=B4nio=20da=20Silva=20Santos?= Date: Wed, 1 Mar 2023 21:18:54 -0300 Subject: Add required field Standards-Version The Standards-Version is a mandatory field and its absence violates the Debian Policy and generates an error on lintian (required-field). Also check the lintian recommended documentation in case of a package that has been detected by the `required-field` rule/tag: * Debian Policy Manual section 5.3 * Debian Policy Manual section 5.5 * Debian Policy Manual section 5.6.11 --- debian/control | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/control b/debian/control index 882ee8e..4473fa9 100644 --- a/debian/control +++ b/debian/control @@ -4,6 +4,7 @@ Priority: optional Maintainer: BOCA Development Team Uploaders: Cassio Polpo de Campos , Bruno Cesar Ribas Build-Depends: debhelper-compat (= 13) +Standards-Version: 4.6.0.1 Package: boca Architecture: all -- cgit v1.2.3 From 824e363a161275dca4fa845c5157e214ec5450eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davi=20Ant=C3=B4nio=20da=20Silva=20Santos?= Date: Wed, 1 Mar 2023 21:27:36 -0300 Subject: Drop unversioned dependencies on essential package Debian Policy Manual section 3 states that a package is strongly advised against depending on essential packages without except when explicitly declaring a version constraint. Essential packages are defined as "the minimal set of functionality that must be available and usable on the system at all times" according to the Debian Policy Manual section 3.8. Given the reasons mentioned above, the dependencies on coreutils, an essential package, have been removed from boca-common and boca-submission-tools. This has also cleared the project from the Lintian error `depends-on-essential-package-without-using-version`. --- debian/control | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/control b/debian/control index 4473fa9..d8024df 100644 --- a/debian/control +++ b/debian/control @@ -41,7 +41,7 @@ Description: BOCA - WEB files Package: boca-common Architecture: all -Pre-Depends: debconf, makepasswd, coreutils, sharutils +Pre-Depends: debconf, makepasswd, sharutils Depends: ${misc:Depends}, ${shlibs:Depends}, php-zip, wget, php-cli, php-pgsql, php-gd, postgresql-client, php-xml, openssl, libany-uri-escape-perl Description: BOCA - Common files BOCA is a software created to control a contest with the ACM International @@ -63,7 +63,7 @@ Description: BOCA - AutoJudge Package: boca-submission-tools Architecture: amd64 -Depends: ${misc:Depends}, ${shlibs:Depends}, sharutils, wget, coreutils, libany-uri-escape-perl, openssl, openssh-server, logkeys +Depends: ${misc:Depends}, ${shlibs:Depends}, sharutils, wget, libany-uri-escape-perl, openssl, openssh-server, logkeys Description: BOCA submission tools. This package provides tools to submit codes to a running boca server without using the web interface. -- cgit v1.2.3 From cbe0038d2a7eaa08ad8acac4f21da1a72d1acda9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davi=20Ant=C3=B4nio=20da=20Silva=20Santos?= Date: Wed, 1 Mar 2023 23:18:02 -0300 Subject: Fix packages' short and long descriptions The packages' long and short descriptions have been rewritten to address the following errors, warnings and information found by Lintian: * boca-autojudge: description-is-pkg-name BOCA - AutoJudge * boca: description-starts-with-package-name * boca: empty-binary-package * boca: synopsis-is-a-sentence "BOCA is a software created to control a contest with the ACM ICPC rules.". --- debian/control | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/debian/control b/debian/control index d8024df..3c8ae00 100644 --- a/debian/control +++ b/debian/control @@ -10,12 +10,12 @@ Package: boca Architecture: all Depends: ${misc:Depends}, ${shlibs:Depends}, boca-common, boca-web, boca-db, boca-autojudge Provides: maratona-boca -Description: BOCA is a software created to control a contest with the ACM ICPC rules. +Description: manage a contest with the ACM ICPC rules BOCA is a software created to control a contest with the ACM International Collegiate Programming Contest rules. It has been developed in PHP and the interaction between judges and the system is done through a web browser. . - This package install all boca related packages to run everything in one + This metapackage install all boca related packages to run everything in a single machine. Package: boca-db @@ -53,7 +53,7 @@ Description: BOCA - Common files Package: boca-autojudge Architecture: amd64 Depends: ${misc:Depends}, ${shlibs:Depends}, boca-common, debootstrap, schroot, quotatool, makepasswd -Description: BOCA - AutoJudge +Description: automatic judge system for BOCA BOCA is a software created to control a contest with the ACM International Collegiate Programming Contest rules. It has been developed in PHP and the interaction between judges and the system is done through a web browser. @@ -64,6 +64,6 @@ Description: BOCA - AutoJudge Package: boca-submission-tools Architecture: amd64 Depends: ${misc:Depends}, ${shlibs:Depends}, sharutils, wget, libany-uri-escape-perl, openssl, openssh-server, logkeys -Description: BOCA submission tools. +Description: BOCA tools for headless code submission This package provides tools to submit codes to a running boca server without using the web interface. -- cgit v1.2.3 From f7f89a2ece36fd4a9d7b0a69e563832fff318035 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davi=20Ant=C3=B4nio=20da=20Silva=20Santos?= Date: Wed, 1 Mar 2023 23:33:37 -0300 Subject: Populate dbgsym packages with debug symbols Generate debug symbols by adding the `-g` flag to the `gcc` command and populate the dbgsym packages generated by the tooling with the required debug symbols. This fixes the following Lintian warnings: * boca-autojudge-dbgsym: debug-file-with-no-debug-symbols * boca-submission-tools-dbgsym: debug-file-with-no-debug-symbols --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 6ec0a69..3675033 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,9 @@ tools/safeexec: tools/safeexec.c - gcc tools/safeexec.c -o tools/safeexec + gcc -g tools/safeexec.c -o tools/safeexec tools/boca-submit-run-root-wrapper: tools/boca-submit-run-root-wrapper.c - gcc $^ -o $@ + gcc -g $^ -o $@ install-bocawww: mkdir -p $(DESTDIR)/usr/sbin $(DESTDIR)/etc/cron.d $(DESTDIR)/var/www/boca/ -- cgit v1.2.3 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-common.postinst | 2 +- debian/boca-web.postinst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/boca-common.postinst b/debian/boca-common.postinst index 0a35a35..2d47988 100644 --- a/debian/boca-common.postinst +++ b/debian/boca-common.postinst @@ -48,6 +48,6 @@ case "$1" in esac chmod 600 /var/www/boca/src/private/conf.php -chown www-data.www-data /var/www/boca/src/private/conf.php +chown www-data:www-data /var/www/boca/src/private/conf.php exit 0 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-autojudge.postinst | 5 +++-- debian/boca-common.postinst | 3 +-- debian/boca-db.postinst | 3 +-- debian/boca-submission-tools.postinst | 9 +++++---- debian/boca-web.postinst | 1 + 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/debian/boca-autojudge.postinst b/debian/boca-autojudge.postinst index 06fa222..1813aa0 100644 --- a/debian/boca-autojudge.postinst +++ b/debian/boca-autojudge.postinst @@ -1,7 +1,8 @@ #!/bin/bash +set -e -chmod 4555 /usr/bin/safeexec -chmod 700 /usr/sbin/boca-createjail +chmod 4555 /usr/bin/safeexec +chmod 700 /usr/sbin/boca-createjail chmod 700 /usr/sbin/boca-autojudge exit 0 diff --git a/debian/boca-common.postinst b/debian/boca-common.postinst index 2d47988..9492c78 100644 --- a/debian/boca-common.postinst +++ b/debian/boca-common.postinst @@ -1,10 +1,9 @@ #!/bin/bash +set -e chmod 700 /usr/sbin/boca-config-dbhost chmod 700 /usr/sbin/boca-fixssh -set -e - . /usr/share/debconf/confmodule priority=high diff --git a/debian/boca-db.postinst b/debian/boca-db.postinst index c1ad606..927c6a4 100644 --- a/debian/boca-db.postinst +++ b/debian/boca-db.postinst @@ -1,9 +1,8 @@ #!/bin/bash +set -e chmod 700 /usr/sbin/boca-createdb -set -e - . /usr/share/debconf/confmodule priority=high diff --git a/debian/boca-submission-tools.postinst b/debian/boca-submission-tools.postinst index 21cfdd9..107ddf2 100644 --- a/debian/boca-submission-tools.postinst +++ b/debian/boca-submission-tools.postinst @@ -1,12 +1,13 @@ #!/bin/bash +set -e #Make sure wrapper is suid and others are not readable chmod 700 /usr/sbin/boca-fixes -chmod 700 /usr/sbin/boca-auth-runs -chmod 700 /usr/sbin/boca-outmanage -chmod 700 /usr/sbin/boca-submit-log +chmod 700 /usr/sbin/boca-auth-runs +chmod 700 /usr/sbin/boca-outmanage +chmod 700 /usr/sbin/boca-submit-log chmod 700 /usr/bin/boca-submit-run-* -chmod 4555 /usr/bin/boca-submit-run-root-wrapper +chmod 4555 /usr/bin/boca-submit-run-root-wrapper for i in boca-submit-list boca-submit-oldlist; do rm -f /usr/bin/$i || true 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-autojudge.postinst | 5 +++++ debian/boca-common.postinst | 5 +++++ debian/boca-db.postinst | 5 +++++ debian/boca-submission-tools.postinst | 7 +++++++ debian/boca-web.postinst | 5 +++++ 5 files changed, 27 insertions(+) diff --git a/debian/boca-autojudge.postinst b/debian/boca-autojudge.postinst index 1813aa0..274e73b 100644 --- a/debian/boca-autojudge.postinst +++ b/debian/boca-autojudge.postinst @@ -5,4 +5,9 @@ chmod 4555 /usr/bin/safeexec chmod 700 /usr/sbin/boca-createjail chmod 700 /usr/sbin/boca-autojudge +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + exit 0 diff --git a/debian/boca-common.postinst b/debian/boca-common.postinst index 9492c78..3ff74f1 100644 --- a/debian/boca-common.postinst +++ b/debian/boca-common.postinst @@ -49,4 +49,9 @@ esac chmod 600 /var/www/boca/src/private/conf.php chown www-data:www-data /var/www/boca/src/private/conf.php +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + exit 0 diff --git a/debian/boca-db.postinst b/debian/boca-db.postinst index 927c6a4..6154b81 100644 --- a/debian/boca-db.postinst +++ b/debian/boca-db.postinst @@ -73,4 +73,9 @@ esac service postgresql restart || true +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + exit 0 diff --git a/debian/boca-submission-tools.postinst b/debian/boca-submission-tools.postinst index 107ddf2..6b6e15c 100644 --- a/debian/boca-submission-tools.postinst +++ b/debian/boca-submission-tools.postinst @@ -13,3 +13,10 @@ for i in boca-submit-list boca-submit-oldlist; do rm -f /usr/bin/$i || true ln -s /usr/bin/boca-submit-run /usr/bin/$i done + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 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 ++++++++++++++++++++++++++++-------- debian/control | 4 ++-- 2 files changed, 30 insertions(+), 10 deletions(-) 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. diff --git a/debian/control b/debian/control index 3c8ae00..c7af64c 100644 --- a/debian/control +++ b/debian/control @@ -31,7 +31,7 @@ Description: BOCA - database Package: boca-web Architecture: all -Depends: ${misc:Depends}, ${shlibs:Depends}, boca-common, apache2, php-fpm, php +Depends: ${misc:Depends}, ${shlibs:Depends}, boca-common, apache2, php8.1-fpm, php8.1 Description: BOCA - WEB files BOCA is a software created to control a contest with the ACM International Collegiate Programming Contest rules. It has been developed in PHP and the @@ -42,7 +42,7 @@ Description: BOCA - WEB files Package: boca-common Architecture: all Pre-Depends: debconf, makepasswd, sharutils -Depends: ${misc:Depends}, ${shlibs:Depends}, php-zip, wget, php-cli, php-pgsql, php-gd, postgresql-client, php-xml, openssl, libany-uri-escape-perl +Depends: ${misc:Depends}, ${shlibs:Depends}, php8.1-zip, wget, php8.1-cli, php8.1-pgsql, php8.1-gd, postgresql-client, php8.1-xml, openssl, libany-uri-escape-perl Description: BOCA - Common files BOCA is a software created to control a contest with the ACM International Collegiate Programming Contest rules. It has been developed in PHP and the -- 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. --- Makefile | 3 --- debian/boca-web.postinst | 8 ++++++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 3675033..dcb2d35 100644 --- a/Makefile +++ b/Makefile @@ -16,9 +16,6 @@ install-bocawww: install-bocaapache: mkdir -p $(DESTDIR)/etc/apache2/sites-enabled/ cp tools/000-boca.conf $(DESTDIR)/etc/apache2/sites-enabled/000-boca.conf - a2ensite default-ssl || echo a2ensite default-ssl FAILED - a2enmod ssl || echo a2enmod ssl FAILED - a2enmod socache_shmcb || echo a2enmod socache_shmcb FAILED install-scripts: mkdir -p $(DESTDIR)/usr/sbin/ 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 7c0f371cfb3ad3d876325dd0e8e2f9e74e8b5e22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davi=20Ant=C3=B4nio=20da=20Silva=20Santos?= Date: Thu, 2 Mar 2023 20:56:08 -0300 Subject: Use automatic variables to compile tools/safeexec Replace redundant recipe for tools/safeexec rule with automatic variables: * `$^` expands to the names of all rule's prerequistes * `$@` expands to the name of the rule's target Further information is available in https://www.gnu.org/software/make/manual/make.html. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index dcb2d35..0674ac2 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ tools/safeexec: tools/safeexec.c - gcc -g tools/safeexec.c -o tools/safeexec + gcc -g $^ -o $@ tools/boca-submit-run-root-wrapper: tools/boca-submit-run-root-wrapper.c gcc -g $^ -o $@ -- cgit v1.2.3 From d73ed8c16a6eaf84a8a40d529668534edb38b443 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davi=20Ant=C3=B4nio=20da=20Silva=20Santos?= Date: Fri, 3 Mar 2023 11:21:48 -0300 Subject: Enable compiler optimisations The tools safeexec and boca-submit-run-root-wrapper are now built with optimisations (gcc optimisation level 2). --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 0674ac2..d30200c 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,9 @@ tools/safeexec: tools/safeexec.c - gcc -g $^ -o $@ + gcc -g -O2 $^ -o $@ tools/boca-submit-run-root-wrapper: tools/boca-submit-run-root-wrapper.c - gcc -g $^ -o $@ + gcc -g -O2 $^ -o $@ install-bocawww: mkdir -p $(DESTDIR)/usr/sbin $(DESTDIR)/etc/cron.d $(DESTDIR)/var/www/boca/ -- 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 --- debian/control | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) 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 diff --git a/debian/control b/debian/control index c7af64c..7ea2089 100644 --- a/debian/control +++ b/debian/control @@ -32,6 +32,7 @@ Description: BOCA - database Package: boca-web Architecture: all Depends: ${misc:Depends}, ${shlibs:Depends}, boca-common, apache2, php8.1-fpm, php8.1 +Conflicts: libapache2-mod-php Description: BOCA - WEB files BOCA is a software created to control a contest with the ACM International Collegiate Programming Contest rules. It has been developed in PHP and the -- cgit v1.2.3 From e3ed13ce5dc654fb36f94ffb2a20744cff2cd77f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davi=20Ant=C3=B4nio=20da=20Silva=20Santos?= Date: Fri, 3 Mar 2023 16:48:41 -0300 Subject: Add clean rule to the Makefile A clean rule was added to the Makefile, to remove compiled binaries. This fixes Lintian's tag source-contains-prebuilt-binary. --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index d30200c..1645d87 100644 --- a/Makefile +++ b/Makefile @@ -49,6 +49,10 @@ install-bocaautojudge: tools/safeexec install: install-bocawww install-bocaapache install-bocadb install-bocacommon install-bocaautojudge install-scripts +clean: + $(RM) tools/safeexec + $(RM) tools/boca-submit-run-root-wrapper + install-submission-tools: tools/boca-submit-run-root-wrapper mkdir -p $(DESTDIR)/usr/bin $(DESTDIR)/usr/sbin $(DESTDIR)/etc/cron.d install tools/boca-auth-runs $(DESTDIR)/usr/sbin/ -- cgit v1.2.3 From b3d5664549235a4b1bc172397deed7b2d1ec8ec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davi=20Ant=C3=B4nio=20da=20Silva=20Santos?= Date: Fri, 3 Mar 2023 20:45:04 -0300 Subject: Do not overwrite Apache's configuration directory The package boca-web tried to modify Apache's configuration directory, which is forbidden by the Debian Policy and triggers Lintian error apache2-reverse-dependency-ships-file-in-not-allowed-directory. This direct modification was also unnecessary, as it was redone by the post installation maintainer script. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 1645d87..172b8cb 100644 --- a/Makefile +++ b/Makefile @@ -14,8 +14,8 @@ install-bocawww: chmod 700 $(DESTDIR)/usr/sbin/boca-fixssh install-bocaapache: - mkdir -p $(DESTDIR)/etc/apache2/sites-enabled/ - cp tools/000-boca.conf $(DESTDIR)/etc/apache2/sites-enabled/000-boca.conf + mkdir -p $(DESTDIR)/etc/apache2/sites-available/ + cp tools/000-boca.conf $(DESTDIR)/etc/apache2/sites-available/000-boca.conf install-scripts: mkdir -p $(DESTDIR)/usr/sbin/ -- cgit v1.2.3 From 734dce195d2d60117a520211c8e8e0ea94267dc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davi=20Ant=C3=B4nio=20da=20Silva=20Santos?= Date: Fri, 3 Mar 2023 20:54:38 -0300 Subject: Release 1.5.15-1 for Ubuntu Jammy (22.04 LTS) Update changelog with all the changes made since its last update on commit 64e2fe62. The package was also migrated to Ubuntu Jammy, also known as 22.04 LTS. --- debian/changelog | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/debian/changelog b/debian/changelog index 0268731..6f37eac 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,29 @@ +boca (1.5.15-1) jammy; urgency=medium + + * Add vim .swp files to .gitignore + * Move project to the new debhelper dependency + * Drop build dependency on build-essential + * Update and change package type to '3.0 (quilt)' + * Correct data and remove dh_make boilerplate + * Fix descriptions' syntax + * Use debhelper to find missing dependencies + * Add required field Standards-Version + * Drop unversioned dependencies on essential package + * Fix packages' short and long descriptions + * Populate dbgsym packages with debug symbols + * Fix chown usage in maintainer scripts + * Abort maintainer scripts on failure + * Enable debhelper automatic generation of shell code + * Migrate dependencies and maintainer scripts to PHP 8.1 + * Remove Apache HTTPD commands from Makefile + * Use automatic variables to compile tools/safeexec + * Enable compiler optimisations + * Conflict with mod_php instead of disabling it + * Add clean rule to the Makefile + * Do not overwrite Apache's configuration directory + + -- Davi Antônio da Silva Santos Fri, 03 Mar 2023 20:51:38 -0300 + boca (1.5.14-8ubuntu4.2) focal; urgency=medium * unglysalt workaround. -- cgit v1.2.3 From cec49620aa67bb376f212ca2aa2be7c00c9da8ea Mon Sep 17 00:00:00 2001 From: Bruno Ribas Date: Wed, 1 Mar 2023 12:28:41 -0300 Subject: webcast.php: Add lock to avoid sending corrupted files Signed-off-by: Bruno Ribas --- src/admin/report/webcast.php | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/admin/report/webcast.php b/src/admin/report/webcast.php index 5189809..3798115 100644 --- a/src/admin/report/webcast.php +++ b/src/admin/report/webcast.php @@ -62,6 +62,10 @@ if($i>=count($wcdata)) { exit; } +//$fplock = fopen($webcastdir . '.lock',"r+"); +//flock($fplock,LOCK_EX); +//sleep(10); + //cleardir($webcastdir); @mkdir($webcastdir); @@ -314,17 +318,23 @@ while(list($e, $c) = each($score)) { } if(is_writable($webcastdir)) { - @file_put_contents($webcastdir . $ds . 'runs',$runfile); + $fplock = fopen($webcastdir . '.lock',"w"); + flock($fplock,LOCK_EX); + fwrite($fplock,"teste\n"); + @file_put_contents($webcastdir . $ds . 'runs',$runfile,LOCK_EX); if($contestfile!='') - @file_put_contents($webcastdir . $ds . 'contest',$contestfile); - @file_put_contents($webcastdir . $ds . 'version',$versionfile); - @file_put_contents($webcastdir . $ds . 'time',$timefile); - @file_put_contents($webcastdir . $ds . 'icpc',$icpcfile); + @file_put_contents($webcastdir . $ds . 'contest',$contestfile,LOCK_EX); + @file_put_contents($webcastdir . $ds . 'version',$versionfile,LOCK_EX); + @file_put_contents($webcastdir . $ds . 'time',$timefile,LOCK_EX); + @file_put_contents($webcastdir . $ds . 'icpc',$icpcfile,LOCK_EX); if(@create_zip($webcastdir,array('.'),$webcastdir . ".zip") != 1) { LOGError("Cannot create score webcast.zip file"); MSGError("Cannot create score webcast.zip file"); } else { echo file_get_contents($webcastdir . ".zip"); + //sleep(30); + flock($fplock,LOCK_UN); + fclose($fplock); exit; } } else { -- cgit v1.2.3 From 6266585d920f689239d1f293230461c8d77747fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davi=20Ant=C3=B4nio=20da=20Silva=20Santos?= Date: Fri, 3 Mar 2023 22:31:19 -0300 Subject: Release 1.5.16-1 Update changelog with all the changes made since its last update on commit 734dce19. --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index 6f37eac..35c0cb4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +boca (1.5.16-1) jammy; urgency=medium + + [ Bruno Ribas ] + * webcast.php: Add lock to avoid sending corrupted files + + -- Davi Antônio da Silva Santos Fri, 03 Mar 2023 22:27:44 -0300 + boca (1.5.15-1) jammy; urgency=medium * Add vim .swp files to .gitignore -- 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(+) 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 From 818abd88d819c860e95e8e8f34bf4bbcd13966c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davi=20Ant=C3=B4nio=20da=20Silva=20Santos?= Date: Sat, 4 Mar 2023 00:38:56 -0300 Subject: Release 1.5.16-2 Update changelog with all the changes made since its last update on commit 6266585d. --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 35c0cb4..a837589 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +boca (1.5.16-2) jammy; urgency=medium + + * Enable boca's virtual host on HTTP (web interface) + + -- Davi Antônio da Silva Santos Sat, 04 Mar 2023 00:37:58 -0300 + boca (1.5.16-1) jammy; urgency=medium [ Bruno Ribas ] -- cgit v1.2.3