Bugzilla – Attachment 190086 Details for
Bug 41359
There is no warning when Bcrypt settings are invalid
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41359: Add a test/warning for Bcrypt settings to the about page
Bug-41359-Add-a-testwarning-for-Bcrypt-settings-to.patch (text/plain), 4.96 KB, created by
Nick Clemens (kidclamp)
on 2025-12-02 16:50:24 UTC
(
hide
)
Description:
Bug 41359: Add a test/warning for Bcrypt settings to the about page
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2025-12-02 16:50:24 UTC
Size:
4.96 KB
patch
obsolete
>From e756a0e92dfeb841ea53b861c506b74c0f7e3a28 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 2 Dec 2025 16:46:15 +0000 >Subject: [PATCH] Bug 41359: Add a test/warning for Bcrypt settings to the > about page > >This patch adds a simple test of the bcrypt settings to ensure that >pseudonymization will work > >To recreate: >1 - Add a line to koha-conf, or replace existing entry: > <bcrypt_settings>FALSE</bcrypt_settings> >2 - Enable system preferences for Pseudonymization: > Pseudonimization: Enable > PseudonymizationPatronFields: All selected > PseudonymizationTransactionFields: All selected >3 - Checkout an item to a patron >4 - Check Administration->Jobs->Manage Jobs >5 - Note failed job for Pseudonymization >6 - Check the worker log: > /var/log/koha/kohadev/worker-output.log > [2025/12/02 16:25:23] [WARN] Uncaught exception processing job id=12: bad base64 encoding at /kohadevbox/koha/Koha/PseudonymizedTransaction.pm line 175. >7 - Check about page - no warning >8 - Apply patch, restart all >9 - Check about page, now there is a warn! >10 - Add a valid entry, you can generate using the code on bug 28911: > htpasswd -bnBC 10 "" password | tr -d ':\n' | sed 's/$2y/$2a/' >11 - Restart all >12 - Confirm the warning is gone! >--- > about.pl | 7 +++++++ > koha-tmpl/intranet-tmpl/prog/en/modules/about.tt | 7 ++++++- > 2 files changed, 13 insertions(+), 1 deletion(-) > >diff --git a/about.pl b/about.pl >index 45a435894f6..152dfff22cb 100755 >--- a/about.pl >+++ b/about.pl >@@ -421,6 +421,13 @@ if ( $tab eq 'sysinfo' ) { > unless Koha::Patron::Categories->find( C4::Context->preference('PatronSelfRegistrationDefaultCategory') ); > } > >+ if ( C4::Context->preference('Pseudonymization') ) { >+ try { Koha::PseudonymizedTransaction->get_hash(1); } >+ catch { >+ $template->param( warnBadBcryptSettings => 1 ); >+ }; >+ } >+ > # Test YAML system preferences > # FIXME: This is list of current YAML formatted prefs, should by type of preference > my @yaml_prefs = ( >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt >index 4c10bdb9393..71db5dbea7a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt >@@ -474,7 +474,7 @@ > Contact your system administrator. > [% END # /IF warnConnectBroker %] > >- [% IF weasyprint_missing || warnPrefRequireChoosingExistingAuthority || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatronOPACPrivacy || warnPrefAnonymousPatronAnonSuggestions || warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist || warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist || warnPrefKohaAdminEmailAddress || warnPrefOpacHiddenItems || warnPrefPatronSelfRegistrationDefaultCategory || invalid_yesno.count || warnNoActiveCurrency || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || warnXSLT || oauth2_missing_deps || bad_yaml_prefs || warnIssuingRules || config_bcrypt_settings_no_set || warnHiddenBiblionumbers.size || warnFastCataloging || warnPassChangeNoticeMissing %] >+ [% IF weasyprint_missing || warnPrefRequireChoosingExistingAuthority || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatronOPACPrivacy || warnPrefAnonymousPatronAnonSuggestions || warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist || warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist || warnPrefKohaAdminEmailAddress || warnPrefOpacHiddenItems || warnPrefPatronSelfRegistrationDefaultCategory || invalid_yesno.count || warnNoActiveCurrency || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || warnXSLT || oauth2_missing_deps || bad_yaml_prefs || warnIssuingRules || config_bcrypt_settings_no_set || warnHiddenBiblionumbers.size || warnFastCataloging || warnPassChangeNoticeMissing || warnBadBcryptSettings %] > <h2>Warnings regarding the system configuration</h2> > <table> > <caption>Preferences and parameters</caption> >@@ -541,6 +541,11 @@ > ><td>System preference 'PatronSelfRegistration' is set, but 'PatronSelfRegistrationDefaultCategory' does not contain a valid patron category code. Patron self-registration is disabled.</td></tr > > > [% END %] >+ [% IF warnBadBcryptSettings %] >+ <tr >+ ><th scope="row"><strong>Warning</strong> </th><td>System preference 'Pseudonymization' is set, but bcrypt_settings entry in the configuration is not valid.</td></tr >+ > >+ [% END %] > [% IF warnXSLT %] > [% FOR p IN warnXSLT %] > <tr> >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 41359
:
190086
|
190134