From d04f3baf4a5ee8b43ca06a2ddf8da5873e85258b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davi=20Ant=C3=B4nio=20da=20Silva=20Santos?= Date: Mon, 27 Mar 2023 22:53:02 -0300 Subject: Update version info and year The following files were updated to the next version to be released and the current year: - src/version - src/versionnum.php --- src/version | 2 +- src/versionnum.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/version b/src/version index 99637e4..0c87bbd 100644 --- a/src/version +++ b/src/version @@ -1 +1 @@ -boca-1.5.14 +boca-1.5.17 diff --git a/src/versionnum.php b/src/versionnum.php index fc9810f..15f50f9 100644 --- a/src/versionnum.php +++ b/src/versionnum.php @@ -1,5 +1,5 @@ -- cgit v1.2.3 From 194f6764b13e070f77b6ab77207918ddf58a288e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davi=20Ant=C3=B4nio=20da=20Silva=20Santos?= Date: Mon, 27 Mar 2023 22:57:26 -0300 Subject: Release 1.5.17-1 Update changelog with all the changes made since its last update on commit 818abd88. --- debian/changelog | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/debian/changelog b/debian/changelog index a837589..6dfb332 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,30 @@ +boca (1.5.17-1) jammy; urgency=medium + + [ Bruno Ribas ] + * webcast.php: Add lock to avoid sending corrupted files + * src/db.php: Begin migration to php8.1 requirement. Fix use of pg_lo_export + * src/scoretable.php: Remove all each() usage + + [ Daniel Saad Nogueira Nunes ] + * Update stat.php + * Update stat.php (#23) + * Create barplot.py (#24) + * Create piechart.py (#25) + + [ Bruno Ribas ] + * scoretable.php: fix scoreboard to show correct teams + + [ Daniel Saad Nogueira Nunes ] + * Update frun.php (#26) + + [ Rodrigo Laiola Guimarães ] + * Fix user multi-login problem when running BOCA with a reverse proxy (#19) + + [ Davi Antônio da Silva Santos ] + * Update version info and year + + -- Davi Antônio da Silva Santos Mon, 27 Mar 2023 22:55:23 -0300 + boca (1.5.16-2) jammy; urgency=medium * Enable boca's virtual host on HTTP (web interface) -- cgit v1.2.3 From eed5643c702cf86804e8f04e61acb6c824b66292 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davi=20Ant=C3=B4nio=20da=20Silva=20Santos?= Date: Wed, 29 Mar 2023 17:06:39 -0300 Subject: Format code with black 23.1.0 --- src/admin/report/barplot.py | 16 ++++++------- src/admin/report/piechart.py | 57 ++++++++++++++++++++++++++++---------------- 2 files changed, 44 insertions(+), 29 deletions(-) diff --git a/src/admin/report/barplot.py b/src/admin/report/barplot.py index d07f156..edc9df1 100644 --- a/src/admin/report/barplot.py +++ b/src/admin/report/barplot.py @@ -5,23 +5,23 @@ filename = sys.argv[1] title = sys.argv[2] -x = [str(x) + '-' + str(x+10) for x in range(0,300,10)] +x = [str(x) + "-" + str(x + 10) for x in range(0, 300, 10)] -with open(filename,'r') as file: +with open(filename, "r") as file: y = [int(line) for line in file] # Create a bar plot -plt.bar(x, y,width=0.5) +plt.bar(x, y, width=0.5) # Set the y-axis tick labels to step by 5 plt.xticks(rotation=90) -if(max(y)<200): - plt.yticks(range(0, max(y)+1, 5)) +if max(y) < 200: + plt.yticks(range(0, max(y) + 1, 5)) else: - plt.yticks(range(0, max(y)+1, 10)) + plt.yticks(range(0, max(y) + 1, 10)) # Add gridlines to the y-axis -plt.grid(axis='y') +plt.grid(axis="y") # Add a title to the plot plt.title(title) @@ -29,4 +29,4 @@ plt.title(title) plt.tight_layout() # Show the plot -plt.savefig(filename.replace('.txt','.png'),dpi=600,transparent=True) +plt.savefig(filename.replace(".txt", ".png"), dpi=600, transparent=True) diff --git a/src/admin/report/piechart.py b/src/admin/report/piechart.py index 75e5a9d..70904bb 100644 --- a/src/admin/report/piechart.py +++ b/src/admin/report/piechart.py @@ -4,37 +4,52 @@ import sys filename = sys.argv[1] title = sys.argv[2] -label=[] -value=[] +label = [] +value = [] color = [] -with open(filename,'r') as f: +with open(filename, "r") as f: for line in f: tokens = line.split() c = tokens[-1] - problem_data = ' '.join(tokens[0:-1]) - l,v = problem_data.split(':') - if(int(v)>0): - label.append(l+'('+v+')') + problem_data = " ".join(tokens[0:-1]) + l, v = problem_data.split(":") + if int(v) > 0: + label.append(l + "(" + v + ")") value.append(v) color.append(c) -wedges, texts, autotexts = plt.pie(value, colors=color,autopct=lambda p: '{:.1f}%'.format(round(p)) if p > 0 else '',pctdistance=1.2,wedgeprops= {"edgecolor":"black", - 'linewidth': 1, - 'antialiased': False}) +wedges, texts, autotexts = plt.pie( + value, + colors=color, + autopct=lambda p: "{:.1f}%".format(round(p)) if p > 0 else "", + pctdistance=1.2, + wedgeprops={"edgecolor": "black", "linewidth": 1, "antialiased": False}, +) -plt.legend(wedges, label, - loc="center left", - bbox_to_anchor=(1.1, 0, 0.5,1)) +plt.legend(wedges, label, loc="center left", bbox_to_anchor=(1.1, 0, 0.5, 1)) # Add title -plt.title(title,pad=20) -if(len(sys.argv)<=3): - plt.legend(label, bbox_to_anchor=(1.1,0.5), loc="center right", fontsize=10, - bbox_transform=plt.gcf().transFigure,shadow=True) +plt.title(title, pad=20) +if len(sys.argv) <= 3: + plt.legend( + label, + bbox_to_anchor=(1.1, 0.5), + loc="center right", + fontsize=10, + bbox_transform=plt.gcf().transFigure, + shadow=True, + ) else: - plt.legend(label,loc="lower center", bbox_to_anchor=(0.5,-0.1), fontsize=10, - bbox_transform=plt.gcf().transFigure,shadow=True) + plt.legend( + label, + loc="lower center", + bbox_to_anchor=(0.5, -0.1), + fontsize=10, + bbox_transform=plt.gcf().transFigure, + shadow=True, + ) # Show plot # plt.tight_layout() -plt.savefig(filename.replace('.txt','.png'),dpi=600,transparent=True, bbox_inches="tight") - +plt.savefig( + filename.replace(".txt", ".png"), dpi=600, transparent=True, bbox_inches="tight" +) -- cgit v1.2.3 From 971ddcd239a999054a320774aee0a57a7dd6e8ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davi=20Ant=C3=B4nio=20da=20Silva=20Santos?= Date: Wed, 29 Mar 2023 17:11:20 -0300 Subject: Release 1.5.18-1 Update changelog with all the changes made since its last update on commit 194f6764. --- debian/changelog | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/debian/changelog b/debian/changelog index 6dfb332..c78529b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +boca (1.5.18-1) jammy; urgency=medium + + [ Bruno Ribas ] + * private/score.sep: more sane default + * barplot.py: moved to the correct location + * d/control: add python3-matplotlib as depends for boca-web + + [ Davi Antônio da Silva Santos ] + * Format code with black 23.1.0 + + -- Davi Antônio da Silva Santos Wed, 29 Mar 2023 17:09:19 -0300 + boca (1.5.17-1) jammy; urgency=medium [ Bruno Ribas ] -- cgit v1.2.3 From 21f3f2503415a8839385181b5b674b3f16bd141d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davi=20Ant=C3=B4nio=20da=20Silva=20Santos?= Date: Mon, 5 Aug 2024 21:16:19 -0300 Subject: Drop dependency on logkeys --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index fd6fea9..870f3dc 100644 --- a/debian/control +++ b/debian/control @@ -64,7 +64,7 @@ Description: automatic judge system for BOCA Package: boca-submission-tools Architecture: amd64 -Depends: ${misc:Depends}, ${shlibs:Depends}, sharutils, wget, libany-uri-escape-perl, openssl, openssh-server, logkeys +Depends: ${misc:Depends}, ${shlibs:Depends}, sharutils, wget, libany-uri-escape-perl, openssl, openssh-server 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 82ee51dfc45e3885b90498acbc69a908661d929d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davi=20Ant=C3=B4nio=20da=20Silva=20Santos?= Date: Mon, 5 Aug 2024 21:19:39 -0300 Subject: Update internal version info to 1.5.20 The internal version info in the source files has been updated from 1.5.19-1 and 1.5.17 to 1.5.20-1 and 1.5.20. The year has also been updated from 2023 to 2024. --- src/version | 2 +- src/versionnum.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/version b/src/version index 0e65cc2..8b77d75 100644 --- a/src/version +++ b/src/version @@ -1 +1 @@ -boca-1.5.19-1 +boca-1.5.20-1 diff --git a/src/versionnum.php b/src/versionnum.php index 15f50f9..4c85af5 100644 --- a/src/versionnum.php +++ b/src/versionnum.php @@ -1,5 +1,5 @@ -- cgit v1.2.3 From d901d097829fd0d45649a2823602069cc35f280e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davi=20Ant=C3=B4nio=20da=20Silva=20Santos?= Date: Mon, 5 Aug 2024 21:30:23 -0300 Subject: Release version 1.5.20-1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Besides the project's migration to Ubuntu Noble 24.04 LTS, the following changes were also included on this release: * Daniel Saad Nogueira Nunes * Update webcast.php (#34) * webcast.php: fixing FS separador character. (#40) * Gatuno * New autojudge setting on interface per problem. (#41) * Davi Antônio da Silva Santos * Drop dependency on logkeys * Update internal version info to 1.5.20 --- debian/changelog | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/debian/changelog b/debian/changelog index 4cd954f..2444686 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,24 @@ +boca (1.5.20-1) noble; urgency=medium + + [ Daniel Saad Nogueira Nunes ] + * Update webcast.php (#34) + * webcast.php: fixing FS separador character. (#40) + + [ Gatuno ] + * New autojudge setting on interface per problem. (#41) + + [ Davi Antônio da Silva Santos ] + * Drop dependency on logkeys + * Update internal version info to 1.5.20 + + -- Davi Antônio da Silva Santos Mon, 05 Aug 2024 21:24:09 -0300 + +boca (1.5.19-1+ubuntu22.04) noble; urgency=medium + + * Migrate package to Ubuntu noble 24.04 + + -- Davi Antônio da Silva Santos Thu, 30 May 2024 22:40:02 -0300 + boca (1.5.19-1) jammy; urgency=medium [ Rodrigo Laiola Guimarães ] -- cgit v1.2.3 From 724799f212719ff8d70bcff1a8ac107d112833b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davi=20Ant=C3=B4nio=20da=20Silva=20Santos?= Date: Thu, 26 Sep 2024 21:50:01 -0300 Subject: Rebuild for Ubuntu Jammy 22.04 --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 2444686..53f095d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +boca (1.5.20-1+ubuntu22.04) jammy; urgency=medium + + * Rebuild for Ubuntu 22.04 Jammy + + -- Davi Antônio da Silva Santos Mon, 23 Sep 2024 16:47:15 -0300 + boca (1.5.20-1) noble; urgency=medium [ Daniel Saad Nogueira Nunes ] -- cgit v1.2.3 From e91ec1511e0caeabc1af0d613d1abd2af29f88bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davi=20Ant=C3=B4nio=20da=20Silva=20Santos?= Date: Thu, 26 Sep 2024 22:00:47 -0300 Subject: Update internal version info to 1.5.21 --- src/versionnum.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/versionnum.php b/src/versionnum.php index 4c85af5..32f844d 100644 --- a/src/versionnum.php +++ b/src/versionnum.php @@ -1,5 +1,5 @@ -- cgit v1.2.3 From aabfabd628e0ad71cce4b68e11dd53c027237287 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davi=20Ant=C3=B4nio=20da=20Silva=20Santos?= Date: Thu, 26 Sep 2024 22:13:00 -0300 Subject: Release version 1.5.21-1 Simultaneosly releases boca 1.4.21 for Ubuntu 24.04 Noble and 22.04 Jammy. This release fixes the PPA repository added to the system. --- debian/changelog | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/debian/changelog b/debian/changelog index 53f095d..bb423f5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,19 @@ +boca (1.5.21-1+ubuntu22.04) jammy; urgency=medium + + * Rebuild for Ubuntu 22.04 Jammy + + -- Davi Antônio da Silva Santos Thu, 26 Sep 2024 22:10:03 -0300 + +boca (1.5.21-1+ubuntu24.04) noble; urgency=medium + + [ Bruno Ribas ] + * tools/boca-createjail: use correct maratona-linux repo + + [ Davi Antônio da Silva Santos ] + * Update internal version info to 1.5.21 + + -- Davi Antônio da Silva Santos Thu, 26 Sep 2024 22:04:22 -0300 + boca (1.5.20-1+ubuntu22.04) jammy; urgency=medium * Rebuild for Ubuntu 22.04 Jammy -- cgit v1.2.3 From 008e6cc9624c56e296069bd2a55d7d6268d88442 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davi=20Ant=C3=B4nio=20da=20Silva=20Santos?= Date: Tue, 29 Apr 2025 17:25:26 -0300 Subject: build: specify that the build does not require root Explicitly declaring that the rules files does not require root access will speed up the package compilation. --- debian/control | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 870f3dc..adc1fb1 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,8 @@ 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 +Rules-Requires-Root: no +Standards-Version: 4.7.2.0 Package: boca Architecture: all -- cgit v1.2.3 From c2bc162b88af6d4c989782a811b3a941c123b4a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davi=20Ant=C3=B4nio=20da=20Silva=20Santos?= Date: Tue, 29 Apr 2025 17:27:05 -0300 Subject: chore: update debian/copyright Add old developers and update the years to 2025. --- debian/copyright | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/debian/copyright b/debian/copyright index 82c29f7..3f5c982 100644 --- a/debian/copyright +++ b/debian/copyright @@ -4,13 +4,21 @@ Upstream-Contact: BOCA Development Team Source: Files: * -Copyright: 2012-2023 BOCA Development Team +Copyright: 2012-2025 BOCA Development Team License: GPL-2.0+ Files: debian/* -Copyright: 2016-2022 Bruno Ribas - 2016-2018 Cassio de Campos - 2023 Davi Antônio da Silva Santos +Copyright: 2015 Alejandro Santos + 2019 Arthur Diniz + 2016-2022 Bruno Ribas + 2017 Carlos Joa + 2012-2018 Cassio de Campos + 2023-2025 Davi Antônio da Silva Santos + 2023-2024 Daniel Saad Nogueira Nunes + 2024 Gatuno + 2020-2021 Emilio Wuerges + 2023 Rodrigo Laiola Guimarães + 2018 Ronistone Junior License: GPL-2.0+ License: GPL-2.0+ -- cgit v1.2.3 From 8991ce969d17c170a13480822dd2e6945493bfe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davi=20Ant=C3=B4nio=20da=20Silva=20Santos?= Date: Tue, 29 Apr 2025 17:27:56 -0300 Subject: build: release version 1.5.21-2+ubuntu24.04 Release version 1.5.21-2+ubuntu24.04 for Ubuntu Noble 24.04 LTS. --- debian/changelog | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/debian/changelog b/debian/changelog index bb423f5..fb1bf21 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +boca (1.5.21-2+ubuntu24.04) noble; urgency=medium + + * Update copyright file + * Update the standards version to 4.7.2.0 + * Specify that the build does not require root + + -- Davi Antônio da Silva Santos Mon, 28 Apr 2025 23:29:20 -0300 + boca (1.5.21-1+ubuntu22.04) jammy; urgency=medium * Rebuild for Ubuntu 22.04 Jammy -- cgit v1.2.3 From 65154ad245ec8b15e823e0d602ca667c636caa13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davi=20Ant=C3=B4nio=20da=20Silva=20Santos?= Date: Wed, 30 Apr 2025 00:19:55 -0300 Subject: fix: correct multiple versions Set the versions to 1.5.22. The program version was reported as 1.5.20-1 and 1.5.21. There are no further coding changes. --- src/version | 2 +- src/versionnum.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/version b/src/version index 8b77d75..6f92667 100644 --- a/src/version +++ b/src/version @@ -1 +1 @@ -boca-1.5.20-1 +boca-1.5.22 diff --git a/src/versionnum.php b/src/versionnum.php index 32f844d..838c1b4 100644 --- a/src/versionnum.php +++ b/src/versionnum.php @@ -1,5 +1,5 @@ -- cgit v1.2.3 From 5fc96ef60317e683f71665603fb725461063f815 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davi=20Ant=C3=B4nio=20da=20Silva=20Santos?= Date: Wed, 30 Apr 2025 22:12:18 -0300 Subject: build: release version 1.5.22-1+ubuntu24.04 Bump version only for upload. --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index fb1bf21..db08d53 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +boca (1.5.22-1+ubuntu24.04) noble; urgency=medium + + * Fix multiple program versions being reported + + -- Davi Antônio da Silva Santos Wed, 30 Apr 2025 00:22:59 -0300 + boca (1.5.21-2+ubuntu24.04) noble; urgency=medium * Update copyright file -- cgit v1.2.3 From 253fcbf02fe2efe6a1f3ff012346615d7e314734 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davi=20Ant=C3=B4nio=20da=20Silva=20Santos?= Date: Thu, 4 Sep 2025 21:40:47 -0300 Subject: fix: patch jail creation for Ubuntu Noble - Update php dependencies to PHP 8.3 - Update the source code to inform version 1.5.23 - Update boca-web maintainer script for PHP 8.3 - Adds Ubuntu mirror to the standard jail - Patch standard jail fixing debootstrap problems with Ubuntu noble - Purge the unecessary packages in the jail - Perform a dist-upgrade after updating the jail - Quote shell variables o prevent suprise splitting - Replace obsolete backticks with `$( )` - Modernise test commands, replacing `[ ]` with `[[ ]]` --- debian/boca-web.postinst | 3 +- debian/changelog | 15 +++++++++ debian/control | 4 +-- src/version | 2 +- src/versionnum.php | 2 +- tools/boca-createjail | 82 +++++++++++++++++++++++++++++++++--------------- 6 files changed, 77 insertions(+), 31 deletions(-) diff --git a/debian/boca-web.postinst b/debian/boca-web.postinst index 091905b..460778d 100644 --- a/debian/boca-web.postinst +++ b/debian/boca-web.postinst @@ -36,7 +36,8 @@ a2enmod socache_shmcb a2enmod proxy_fcgi setenvif # Enable php-fpm module for apache -a2enconf php8.1-fpm +# ALWAYS check for unexpected PHP 8 point releases!!! +a2enconf php8.3-fpm # Check the syntax of apache2's configuration file # This DOES NOT CATCH ALL ERRORS diff --git a/debian/changelog b/debian/changelog index db08d53..847ef1e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,18 @@ +boca (1.5.23-1+ubuntu24.04) noble; urgency=medium + + * Update php dependencies to PHP 8.3 + * Update the source code to inform version 1.5.23 + * Update boca-web maintainer script for PHP 8.3 + * Adds Ubuntu mirror to the standard jail + * Patch standard jail fixing debootstrap problems with Ubuntu noble + * Purge the unecessary packages in the jail + * Perform a dist-upgrade after updating the jail + * Quote shell variables o prevent suprise splitting + * Replace obsolete backticks with `$( )` + * Modernise test commands, replacing `[ ]` with `[[ ]]` + + -- Davi Antônio da Silva Santos Thu, 28 Aug 2025 23:35:45 -0300 + boca (1.5.22-1+ubuntu24.04) noble; urgency=medium * Fix multiple program versions being reported diff --git a/debian/control b/debian/control index adc1fb1..b2c160e 100644 --- a/debian/control +++ b/debian/control @@ -32,7 +32,7 @@ Description: BOCA - database Package: boca-web Architecture: all -Depends: ${misc:Depends}, ${shlibs:Depends}, boca-common, apache2, php8.1-fpm, php8.1, python3-matplotlib +Depends: ${misc:Depends}, ${shlibs:Depends}, boca-common, apache2, php8.3-fpm, php8.3, python3-matplotlib Conflicts: libapache2-mod-php Description: BOCA - WEB files BOCA is a software created to control a contest with the ACM International @@ -44,7 +44,7 @@ Description: BOCA - WEB files Package: boca-common Architecture: all Pre-Depends: debconf, makepasswd, sharutils -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 +Depends: ${misc:Depends}, ${shlibs:Depends}, php8.3-zip, wget, php8.3-cli, php8.3-pgsql, php8.3-gd, postgresql-client, php8.3-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 diff --git a/src/version b/src/version index 6f92667..03f4017 100644 --- a/src/version +++ b/src/version @@ -1 +1 @@ -boca-1.5.22 +boca-1.5.23 diff --git a/src/versionnum.php b/src/versionnum.php index 838c1b4..c0a025e 100644 --- a/src/versionnum.php +++ b/src/versionnum.php @@ -1,5 +1,5 @@ diff --git a/tools/boca-createjail b/tools/boca-createjail index 1340282..7e4ec5c 100755 --- a/tools/boca-createjail +++ b/tools/boca-createjail @@ -1,23 +1,23 @@ #!/bin/bash homejail=/home/bocajail -[ "$1" != "" ] && homejail=$1 +[ "$1" != "" ] && homejail="$1" echo "=================================================================================" echo "============= CREATING $homejail (this might take some time) ===============" echo "=================================================================================" for i in setquota ln id chown chmod dirname useradd mkdir cp rm mv apt-get dpkg uname debootstrap schroot; do - p=`which $i` + p="$(which $i)" if [ -x "$p" ]; then echo -n "" else - echo command "$i" not found + echo "command $i not found" exit 1 fi done -if [ "`id -u`" != "0" ]; then +if [[ "$(id -u)" != "0" ]]; then echo "Must be run as root" exit 1 fi -if [ ! -r /etc/lsb-release ]; then +if [[ ! -r /etc/lsb-release ]]; then echo "File /etc/lsb-release not found. Is this a ubuntu or debian-like distro?" echo "If so, execute the command" echo "" @@ -27,23 +27,23 @@ if [ ! -r /etc/lsb-release ]; then exit 1 fi . /etc/lsb-release -if [ -d /bocajail/ ]; then +if [[ -d /bocajail/ ]]; then echo "You seem to have already a /bocajail installed" echo "If you want to reinstall, remove it first (e.g. rm /bocajail) and then run /etc/icpc/createbocajail.sh" exit 1 fi -if [ -f $homejail/proc/cpuinfo ]; then +if [[ -f "${homejail}/proc/cpuinfo" ]]; then echo "You seem to have already installed /bocajail and the /bocajail/proc seems to be mounted" - chroot $homejail umount /sys >/dev/nul 2>/dev/null - chroot $homejail umount /proc >/dev/nul 2>/dev/null + chroot "$homejail" umount /sys >/dev/nul 2>/dev/null + chroot "$homejail" umount /proc >/dev/nul 2>/dev/null echo "Please reboot the system to remove such mounted point" exit 1 fi id -u bocajail >/dev/null 2>/dev/null -if [ $? != 0 ]; then - useradd -m -s /bin/bash -d $homejail -g users bocajail +if [[ $? != 0 ]]; then + useradd -m -s /bin/bash -d "$homejail" -g users bocajail cat < /var/lib/AccountsService/users/bocajail [User] SystemAccount=true @@ -57,9 +57,9 @@ fi setquota -u bocajail 0 500000 0 10000 -a rm -rf /bocajail -mkdir -p $homejail/tmp -chmod 1777 $homejail/tmp -ln -s $homejail /bocajail +mkdir -p "$homejail/tmp" +chmod 1777 "$homejail/tmp" +ln -s "$homejail" /bocajail #for i in usr lib var bin sbin etc dev; do # [ -d $homejail/$i ] && rm -rf $homejail/$i # cp -ar /$i $homejail @@ -69,7 +69,7 @@ ln -s $homejail /bocajail #mkdir -p $homejail/proc #mkdir -p $homejail/sys uname -m | grep -q 64 -if [ $? == 0 ]; then +if [[ $? == 0 ]]; then archt=amd64 else archt=i386 @@ -84,21 +84,21 @@ type=directory users=bocajail,nobody,root FIM -#debootstrap --arch $archt $DISTRIB_CODENAME $homejail -debootstrap $DISTRIB_CODENAME $homejail -if [ $? != 0 ]; then +#debootstrap --arch "$archt" "$DISTRIB_CODENAME" "$homejail" +debootstrap "$DISTRIB_CODENAME" "$homejail" 'http://archive.ubuntu.com/ubuntu' +if [[ $? != 0 ]]; then echo "bocajail failed to debootstrap" exit 1 else schroot -l | grep -q bocajail -if [ $? == 0 ]; then +if [[ $? == 0 ]]; then echo "bocajail successfully installed at $homejail" else echo "*** some error has caused bocajail not to install properly -- I will try it again with different parameters" echo "location=$homejail" >> /etc/schroot/chroot.d/bocajail.conf - debootstrap $DISTRIB_CODENAME $homejail + debootstrap "$DISTRIB_CODENAME" "$homejail" 'http://archive.ubuntu.com/ubuntu' schroot -l | grep -q bocajail - if [ $? == 0 ]; then + if [[ $? == 0 ]]; then echo "*** bocajail successfully installed at $homejail" else echo "*** bocajail failed to install" @@ -107,6 +107,35 @@ else fi fi +printf "*** Patching broken repositories on Ubuntu noble\n" +if [[ "$DISTRIB_CODENAME" == 'noble' ]]; then + printf '*** Ubuntu %s detected on %s\n' "$DISTRIB_CODENAME" "$homejail" + + if [[ ! -f "${homejail}/etc/apt/sources.list.d/ubuntu.sources" ]]; then + printf "*** Sources file missing\n" + +cat < "${homejail}/etc/apt/sources.list.d/ubuntu.sources" +Types: deb +URIs: http://archive.ubuntu.com/ubuntu +Suites: noble noble-updates noble-backports +Components: main restricted universe multiverse +Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg + +Types: deb +URIs: http://security.ubuntu.com/ubuntu +Suites: noble-security +Components: main restricted universe multiverse +Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg +EOF + printf '*** Patched %s for broken repositories\n' "$homejail" + fi +fi + +# We have two PPAs: +# add-apt-repository -y ppa:icpc-latam/maratona-linux +# add-apt-repository -y ppa:icpc-latam/unstable +# Please use only the STABLE one when officially releasing! + echo "*** Populating $homejail" cat < /home/bocajail/tmp/populate.sh #!/bin/bash @@ -117,21 +146,22 @@ echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen /usr/sbin/locale-gen /usr/sbin/update-locale apt-get -y update -apt-get -y install software-properties-common +apt-get -y dist-upgrade --purge +apt-get -y install software-properties-common --no-install-recommends add-apt-repository -y ppa:icpc-latam/maratona-linux apt-get -y update -apt-get -y upgrade apt-get -y install maratona-linguagens --no-install-recommends --allow-unauthenticated +apt-get autoremove --purge apt-get -y clean umount /proc EOF mkdir -p /bocajail/usr/bin -[ -x /usr/bin/safeexec ] && cp -a /usr/bin/safeexec /bocajail/usr/bin/ -cp -f /etc/apt/sources.list $homejail/etc/apt/ +[[ -x /usr/bin/safeexec ]] && cp -a /usr/bin/safeexec /bocajail/usr/bin/ +cp -f /etc/apt/sources.list "${homejail}/etc/apt/" chmod 755 /home/bocajail/tmp/populate.sh export LC_ALL=en_US.UTF-8 -cd / ; chroot $homejail /tmp/populate.sh +cd / ; chroot "$homejail" /tmp/populate.sh -- cgit v1.2.3