Commit graph

697 commits

Author SHA1 Message Date
Agustin Moyano
7439579b8b Bug 23207: Add automatic checkin feature
This patch adds the posibility to set an itemtype with automatic
checkin. It means that when the checkout is due, it will
automatically check in.

To test:
1. apply patches
2. updatedatabase
3. go to koha administration -> item types and edin an item type (from
   now on called itemtype1)
CHECK => there is a checkbox almost at the end called automatic checkin
4. check that checkbox and save
5. checkout 2 items from itemtype1 and one item from another itemtype
   (from now on called itemtype2)
6. go to mysql database console (koha-mysql) and manually set date_due = current_timestamp
   in issues table for the item of itemtype2 and only one of the items of
itemtype1
7. run cronjob at misc/cronjobs/automatic_checkin.pl
8. go to mysql database console again and select * from issues
SUCCESS => All issues are present except for the issue of itemtype1
which had it's date_due set to current_timestamp. That one was
automatically checked in.
9. prove t/db_dependent/Koha/Checkouts.t

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Hasina Akhter <HasinaA@pascolibraries.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-04-22 11:11:05 +02:00
e07c9e9f06 Bug 14300: Add %P to SIP LogPattern
This patch adds `%P` to the SIP log4perl configuration so that PID is
recorded against log lines.

This allows transactions to be more easily tied together under one
SIPServer, thus making it easier to pick out a whole transaction from
start to finish.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-04-21 15:25:07 +02:00
65542edbe0 Bug 27839: (follow-up) Update docs for koha-worker
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-04-12 15:27:50 +02:00
90291914f9 Bug 27839: Add tab-completion in bash for koha-worker
This patch simply adds tab-completion for this script.

To test:
1. Apply this patch
2. Run:
   $ cp debian/koha-common.bash-completion  /etc/bash_completion.d/koha-common
3. Open a new bash instance
4. Type 'koha-worker <tab>'
=> SUCCESS: All options are there
5. Play with Koha instances
=> SUCCESS: they show up, once chosen they are not offered anymore
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-04-12 15:27:50 +02:00
2cd4c6011a Bug 25674: Remove default vhost
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-05 12:27:23 +01:00
476ab4758c Bug 25674: Add documentation
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-05 12:27:23 +01:00
ac5f628559 Bug 25674: Adapt koha-create
This patch adds the following option switches to koha-create:

--mb-host
--mb-port
--mb-user
--mb-pass
--mb-vhost

They are used to override the default values on instance creation.

To test:
1. Play with the several option switches and verify that the resulting
   koha-conf.xml contains the expected data.
=> SUCCESS: It works as expected
2. Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-05 12:27:23 +01:00
ce11b59ce1 Bug 25674: Add placeholders for RabbitMQ configuration
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-05 12:27:22 +01:00
8663f23a93 Bug 26742: Add configuration to koha-conf.xml for message broker
The connection details for the message broker should be configurable.
This patch adds configuration options to koha-conf.xml. If they
are not specified, then default connection details will be used.

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-05 12:27:22 +01:00
592ab10fe5 Bug 22824: Remove C4::Boolean, true_p, boolean_preference, etc.
It seems that we don't really need all this overhead.
YesNo must be a boolean and contain 1 or 0.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-04 16:18:42 +01:00
bf06f36fd0 Bug 26363: Remove tmp file during package build (follow-up)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-04 08:44:52 +01:00
782ae18779 Bug 26363: Change SyslogIdentifier to match koha-worker script style
This patch changes the SyslogIdentifier so that it matches
the style used by koha-worker.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-01 10:51:15 +01:00
6e21b86f66 Bug 26363: Provide a systemd unit file for koha-worker in package installs
While the packages already have a koha-zebra script that creates a service
using the 'daemon' utility, this unit file template provides an alternative.

Note that currently you'd have to start the service using the following:

```systemctl start koha-worker@NAME.service```

Where NAME is the name of your Koha instance.

The systemctl enable/start commands could be automated more with helper
scripts in debian/scripts, but this is a first step.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-01 10:51:15 +01:00
06a58fe56d Bug 20410: Remove OpacGroupResults and PazPar2
This feature is not used as far as we know and it's not known to work.
It's preferable to remove it.

Test plan:
Make sure the OpacGroupResults pref code is removed, as well as the
PazPar2 files and code.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-02-08 16:12:42 +01:00
9fdceaa3b5 Bug 26048: Use ErrorDocument middleware for Plack HTTP errors
This patch uses the ErrorDocument middleware to use Koha's
custom error pages instead of generic Plack error responses

Test plan:
0. Apply patch
1. vi /usr/sbin/koha-plack (and change "development" to "deployment")
2. vi ./opac/opac-main.pl
3. Add "die" to line 2
4. vi ./mainpage.pl
5. Add "die" to line 2
6. cp ./debian/templates/plack.psgi /etc/koha/sites/kohadev/plack.psgi
7. koha-plack --restart kohadev
8. Go to http://localhost:8080/cgi-bin/koha/opac-main.pl
9. See a beautiful OPAC 500 error instead of "Internal Server Error"
10. Go to http://localhost:8080/cgi-bin/koha/blah.pl
11. See a beautiful OPAC 404 error instead of "not found"
12. Go to http://localhost:8081/cgi-bin/koha/mainpage.pl
13. See a beautiful Staff interface 500 error instead of "Internal Server Error"
14. Go to http://localhost:8081/cgi-bin/koha/blah.pl
15. See a beautiful Staff interface 404 error instead of "not found"

For bonus points:
16. koha-plack --disable kohadev
17. koha-plack --stop kohadev
18. service apache restart
19. Repeat the above test plan to show CGI still works for 404 (although 500
will show "Software Error" due to C4::Context needing some improvements)
20. Using the "Network" tab on your developer tools, make sure 404 and 500
are returned by the appropriate error pages

Signed-off-by: Eden Bacani <eden.bacani@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-01-27 10:30:43 +01:00
1ce9e0160c Bug 25245: Add plugins_nightly.pl to the default cron
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-01-20 13:49:55 +01:00
Andreas Roussos
920d3efcdf Bug 17429: document the --plack/--noplack options of koha-list
The man page of koha-list does not list the --plack and --noplack
options.

This patch fixes that.

Test plan:

1) View the current man page for `koha-list` (with `man koha-list`)
   and notice how the --plack and --noplack options are missing.

2) Apply this patch.

3) Run the following command to re-generate the man page:

   xsltproc /usr/share/xml/docbook/stylesheet/docbook-xsl/manpages/docbook.xsl \
   debian/docs/koha-list.xml

   View the manual page again (with `man -l koha-list.8`), the
   two options are now displayed under SYNOPSIS and OPTIONS.

4) Make sure this test passes:
   prove -v xt/verify-debian-docbook.t

Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-01-19 16:03:34 +01:00
4253eb91a6 Bug 26947: Remove AUTO_INCREMENT
Sending a cake there
https://bugs.mysql.com/bug.php?id=20786

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-01-12 12:31:58 +01:00
af90c4018d Bug 26947: Correct path for chown and chmod
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-01-12 12:31:58 +01:00
d406d90164 Bug 26947: Add schema-only option to koha-dump
This patch adds a new --schema-only optoin to the koha-dump script.

This can be used to generate a new kohastructure.sql file during the release, and later to
compare the DB structure of a koha instance to the kohastructure.sql file shipped with a version
to identify any missing constraints or other db structure issues

To test:
1 - debian/scripts/koha-dump kohadev
2 - Confirm db and configs are dumped correctly
3 - Apply patch
4 - debian/scripts/koha-dump --help
5 - Confirm new option is listed and makes sense
6 - debian/scripts/koha-dump --schema-only kohadev
7 - Confirm only schema is dumped and is not zipped
8 - debian/scripts/koha-dump kohadev
9 - Confirm entire db is dumped as before

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-01-12 12:31:58 +01:00
Mirko Tietgen
6982680ae9 Bug 14564: Set permissions on configuration backups
This patch sets the group and group read permissions on
configuration backups, so that they can be downloaded
via the web staff interface.

Test plan:
0. Apply the patch
1. cp debian/scripts/koha-dump /usr/sbin/koha-dump
2. koha-run-backups --days 2 --output /var/spool/koha
3. Note *.tar.gz backups in /var/spool/koha/kohadev
now have root:kohadev-koha ownership and 640 permissions
4. vi /etc/koha/sites/kohadev/koha-conf.xml
5. Set backup_db_via_tools and backup_conf_via_tools to 1
6. echo 'flush_all' | nc -q 1 memcached 1121
7. koha-plack --restart kohadev
8. Go to http://localhost:8081/cgi-bin/koha/tools/export.pl
9. Click on "Export configuration"
10. Choose a file
11. Click Download configuration
12. Note that *.tar.gz file downloaded correctly

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

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-12-21 10:09:44 +01:00
fc1158389f Bug 16067: Remove FastMmap
It is known to be broken, we should remove its implementation

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-12-04 15:40:58 +01:00
8dc44290cf Bug 26672: Add 'experimental' info to koha-core and koha-full descriptions
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-11-27 13:24:12 +01:00
9dd3bbb5c8 Bug 26672: Add deps to koha-core, via debian/rules file
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-11-26 10:23:18 +01:00
802b843ac2 Bug 26672: Remove unrequired default-mysql-* references
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-11-25 16:35:15 +01:00
b11be998c7 Bug 26672: Add koha-core and koha-full definitions to debian/control files
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-11-25 16:18:03 +01:00
425cb6ec25 Bug 26672: Add additional koha-core and koha-full files to ./debian
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-11-25 16:18:03 +01:00
181125242c Bug 25548: Remove Apache rewrite directives that trigger redirects
Historically, we have used Apache rewrite directives to strip
query parameters with no arguments from the query
string (e.g. PARAM=&), and then redirect to the new URL.

However, this slows down user activity, and depending on your
HTTPS and proxy setup can cause suboptimal HTTP downgrades and
upgrades.

Test Plan:
0) Apply patch
1) Build Debian package
2) Install Debian package and reload Apache
3) Open developer tools on your favourite browser
4) Go to Network tab in developer tools
5) Go to /cgi-bin/koha/opac-main.pl
6) Search for "test"
7) Note a 200 status for "opac-search.pl?idx=&q=test"

If you got a 302 status for "opac-search.pl?idx=&q=test"
followed by a 200 status for "opac-search.pl?q=test", you
will know that your Apache configuration wasn't updated.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-11-20 14:23:52 +01:00
ea725f4724 Bug 25761: (QA follow-up) Consistent flag names
This follow-up updates the config flag to be consistent with bug 24449
and updates the debian template file to match too.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-11-16 13:45:07 +01:00
017036f695 Bug 24633: (follow-up) Tweak sample plugin targets
Sponsored-by: Theke Solutions
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-11-06 15:55:17 +01:00
c2293d5c60 Bug 21111: Add --exclude-indexes to koha-run-backups
This patch adds a trivial switch so koha-run-backups can pass the
--exclude-indexes option switch to koha-dump. This way if the sysadmin
doesn't want to backup the Zebra indexes, it can be controlled by
tweaking the cron definition.

To test:
1. Apply this patch
2. Run:
   $ debian/scripts/koha-run-backups --days 2 --output /var/spool/koha
3. Notice the size of the backups:
   $ ls -lh /var/spool/koha/kohadev
4. Try the new option switch:
   $ debian/scripts/koha-run-backups \
       --exclude-indexes \
       --days 2 --output /var/spool/koha
5. Repeat 3
=> SUCCESS: Backups are smaller!
6. Sign off :-D

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

JD amended patch: fix --exclude_indexes vs --exclude-indexes in koha-run-backups.xml

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-11-04 12:59:34 +01:00
9cbbd6b2ca Bug 26310: (QA follow-up) koha-conf-site.xml.in tweaks
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-11-04 12:59:33 +01:00
8dd8f3e5a3 Bug 26702: Remove explicit libnet-stomp-perl from debian/control.in
libnet-stomp-perl is added to debian/control via __AUTODEPENDS__,
so we don't need to add it manually into debian/control.in

Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-11-02 11:03:09 +01:00
1c46ebbb2e Bug 25898: Fix indirect object notation in debian/list-deps
There's a Parallel::ForkManager call in debian/list-deps that doesn't
follow the guidelines regarding indirect object notation.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2020-10-26 16:01:52 -03:00
564ade93cc Bug 8437: Exclude export.pl from plack
When attempting to download large files from Koha plack can timeout

Excluding the script from plack is a simple fix until we have a more permanent fix for this
issue.

To test:
1 - Try to export your entire DB from Tools->Export
2 - If big enough, it fails
3 - Apply patch, copy changes to /etc/koha/apache-shared-intranet-plack.conf
4 - Restart all the things
5 - Repeat export, it succeeds

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-10-26 00:04:18 +01:00
f8b80abbd0 Bug 25898: Fix new occurrences
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-10-15 13:56:41 +02:00
98b584d97f Bug 17084: Automatic debian/control updates (master)
built from c12ede4 on debian 9

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-10-14 15:53:11 +02:00
a20d3a01c7 Bug 20582: Turn Koha into a Mojolicious application
fix package builds, by ignoring the following example files...

  etc/koha/apache.conf
  etc/koha/nginx.conf

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-10-08 13:51:30 +02:00
33ab3c6900 Bug 26260: Add missing elastic>cnx_pool to koha-conf-site.xml.in
Added by bug 22705, but only in etc/koha-conf.xml

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-10-08 11:36:32 +02:00
aaec87c80c Bug 22417: Remove batch_record_modification from the non-plack list
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-10-05 17:21:26 +02:00
e5403747de Bug 22417: Add koha-worker to koha-common.install
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-10-05 16:20:51 +02:00
1338060713 Bug 22417: Update packaging files
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-10-05 15:30:02 +02:00
1a6c56f949 Bug 22417: Add debian script koha-worker
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-10-05 15:22:44 +02:00
ab2760e7e4 Bug 22343: Remove traces of libmail-sendmail-perl
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-10-05 11:20:30 +02:00
59c1151618 Bug 26290: Add option forsetting default SMTP parameters in koha-conf.xml
This patch adds an entry to koha-conf.xml for setting a default SMTP
server config. 'koha-create' gets option switches for all options.

To test:
1. Use the tweaked script to crete a new instance
2. Notice it contains entries for smtp_server and they respect your
   options.
3. If you don't choose any option, it sets the current default.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-10-02 15:27:18 +02:00
68ec27562f Bug 16357: Only use Log4perl middleware if appenders defined
This patch checks that the loggers used by the middleware
actually have appenders defined.

Without this patch, if the loggers don't have appenders
defined in the log4perl file, the logs will just be lost.

Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-09-28 16:09:10 +02:00
Joonas Kylmälä
5651facf05 Bug 16357: (QA follow-up) Add log4perl configs during package upgrade
If plack.psgi is updated to the newer version and the log4perl.conf file
is not then the warnings will not be logged anywhere. This adds the
log4perl configurations that are needed for logging for pre-existing Koha
installation which are upgraded.

Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-09-28 16:09:10 +02:00
Joonas Kylmälä
0bc0aa708c Bug 16357: (QA follow-up) Only initialize Log4perl module
Koha::Logger->get was setting up some extra variables
which are not used nor needed for the Plack::Middleware::Log4perl
middleware to work. According to documentation at
https://metacpan.org/pod/Plack::Middleware::Log4perl#SYNOPSIS
only running Log::Log4perl::init, enabling Log4Perl middleware and
setting up the logging category is enough. Koha::Logger->_init runs the
Log::Log4perl::init and enabling and setting category is handled
directly in plack.psgi.

Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-09-28 16:09:10 +02:00
ef021268bb Bug 16357: Use separate Log4Perl logger for each Plack app
This patch creates separate timestamped Log4Perl loggers
for each Plack app, so that the Intranet, OPAC, and API are logged
to separate files.

To Test:
0) apt-get install libplack-middleware-logwarn-perl
1) Apply "Alternative" patches
2) Copy PLACK block from etc/log4perl.conf to
/etc/koha/sites/kohadev/log4perl.conf and replace __LOG_DIR__ appropriately
3) Copy debian/templates/plack.psgi to /etc/koha/sites/kohadev/plack.psgi
4) Temporarily add 'warn "TEST"' to opac-main.pl and mainpage.pl
5) koha-plack --restart kohadev
6) Go to /cgi-bin/koha/mainpage.pl and /cgi-bin/koha/opac-main.pl
7) Open /var/log/koha/kohadev/plack-opac-error.log and
/var/log/koha/kohadev/plack-intranet-error.log
7) Observe a log line like the following:
[2020/06/22 03:51:23] [WARN] TEST at <SCRIPT and line #>.

Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-09-28 16:09:10 +02:00
57c62a612d Bug 16357: Override __WARN__ in Plack to use Log4Perl
This patch overrides __WARN__ in Plack to use Log4Perl to add
timestamps to error output. The Log4Perl config uses a screen
appender so the output still goes to STDERR so that it is still
managed by Starman.

This patch adds a Plack::Middleware::LogWarn package dependency.
(The dependency is very simplistic, so we could always do out own
 version if we would prefer to skip the external dependency.)

To Test:
0) apt-get install libplack-middleware-logwarn-perl
1) Apply patch
2) Copy PLACK block from etc/log4perl.conf to
/etc/koha/sites/kohadev/log4perl.conf
3) Copy debian/templates/plack.psgi to /etc/koha/sites/kohadev/plack.psgi
4) Create some output on STDERR (it might be necessary to add
a 'warn "TEST";' line to the intranet or OPAC)
5) koha-plack --restart kohadev
6) Open /var/log/koha/kohadev/plack-error.log
7) Observe a log line like the following:
[2020/06/22 03:51:23] [WARN] TEST at /kohadevbox/koha/opac/opac-user.pl line 59.

Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-09-28 16:09:10 +02:00