Commit Graph

603 Commits

Author SHA1 Message Date
Chloé Zermatten e40291cb2c
Bug 10190: (QA follow-up): fix: missing rewrite rule in koha-httpd.conf
Looking at Bug 41167, this ought to fix the 404 error noted in comment 192 for package installs.

We do have a test asserting that RewriteRules must be carried over, so:

Test plan:
1. Apply patch
2. prove xt/check_apache_conf.t
3. Confirm it passes

That said, I don't think it is replicable in ktd - the copied file at /etc/koha/apache-shared-intranet.conf
will remain stale unless cp_debian_files.pl runs. The migration issue itself might be ktd-specific.

Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-10 14:25:26 +00:00
Pedro Amorim 6dab32ee02
Bug 37762: VueJS ILL Module
Signed-off-by: Jason Robb <jrobb@sekls.org>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-05-08 12:25:38 -06:00
Martin Renvoize 6f62a8fe30
Bug 41919: Limit number of current reports a single user can run simultaneously
Building on bug 41918, it would be good to limit the number of reports
a given user can run at a time. This control is config-file based as
it is tied to the server resources provided by the administrator.

Adds a new koha-conf.xml option total_running_reports_per_user_limit
(0 = disabled). When the configured limit is reached, the user is told
"You have too many reports running at the moment. Please wait for some
of them to finish before running this report again."

Note on implementation: the original patch on bz (attachment 198034)
performed a second pre-flight Koha::Reports->running call in
reports/guided_reports.pl. The bug 41918 QA follow-ups already pushed
the duplicate-running guard into Koha::Report::prep_report so it would
fire across the staff UI, svc/report and opac/svc/report. This patch
extends that same model-layer architecture rather than reintroducing
controller-layer enforcement:

- New Koha::Exceptions::Report::TotalRunning subclass of
  Koha::Exceptions::Report.
- prep_report now performs a second check after the duplicate one and
  throws TotalRunning when the user has total_running_reports_per_user_limit
  reports of any kind already in flight.
- All three callers (guided_reports.pl, svc/report, opac/svc/report)
  catch the new exception alongside DuplicateRunning, mapping it to a
  new template error key total_running_reports_limit_exceeded for the
  staff UI and a JSON {error: total_running_reports_limit_exceeded}
  with HTTP 429 for the JSON endpoints.

Test Plan:
1) Set total_running_reports_per_user_limit to 3 in your koha-conf.xml.
2) Create 3 long-running reports like:
   SELECT COUNT(*) FROM items i1 JOIN items i2 JOIN items i3 JOIN items i4 JOIN items i5 JOIN items i6
3) Run each report in turn by opening a new tab, browsing to the
   reports module, and choosing to run that report.
4) Note the first three continue to run, but a fourth attempt gives
   the new "too many reports running" alert in the staff UI.
5) Repeat against /cgi-bin/koha/svc/report?id=N and confirm an HTTP
   429 response with JSON {error: total_running_reports_limit_exceeded}.
6) Set total_running_reports_per_user_limit back to 0 and confirm
   normal behaviour resumes.
7) prove t/db_dependent/Koha/Reports.t -> 13 tests pass, including a
   new subtest for TotalRunning.

Signed-off-by: Alex Carver [Acerock7] <alex@rcls.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-05-07 07:56:21 -06:00
Kyle M Hall 9d0d9715e8
Bug 41918: Add ability to disable or change limit via config xml
This commit add the option duplicate_running_reports_per_user_limit to
koha-conf.xml. If this option is empty or 0, the feature is disabled. If
this option is enabled, Koha will limit the number of times a given
report can be run of a single Koha user.

Test Plan:
1) Apply this patch
2) Set duplicate_running_reports_per_user_limit to 1, verify previous
   behavior is maintained
2) Set duplicate_running_reports_per_user_limit to 0, verify the feature
   is disabled
3) Set duplicate_running_reports_per_user_limit to 2, verify Koha limits
   the number of duplicates of the report to the number specified in duplicate_running_reports_per_user_limit

Signed-off-by: Alex Carver [Acerock7] <alex@rcls.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-05-07 07:56:16 -06:00
Andreas Roussos 6fe0b70020
Bug 41795: (follow-up) add a phrase Zebra index for 'authtype'
As per https://software.indexdata.com/zebra/doc/querymodel-rpn.html#querymodel-bib1-completeness:
"[...] Complete field (3) triggers search and scan in index type="p"."

The UNIMARC Zebra index definitions for authorities *do* include
a 'p' (short for 'phrase') type index for authtype -- however, the
MARC21 Zebra index definitions don't and this is causing these two
tests to fail:

t/db_dependent/Biblio.t
t/db_dependent/FrameworkPlugin.t

This patch fixes that.

Test plan for KTD:

1) Apply the patch, then:

   k$ sudo cp etc/zebradb/marc_defs/marc21/authorities/authority-koha-indexdefs.xml /etc/koha/zebradb/marc_defs/marc21/authorities/
   k$ sudo cp etc/zebradb/marc_defs/marc21/authorities/authority-zebra-indexdefs.xsl /etc/koha/zebradb/marc_defs/marc21/authorities/
   k$ koha-rebuild-zebra --authorities --full --force --verbose kohadev

2) Run these tests -- they should both complete without warnings/errors:

   k$ prove -v t/db_dependent/Biblio.t
   k$ prove -v t/db_dependent/FrameworkPlugin.t

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-05-04 11:32:18 -06:00
Victor Grousset/tuxayo db1ab86bfe
Bug 39789: (QA follow-up) fix redundancy in koha-conf.xml
Some of the changes were already in the file.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-04-23 16:04:06 -06:00
Kyle M Hall 48783f4084
Bug 39789: Update koha-conf.xml
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-04-23 16:04:06 -06:00
Kyle M Hall 14b478bde7
Bug 39164: (QA follow-up) Add setting to koha conf files
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-04-15 14:10:33 -06:00
David Cook 9f78d81bf0
Bug 38365: Add warning that intranet/staff interface is not ready for "enabled" mode yet
Signed-off-by: Lari Taskula <lari.taskula@hypernova.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2026-03-16 11:57:32 +01:00
David Cook 87d0abc690
Bug 38365: Remove old default values from koha-conf* files
Signed-off-by: Lari Taskula <lari.taskula@hypernova.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2026-03-16 11:57:29 +01:00
David Cook da52fd9c6f
Bug 38365: Move default Content-Security-Policy value into Perl module
By defining a default policy in the Perl module, we can easily update
it over time. Using koha-conf.xml will just be for overrides, so people
can manage their own there.

Signed-off-by: Lari Taskula <lari.taskula@hypernova.fi>
Signed-off-by: David Cook <dcook@prosentient.com.au>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2026-03-16 11:57:25 +01:00
Lari Taskula b027a437c1
Bug 38365: Use report-to with Reporting-Endpoints
report-uri is deprecated, replaced by report-to and Reporting-Endpoints.

To test:
1. prove t/db_dependent/Koha/Middleware/ContentSecurityPolicy.t

Signed-off-by: David Cook <dcook@prosentient.com.au>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2026-03-16 11:57:18 +01:00
Lari Taskula a7b51e6701
Bug 38365: Add default log4perl configuration
This patch adds the default configuration to log4perl.conf.

Note we are passing a non-standard interface 'csp' to Koha::Logger. This is to
avoid log entries from propagating up to api-error.log.

To test:
1. prove t/db_dependent/api/v1/public/csp_reports.t

Signed-off-by: David Cook <dcook@prosentient.com.au>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2026-03-16 11:57:17 +01:00
Martin Renvoize 4971626204
Bug 38365: Add CSP violation reporting API endpoint
Add /api/v1/public/csp-reports endpoint to receive and log
Content-Security-Policy violation reports from browsers.

When CSP is configured with a report-uri directive pointing to this
endpoint, browsers will POST violation reports whenever a CSP rule
is violated. These reports are logged using Koha's logging system
for administrator review.

Features:
- Public endpoint (no authentication required, as browsers send
  these reports automatically)
- Logs violations at WARN level with key details (violated directive,
  blocked URI, document URI, source location)
- Logs full report at DEBUG level for detailed analysis
- Accepts both application/csp-report and application/json content types

Configuration example (in koha-conf.xml csp_header_value):
  ...; report-uri /api/v1/public/csp-reports

Log4perl configuration to capture CSP violations:
  log4perl.logger.api.csp = WARN, CSP
  log4perl.appender.CSP = Log::Log4perl::Appender::File
  log4perl.appender.CSP.filename = /var/log/koha/csp-violations.log
  log4perl.appender.CSP.layout = PatternLayout
  log4perl.appender.CSP.layout.ConversionPattern = [%d] %m%n

Also updates koha-conf.xml documentation with CSP configuration guidance.

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Lari Taskula <lari.taskula@hypernova.fi>
Signed-off-by: David Cook <dcook@prosentient.com.au>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2026-03-16 11:57:15 +01:00
David Cook 4301202a2d
Bug 38365: Add "style-src-attr 'unsafe-inline';" to default policy
This change adds "style-src-attr 'unsafe-inline';" to the default CSP policy.

The reason is that we have a lot of inline styles throughout Koha,
and it will take a long time to clean those up. Also, the WYSIWYG/TinyMCE
editor injects inline styles, so it might not be possible to forbid
unsafe inline styles in Koha.

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lari Taskula <lari.taskula@hypernova.fi>
Signed-off-by: David Cook <dcook@prosentient.com.au>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2026-03-16 11:57:11 +01:00
David Cook 7fcae0c823
Bug 38365: Remove unsafe CSP rules
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lari Taskula <lari.taskula@hypernova.fi>
Signed-off-by: David Cook <dcook@prosentient.com.au>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2026-03-16 11:57:07 +01:00
David Cook 65873238ce
Bug 38365: add nonce to style-src and add default csp to Debian koha-conf.xml template
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lari Taskula <lari.taskula@hypernova.fi>
Signed-off-by: David Cook <dcook@prosentient.com.au>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2026-03-16 11:57:07 +01:00
Lari Taskula 3dd4cdc3f5
Bug 38365: Add content_security_policy section to koha-conf.xml
To test:
1. xmllint --noout --nonet etc/koha-conf.xml; echo $?
2. Observe 0

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: David Cook <dcook@prosentient.com.au>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2026-03-16 11:57:06 +01:00
Marcel de Rooy 5b5e402c20
Bug 40993: (follow-up) Add changes to etc/koha-httpd.conf
Good to have a test :)

Test plan:
Run xt/check_apache_conf.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-13 10:12:21 -07:00
Tomás Cohen Arazi cee02bbf3b
Bug 41032: Fix Open Fifth missing in plugin repos config
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-26 10:40:25 -07:00
Pedro Amorim 987db4f5ce
Bug 37893: (QA follow-up): Add changes to etc/koha-httpd.conf
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-18 11:21:18 -07:00
Pedro Amorim dfd9e08b6b
Bug 37893: Add warning notes to obsolete xml file sections
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-18 11:21:06 -07:00
Marcel de Rooy 5c0fb862ba
Bug 41167: Add missing line to etx/koha-httpd.conf
Test plan:
Run xt/check_apache_conf.t again. Should pass now.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-17 15:15:53 -07:00
Vivek Kumar 47384fb03f
Bug 41167: Fix missing rewrite rules in koha-httpd.conf
This patch adds missing RewriteRules for ERM, Preservation and Acquisition modules in koha-httpd.conf to restore staff client functionality.

Test plan:
1. Apply patch
2. Restart Apache
3. Access acquisitions and ERM pages
4. Confirm functionality restored

Signed-off-by: Vivek Kumar <vivek.kumar@bestbookbuddies.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>

Bug 41167: (follow-up) Correct rewrite rules in koha-httpd.conf

This follow-up patch fixes issues from the initial patch for Bug 41167:
- Adds missing asterisks (*) in rewrite rule patterns
- Removes erroneous RewriteRules from the OPAC virtualhost
- Ensures all ERM, Preservation, and Acquisition rewrite rules are correctly placed under the intranet virtualhost

Test plan:
1. Apply patch
2. Restart Apache
3. Access ERM, Preservation, and Acquisitions modules
4. Confirm pages load correctly without 404 or routing errors

Signed-off-by: Vivek Kumar <vivek.kumar@bestbookbuddies.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-17 15:15:52 -07:00
Tomás Cohen Arazi 03aec74eb6
Bug 40890: Make batch_size configurable for koha-es-indexer
This patch adds a new configuration entry in `koha-conf.xml` for making
it possible to set a different `batch_size` for `koha-es-indexer`.

The current implementation has a default of *10* that can be overridden
using the CLI parameter `--batch_size N`.

Unfortunately, if you restart the server or the service without passing
the parameter, it will be set back to 10. This patch solves that by
adding a new config entry and making the script use it. The passed CLI
parameter will keep overridding the configured value.

To test:
1. Run:
   $ ktd --shell
  k$ koha-es-indexer --restart --batch_size 100 kohadev
  k$ ps -ef | grep elastic
=> SUCCESS: No errors. Notice '100' is passed to the called perl script
2. Run:
  k$ koha-es-indexer --restart kohadev
  k$ ps -ef | grep elastic
=> FAIL: Notice '10' is the new value
3. Apply this patch
4. Run:
  k$ reset_all
5. Repeat 1 and 2
=> SUCCESS: '100' is kept.
6. Try standalone `--start` too
7. Sign off :-D

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-07 10:54:17 -07:00
Tomas Cohen Arazi 1873d97c07
Bug 40163: Fix several http addresses in the code docs
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-23 16:21:29 -06:00
Tomás Cohen Arazi 18ff4d4933
Bug 40812: Move Theke sample plugin repo to GitHub
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-18 13:52:09 -06:00
Marcel de Rooy 0b0eb6bc14
Bug 39740: (QA follow-up) Rename test_system/TEST_SYSTEM
See comment30 and comment36.
Result of two sed's:
  git grep -l test_system | xargs sed -i -e "s/test_system/debug_mode/g"
  git grep -l TEST_SYSTEM | xargs sed -i -e "s/TEST_SYSTEM/DEBUG_MODE/g"

The next patch will take care of the debugger options in the plack and
z3950 responder scripts.

Test plan:
Read the patch. (Testing in next patch.)
git grep -i test_system

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-18 13:51:54 -06:00
Marcel de Rooy c0c99f63cd
Bug 39740: Adjust koha-conf.xml
Test plan:
Look at changes in this patch.
Note that we already tested these settings with former patches.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-18 13:51:53 -06:00
Jake Deery 3a6ac8c843
Bug 40304: Zebrasrv configs now work on ARM CPUs
This patch adds more module search paths to the zebra-biblios-dom.cfg and zebra-authorities-dom.cfg, so that a larger range of CPU architectures will work with Zebra search unit tests.

This will not change Debian package installs, but it will fix any git-based installs.

TO TEST (you'll need access to an ARM-based CPU, and, preferably, an x86-64 machine):
ON THE ARM-BASED MACHINE:
a)  start ktd, then ktd --shell
b)  in ktd, run: prove -v t/db_dependent/Search.t
c)  notice how the test now fails
APPLY PATCH
d)  rerun step b
e)  notice how the test now passes
ON THE X86-64-BASED MACHINE:
f)  run steps a-e
g)  notice how the test passes, both before and after applying the patch
SIGN OFF

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-07-18 11:09:55 -06:00
Marcel de Rooy 5493e212f6
Bug 39206: Modify koha-conf templates
Test plan:
Just read the patch.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-06-26 11:09:55 -06:00
Nick Clemens d8f6cf398c
Bug 39303: Add audience index to SRU
This patch adds a 'koha.audience' entry to the pqf properties for searching

To test:
1 - curl -XGET "http://localhost:2100/biblios?version=1.1&operation=searchRetrieve&query=ta=a&maximumRecords=60&recordSchema=marcxml"
2 - Unsupported index
3 - Apply patch
4 - cp etc/z3950/pqf.properties /etc/koha/sites/kohadev/z3950/pqf.properties
5 - sudo koha-z3950-responder --restart kohadev (or restart_all)
6 - Test a search:
    curl -XGET "http://localhost:2100/biblios?version=1.1&operation=searchRetrieve&query=koha.audience=a&maximumRecords=60&recordSchema=marcxml"
7 - Results!

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-25 08:47:14 +02:00
Marcel de Rooy cd4860fb59
Bug 36954: (follow-up) Return to the two logfiles pattern
Note that --errlog should refer to all output from the wrapper daemon
process only like respawning processes etc.
And that --output should refer to all output from the daemonized
client process (so in our case the SIP server).

Moving a few sip.log occurrences to sip-output in that regard.

Test plan:
Restart koha-sip.
Login to sip server.
Restart koha-sip.
Verify that you see Net::Server messages and traces from the login in the
-output log. The restarts are not found however in -error. See my comment
on the BZ report.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-18 10:55:27 +01:00
Martin Renvoize 0f3511eaec
Bug 22415: Add new log config for EDI
This patch adds the Log4perl configurations required to match the
existing prior use of Log4perl in EDI code.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-10 19:19:13 +01:00
Janusz Kaczmarek eab94d1213
Bug 36991: Add ability to scan call numbers index/search field
Some libraries ask for the ability to scan/browse the call numbers index.

Test plan:
==========
1. Have an installation with items with callnumbers (in ktd with standard
   test data set: add some callnumbers to the items).
2. Go to Advanced search > More options; choose Call number in the first
   drop list and mark Scan indexes.  Enter one of the call numbers you
   assigned to the items and perform the search.  You should get no
   results.
3. Apply the pach; restart all; when using ES:
   koha-elasticsearch --rebuild -r -d kohadev
4. Repeat p. 2.  You should get a list with at least one call number.
   The link should lead you to the record(s) with items with the selected
   call number.

This should work for ES and for Zebra, but for Zebra you would need to
replace /etc/koha/zebradb/ccl.properties with the repository version; and
you will get one token results on the list, like for other indexes.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-08 16:42:51 +01:00
Kyle M Hall 6a20ac7f99
Bug 37582: Add ability to for SIP to convert control and separator characters to spaces
This came up with a SIP vendor recently - when reading responses they were only getting part of a patron's information.
It seemed to have been caused by patrons with multiple restrictions and a new line in the response

This patch also does minor refactoring to write_msg to pass the server variable that contains
all the previously passed parameters, and removes the never used "file" parameter.

Test Plan:
1) Add multiple debarments to a patron
2) Run a sip patron information response, note the presence of newlines
3) Apply this patch
4) Add the new option convert_control_characters to your SIP account,
   set the value to " -- "
5) Restart all the things!
7) Run a sip patron information response, note the newlines have been replaced!

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-10-29 08:46:48 +01:00
Jonathan Druart 8e5774cdfe
Bug 31581: Remove zebra files for NORMARC
Those are leftovers, we should have removed them on bug 18984.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Magnus Enger <magnus@libriotech.no>
Looks good!
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-10-23 19:14:51 +02:00
David Cook 5ca20665a3
Bug 37087: Add TCP keepalive support to SIP server
This change adds the ability to enable and configure TCP keepalive
support for the SIP server using SIPconfig.xml.

For the sake of backwards compatibility, it defaults to disabled
and additional parameters default match typical kernel defaults.

Technical detail can be found in the perldoc for C4/SIP/SIPserver.pm

Test plan:
0. Apply the patch
1. koha-sip --restart kohadev
2. apt-get update && apt-get install tcpdump
3. In one window, run "tcpdump -A -n -v -i any 'port 6001'"
4. In another window, run the following:
echo -e "9300CNterm1|COterm1|CPCPL|\r" | nc 127.0.0.1 6001 -v
5. Note in tcpdump output that after the initial flood of packets,
nothing more is received

6. vi /etc/koha/sites/kohadev/SIPconfig.xml
7. In the "server-params" element, add attributes like the following:
custom_tcp_keepalive='1'
custom_tcp_keepalive_time='10'
custom_tcp_keepalive_intvl='5'
8. koha-sip --restart kohadev
9. In one window, run "tcpdump -A -n -v -i any 'port 6001'"
10. In another window, run the following:
echo -e "9300CNterm1|COterm1|CPCPL|\r" | nc 127.0.0.1 6001 -v
11. Note in tcpdump output that after the initial flood of packets,
ACK packets are sent out every 10+ seconds for the idle connection

Signed-off-by: Tadeusz „tadzik” Sośnierz <tadeusz@sosnierz.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-20 15:32:47 +02:00
Nick Clemens 3d385d0e11
Bug 29507: Speed up auto renew cronjob via parallel processing
The cron can take a very long time to run on systems with many issues.
For example, a partner with ~250k auto_renew issues is taking about 9 hours to run.

If we run that same number of issues in 5 parallel chunks
( splitting the number of issues as evenly as possible ), it could take under 2 hours.

Test Plan:
1) Generate a number of issues marked for auto_renew
2) Run the automatic_renewals.pl, use the `time` utility to track how much time it took to run
3) Set parallel_loops to 10 in auto_renew_cronjob section of config in koha-conf
4) Repeat step 2, note the improvement in speed
5) Experiment with other values

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-07-05 15:48:11 +02:00
David Cook ce90d65603
Bug 33563: Add comments for Elasticsearch security config
This patch adds some commented Elasticsearch security configuration,
which shows how to use username/password with HTTPS.

Test plan:
0. Apply patch
1. cp debian/templates/koha-conf-site.xml.in /etc/koha/koha-conf-site.xml.in
2. koha-create --create-db test
3. vi /etc/koha/sites/test/koha-conf.xml
4. Note that the comments for userinfo and use_https are in the koha-conf.xml

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Works as advertised.
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-06-27 11:49:58 +02:00
Marcel de Rooy fcd7e884bc
Bug 36948: (follow-up) Allow IPv[46] in port config
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2024-06-11 08:10:01 +01:00
Marcel de Rooy c0d76f707b
Bug 36948: (follow-up) Remove log_file param, adjust caller_depth
We keep OPEN when people still use log_file or setsid.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2024-06-11 08:09:55 +01:00
Tomas Cohen Arazi 11c69496bc
Bug 34041: (follow-up) escape double dashes to prevent issues
Having double dashes inside a commmented block is not valid XML. This
patch restores it, with an added message explaining it

To test:
1. Run:
   $ xmllint etc/z3950/config.xml
=> FAIL: You get:
etc/z3950/config.xml:5: parser error : Double hyphen within comment: <!--
  <config>
      <z3950_responder_options>
      <z3950_responder_options>--add-item-status k -t 5</z3950_responder_options
2. Apply this patch
3. Repeat 1
=> SUCCESS: All good!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-05-10 17:46:12 +02:00
Liz Rea 3878dbe999
Bug 34041: z3950 responder additional options not coming through properly
This patch adds the <config> node that the z3950 responder starter script is looking for in the z3950/config.xml to the example code.

To test:
 - verify that the <config> </config> is around the commented z3950_additional_options suggestion in the etc/z3950/config.xml file
 - copy the config stanza to the live file: /etc/koha/sites/kohadev/z3950/config.xml
 - restart_all
 - ps aux | grep z3950
 - confirm the script has restarted
 - confirm the options: --add-item-status k -t 5 have been passed through

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-05-10 17:46:12 +02:00
Martin Renvoize a6c62f5fd1
Bug 30897: (QA follow-up) Enable graceful restart by default
This patch enabled the restart by default.

After a poll at hackfest24 we opted to enable this by default and the RM
requested I add the patch to the bug so we don't forget ;)

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-11 16:53:43 +02:00
Martin Renvoize dfd72b2929
Bug 30897: Add option to disable automated restart
This patch adds the ability to disable the automated plack restart we
introduce with this patchset via configuration.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-11 16:53:42 +02:00
Phil Ringnalda c52af2cef0
Bug 36531: Serve text/javascript compressed, like application/javascript is
Koha serves static .js files as application/javascript (if /etc/mime.types
says to) and serves them compressed, but output_with_http_headers uses the
currently-correct text/javascript mimetype, and Koha doesn't compress that.

Test plan:
1. Set the preference EnableAdvancedCatalogingEditor to Enable.
2. Open the browser Web Developer Tools to the Network tab
3. Load Cataloging - Advanced editor
4. Click on the line for the framework?frameworkcode=&callback=define load
5. Note the content-type text/javascript, no Content-Encoding line, and
   the size of 1.9MB
6. Apply the patches from bug 36463 if they haven't been pushed, then this
   patch, and reset_all
7. Repeat steps 1-4, and note a Content-Encoding: gzip header and a
   Transferred size around 160KB

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-08 15:41:12 +02:00
Nick Clemens 69ad327379
Bug 36463: (follow-up) Adjust other occurence (intranet)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-08 15:41:11 +02:00
Nick Clemens bccf7764c0
Bug 36463: Compress application/json
This patch simply adds application/json to the mod_deflate configuration

To test:
1 - Open the netowrk tab in firefox
2 - Load http://localhost:8081/api/v1/libraries
3 - Not the transferred size, and note no 'Content-Encoding: gzip" header
4 - Apply patch, reset_all (or edit /etc/koha/apache-shared.conf)
5 - Reload
6 - Note smaller size, note gzip header

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-08 15:41:11 +02:00
Nick Clemens 1412f6c65b
Bug 35621: Map ÿ to y for searching (Non-ICU)
To test:
1 - Find or add a record with title: Chevilly-Larue, L'Haÿ-les-Roses, Fresnes, Rungis [par] Sté éditions et de publicité L.F.B.
2 - Search for 'L'Hay-les-Roses'
3 - No results
4 - Apply patch, copy the file:
    sudo cp /kohadevbox/koha/etc/zebradb/etc/word-phrase-utf.chr /etc/koha/zebradb/etc/word-phrase-utf.chr
5 - Restart all, Reindex
    restart_all
    sudo koha-rebuild-zebra -v -f kohadev
6 - Search again
7 - Success!

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-03-22 15:47:34 +01:00