Bug 39305: Display a warning on the about page if Plack is not running

CSRF protection is only working if Koha is running under Plack.

The about page is not showing any errors if plack is not running.

Test plan:
0. Do not apply this patch
1. Go to the about page
=> Notice the "PSGI" entry in the "Server information" tab
2. Disable plack
koha-plack --disable kohadev && restart_all
3. Go to the about page
=> Notice that the "PSGI" entry is not displayed, and nothing indicates
that plack is not running
4. Apply this patch
=> "PSGI" now shows "Koha is running in CGI mode. This is a security issue! Use koha-plack --help"

Better wording idea welcome.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2025-03-11 15:29:10 +01:00 committed by Jesse Maseto
parent c7cf695279
commit b264623e48
No known key found for this signature in database
GPG Key ID: 4D16BFCF78FFFDEC
1 changed files with 7 additions and 5 deletions

View File

@ -98,12 +98,14 @@
<th scope="row">Apache version: </th>
<td>[% apacheVersion | html %]</td>
</tr>
[% IF (is_psgi) %]
<tr>
<th scope="row">PSGI: </th>
<tr>
<th scope="row">PSGI: </th>
[% IF is_psgi %]
<td>[% psgi_server | html %]</td>
</tr>
[% END %]
[% ELSE %]
<td class="error">Koha is running in CGI mode. This is a security issue! Use <code>koha-plack --help</code></td>
[% END %]
</tr>
[% IF Koha.Preference('SearchEngine') == 'Elasticsearch' %]
<tr>
<th scope="row">Elasticsearch: </th>