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>
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>
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>
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>
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>
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>
The "--commit" or "-c" parameter was incorrectly not used if it was
passed to the koha-elasticsearch program.
To test:
1) Before patch notice koha-elasticsearch --rebuild --commit 1 -v <instance>
only commits every 5000 records
2) Apply patch and notice the above command commits every 1 record
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch defaults the 'holds_block_checkin' configuration to disabled
(to maintain current behaviour on upgrades). It also updates a
copy/paste for siplog logging to make the message triggered by this
action unique as expected.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This takes care of more occurences of staff client and changes it to
staff interface, including in code comments.
To test:
- I think in this case careful code review is what we look for.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Currently, if a koha-plack is given multiple instances, it will create
duplicate $KOHA_HOME/installer and $KOHA_HOME/installer/lib entries
in PERL5LIB as these changes are done at the global rather than local level.
This issue can only be seen in non-dev Koha, since dev Koha installs
rewrite PERL5LIB.
This patch localizes PERL5LIB to each instance.
To test dev installs:
0. cp debian/scripts/koha-plack /usr/sbin/koha-plack
1. koha-plack --restart kohadev
2. Note that nothing breaks
To test non-dev installs:
0. Don't replace /usr/sbin/koha-plack yet
1. Create multiple non-dev installs with plack enabled and running
2. Set up one of these non-dev installs so you can use the web
UI (that is beyong the scope of this test plan)
3. koha-plack --restart test1 test2 test3
4. For test3, go to /cgi-bin/koha/about.pl
5. Note that there are duplicate /usr/share/koha/installer
and /usr/share/koha/lib/installer entries in PERL5LIB
6. cp debian/scripts/koha-plack /usr/sbin/koha-plack
7. koha-plack --restart test1 test2 test3
8. For test3, go to /cgi-bin/koha/about.pl
9. Note that there are no duplicates entries in PERL5LIB
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This raises the debug level a lot, it it a bit overwhelming, but may be useful in debugging indexing issues
To test:
1 - Apply patches
2 - sudo koha-indexer --stop instance
3 - sudo debian/scripts/koha-indexer --start --debug instance
4 - tail -f /var/log/koha/instance/indexer-output.log
5 - Note you get a listing that nothign in the queue
6 - Go to staff client and make a change to a record
7 - Note the logs have tons of info
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
to test... (on a i7-2600 vm with 8 cores)
1/ run script, note execution time
$ time ./debian/update-control
real 8m5.000s
2/ copy old file
$ cp ./debian/control control.old
3/ apply patch
4/ run updated script, note execution time is smaller
$ time ./debian/update-control
real 2m14.000s
5/ copy new file
$ cp ./debian/control control.new
6/ confirm old and new control files are identical
$ diff control.old control.new | wc -l
0
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
to test...
1/ attempt to install koha 20.05 package on deb11, fail :'(
2/ apply patch and build new koha package
3/ attempt to install new koha package on deb11, succeed!
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
After bug 25538, after a koha-shell we are not longer in the current directory:
root@cec7bffd8100:koha(master)$ pwd
/kohadevbox/koha
root@cec7bffd8100:koha(master)$ sudo koha-shell kohadev
kohadev-koha@cec7bffd8100:~$ pwd
/var/lib/koha/kohadev
Test plan:
Repeat the commands above and confirm that with this version of the
script you get /kohadevbox/koha inside the koha-shell
Search for possible regressions
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
We don't use the libjs-jquery package, so we should remove
the dependency.
To Test:
1) Build package (out of scope of test plan)
2) Install package
3) Note that libjs-jquery is marked by apt as no longer required
4) Remove libjs-jquery package from system and note how it
doesn't take koha-common with it
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
No longer used.
Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
By putting koha-shell in an if statement, "set -e" will no longer
cause the entire koha-foreach program to exit, if koha-shell
returns a non-zero status.
If a non-zero status is returned, we warn on it, and the caller
of koha-foreach can interpret that command visually.
To Test:
1) Write a shell script that says "Hello" and then exits with a 1
status
2) Run koha-foreach against that shell script with multiple instances
available to koha-foreach
3) Before the patch, koha-foreach will die after the first "Hello"
4) After the patch, koha-foreach will continue, through all the
instances, and report which instances returned non-zero statuses
by which command.
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>
Since bug 25172 we are failing loudly if the permissions are not correct
and that the logger cannot init successfully.
We must set the correct permission on upgrading.
koha-create deals with new installs
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
See man sudo, -i parameter.
Should we expect regressions?
Test plan:
0. Use D11 or U18.
Don't apply this patch
1.
$ echo $KOHA_INTRANET_URL
$ sudo koha-shell kohadev
$ echo $KOHA_INTRANET_URL
2. Apply this patch
$ cp debian/scripts/koha-shell /usr/sbin/koha-shell
3. Repeat 1.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch removes version-specific packages from the debian/control file,
which fixes a bug where koha-common can only be installed on the debian
version that the package was built on
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
root@koha-debian9:/# koha-z3950-responder --start d9
[....] Starting Z39.50/SRU daemon for d9:Can't open perl script "/usr/share/koha/bin/z3950_responder.pl/z3950_responder.pl": Not a directory
failed!
Test plan:
On a dev install, copy the debian script and run it
Same on a package install
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
root@koha-debian10:~# koha-translate --install es-ES
/bin/bash: /usr/share/koha/misc/bin/clear_cache.pl: No such file or directory
The script is in /usr/share/koha/bin/clear_cache.pl
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
As promised, I am commenting out the configuration for git repositories
to use for searches by default prior to release. To enable the feature,
simply uncomment the relevant github repositories or add your own.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
To prevent Apache to create intranet-error.log and opac-error.log with
root permission we chown them after it has been restarted (and so
created them) when a new Koha instance is created
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This patch removes the tiny_mce symlink before Koha package installation
using the same method that we used when we removed the YUI symlink
in 2015.
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This patch removes the removal of the following during the
build process:
/usr/share/koha/intranet/htdocs/intranet-tmpl/lib/tiny_mce
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
When installing the Debian package of Koha, we install the Debian tinymce package and symlink over our own tinymce libs that are in the Koha codebase. This version of tinymce does not have the same files and because of this, tinymce does not get loaded.
We should remove the use of the tinymce Debian package, and just use our own version of TinyMCE.
Test Plan:
1) Install Koha 19.11 from package
2) Browse to the news editor
4) Note the WYSIWYG editor is missing
5) Build a new Koha package with this patch applied, install it
6) Reload the news editor
7) Note the WYSIWYG editor is back!
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
The current grep expression uses -x|--line-regexp, but that causes
the regexp to fail to match since we're not specifying a regexp
that can match a whole line. We can either provide a better regexp,
or remove that --line-regexp option.
This patch removes the --line-regexp (ie -x) option from the grep
in log4perl_component, so that it detects logger components correctly.
To Test:
0) Apply patch
1) Build Koha package
2) Look at /etc/koha/sites/kohadev/log4perl.conf in an existing
Koha instance (e.g. on koha-testing-docker), and note it has
components for z3950, api, and sip
3) Install package
4) Note that /etc/koha/sites/kohadev/log4perl.conf is the same as before
5) Remove the "log4perl.logger.sip and log4perl.appender.SIP lines from
/etc/koha/sites/kohadev/log4perl.conf
6) Reinstall package
7) Note that the missing lines have been appended to the file at
/etc/koha/sites/kohadev/log4perl.conf
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Since D10, the behaviour of start-stop-daemon changed, see from its
manual:
"""
Warning: using this match option with a world-writable pidfile or using it alone with a daemon that writes the pidfile as an unprivileged (non-root) user will be refused with an error (since
version 1.19.3) as this is a security risk, because either any user can write to it, or if the daemon gets compromised, the contents of the pidfile cannot be trusted, and then a privileged
runner (such as an init script executed as root) would end up acting on any system process. Using /dev/null is exempt from these checks.
"""
Test plan:
koha-plack --restart kohadev
should success with this patch.
Without this patch you get:
start-stop-daemon: matching only on non-root pidfile /var/run/koha/kohadev/plack.pid is insecure
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This patch puts a space between the negation operator ! and
the function name (ie log4perl_component).
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 24735 removed etc/searchengine/queryparser.yml, which removed
the need for koha-common.install to install the following file:
debian/tmp/etc/koha/searchengine
This patch removes that line and causes the Koha packages to build
correctly again.
To test:
0) Apply patch
1) Build a Koha package using one of the following methods:
- https://wiki.koha-community.org/wiki/Building_Debian_Packages_-_The_Easy_Way
- https://hub.docker.com/r/koha/koha-dpkg
- https://gitlab.com/minusdavid/koha-deb-builder-docker
Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
When searching if some apache mod are enable we are hiding the error (2> /dev/null) and display an error about the (guessed) missing module.
It can lead to wrong tracks, let display the original apache error if there is one.
This is linked with https://gitlab.com/koha-community/koha-testing-docker/-/merge_requests/119
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
* We should not call Log::Log4perl directly
* Not sure it is correct as I get from (comment 77):
% koha-sip --restart
[2020/04/23 11:23:27] [ERROR] [undef]@[undef]: Argument "0.33_01" isn't
numeric in numeric lt (<) at /usr/share/perl5/Net/Server/Log/Sys/Syslog.pm
line 42.
C4::SIP::Trapper::PRINT /kohadevbox/koha/C4/SIP/Trapper.pm (24)
Why "ERROR" when it's a warning?
The [undef]@[undef] seems wrong here.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
It looks like RewriteLog will no longer work with Apache 2.4 and later.
RewriteLog
Those familiar with earlier versions of mod_rewrite will
no doubt be looking for the RewriteLog and RewriteLogLevel
directives. This functionality has been completely replaced
by the new per-module logging configuration mentioned above.
http://httpd.apache.org/docs/current/mod/mod_rewrite.html
All lines removed were commented out, so there should be
no change in behaviour or side effects.
To test.
- Verify every mention of RewriteLog has been removed from Koha
- Verify patch by reading it
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
According to the list of two-letter language codes found in ISO 639-1
(https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes), the correct
Zebra language option for Greek should be 'el', not 'gr'.
This patch fixes that.
Test plan:
0) Apply the patch.
1) Confirm that 'gr' has been changed to 'el' in all relevant files.
2) Create a new Koha instance using `koha-create --zebralang el testinst1`.
3) Edit /etc/koha/koha-sites.conf and set ZEBRA_LANGUAGE to 'el'. Then,
create another Koha instance with `koha-create testinst2`.
4) Confirm that both instances created in steps 2) and 3) have picked up
the Zebra CHR file from the /etc/koha/zebradb/lang_defs/el/ directory.
This is done by inspecting the value of 'profilePath' in these files:
/etc/koha/sites/testinst{1,2}/zebra-authorities-dom.cfg
/etc/koha/sites/testinst{1,2}/zebra-biblios-dom.cfg
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Same as previous test, but use the script to run the reindex
reset_all to update the scripts or use
misc4dev/cp_debian_files.pl
sudo koha-elasticsearch --rebuild -r -v
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
As a simple alternative to the solution in bug 9949 or just as an
additional measure, this patch adds a rewrite rule for intranet
in order to intercept potential misuse of perl scripts that could be
reached on a dev package install via the cgi-bin/koha scriptalias.
It simply rewrites them to the nonexistent "notfound", resulting in a
regular 404 error.
The rewrite rule does not harm regular installs and is just a little extra
step in securing a dev install. You should have more security measures in
place to secure your staff client.
QA Note: Although a rewrite rule may not be our first choice, this one
rule is more elegant and easier to maintain than e.g. a whole bunch of
aliases.
Note: This patch should have a regular and a dev install signoff.
Test plan:
[1] Make sure that this rewrite rule is inserted in your actual apache
config via /etc/koha/apache-shared-intranet.conf. Restart Apache.
[2] For regular package installs:
Try one of the URLs in step 3.
Verify that your staff client still operates as usual. Test a few
URLs inside some modules.
[3] For dev installs:
Try some URLs like below.
Expect 404 errors only, not 500s. If you do not see a 404, go back!
/misc/stage_file.pl
/t/db_dependent/default_search_class.pl
/installer/data/mysql/updatedatabase.pl
/Makefile.PL
[4] Do you see an additional directory to add to the regex? Please report.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
When languages are added or removed when need to flush the caches to
keep the interface consistent
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Aparently ((i++)) isn't portable, changed for an admittedly uglier
but functional increment.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Sometimes doing koha-sip --restart instance happens too fast and
the SIP server is not started.
To test:
- have SIP enabled and running for your instance
- issue a restart, make sure it restarts
sudo koha-sip --restart inst
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Now koha-common.postinst has a way to patch log4perl configs on
instances, we should patch the Z3950 responder config accordingly,
before it is backported to 19.11 or the 20.05 release :-D
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>
No more wide characters in print when logging to a file with Koha::Logger.
Test with this string
"♯Turpo :"
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>
This patch makes koha-common.postinst check if the log4perl.conf files
on the instances need tweaking. If they do, it appends the relevant
configuration text.
To test:
1. Install Koha 19.11 or earlier using the packages
2. Create an instance:
$ koha-create --create-db test1
$ koha-create --create-db test2
=> FAIL: /etc/koha/sites/test1/log4perl.conf doesn't include an entry for
z39.50
3. Apply this patch and run:
$ docker run \
--volume=/path/to/your/clone:/koha \
--volume=/dest/path/for/debs:/debs \
--privileged
--env VERSION=19.12.00.047 \
koha/koha-dpkg:master
Note: Paths need to be adjusted
4. Grab the .deb files and put them on the machine you're testing this
5. Edit /etc/koha/sites/test2/log4perl.conf and add the following text
at the bottom: log4perl.logger.z3950
6. Install the debs:
$ sudo dpkg -i koha-perldeps koha-deps koha-common
=> SUCCESS: Install process doesn't explode due to the addition
=> SUCCESS: /etc/koha/sites/test1/log4perl.conf has a new entry for log4perl.logger.z3950
=> SUCCESS: /etc/koha/sites/test2/log4perl.conf doesn't have a new entry for log4perl.logger.z3950
7. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
The line for enabling the unsafe expand_entities option is commented
and includes a warning to keep it like that ;)
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
It would be nice to be able to search and install plugins directly from GitHub ( and GitLab if possible ). This would make it easier to verify the authenticity of plugins and make discovering new plugins easier as well as making installation of plugins simpler.
Test Plan:
1) Apply this patch
2) Add the new block for plugin_repos to your koha-conf.xml
3) Restart all the things!
4) Browse to the plugins home page
5) Try searching for 'patrons' in the new search box
6) Verify you get results!
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Context: I am trying to make koha-misc4dev stop when something wrong happens.
Basically we do not want the process to continue of the DB has not been populated correctly.
It will make the errors easier to catch.
The issue: Say a script that will return an error (die in perl for an easy example),
koha-shell will not return the 255 error code, but 0 instead.
The caller cannot know something wrong happened
The solution is to propagate the error and make koha-shell return the same error code
as the command it executed
An example:
=== t.pl ===
die('something wrong');
% perl t.pl;echo $?
something wrong at t.pl line 1.
255
% sudo koha-shell kohadev -p -c 'perl xxx.pl' ; echo $?
something wrong at xxx.pl line 1.
0
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Tested it with
$ sudo debian/scripts/koha-shell kohadev -c 'exit 8'
$ echo $?
8
The unpatched version returns 0 (forgets about the error code).
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
At the last development meeting we have voted to remove the
QueryParser-related code
https://wiki.koha-community.org/wiki/Development_IRC_meeting_19_February_2020
Hea tells us that it has not been adopted, and the code/bug tracker that
it is not really usable as it. As nobody is willing to work on it, we
decided to remove it instead.
Test plan:
% prove t/db_dependent/Search.t
must return green
See commits from bug 9239 and confirm that the code is removed in this
patch.
Also play with the search on the UI and confirm that you do not see
obvious regressions
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 9978 should have fixed them all, but some were missing.
We want all the license statements part of Koha to be identical, and
using the GPLv3 statement.
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
cpanfile is a format for describing CPAN dependencies for Perl
applications.
It is more concise - thus easier to read and maintain - than
C4::Installer::PerlDependencies, and allows to describe requirements
more accurately (using version ranges or features for instance)
Additionally it can be read by tools such as cpanm or carton for an
easy way to install dependencies on non-Debian-based systems.
For more information on cpanfile, see
http://search.cpan.org/~miyagawa/Module-CPANfile-1.1002/lib/cpanfile.pod
This patch replace C4::Installer::PerlDependencies by an equivalent
cpanfile and update all scripts/modules that were using PerlDependencies
It also removes dead code from C4::Installer::PerlModules (some
subroutines were not used at all, except in unit tests)
Added dependencies:
- Module::CPANfile
- CPAN::Meta (dependency of Module::CPANfile, but we need a more recent
version than the one Module::CPANfile requires)
Test plan:
1. Go to About page, tab Perl modules and keep this browser tab open
2. Apply patch
3. Install Module::CPANfile and CPAN::Meta
a. On Debian-based systems:
# will install libcpan-meta-perl as a dependency
sudo apt install libmodule-cpanfile-perl
b. Others:
# will install CPAN::Meta as a dependency
sudo cpanm Module::CPANfile
4. In a new browser tab, go to About page, tab Perl modules and compare
the table with the one in the previous browser tab
They should be identical, except for newly added dependencies
(Module::CPANfile and CPAN::Meta)
5. Do a 'standard' install
a. perl Makefile.PL (select 'standard')
b. make
c. sudo make install
d. Configure your database, web server, ... and go through the web
install process
6. Verify that the cpanfile got copied into PERL_MODULE_DIR (which
should be /usr/share/koha/lib)
7. Go to the about page of this fresh install and compare it with your
dev install
8. Verify that debian/list-deps still works
This takes a lot of time and it may not be necessary to wait until
the end. If you see some Debian package names that correspond to
modules in cpanfile, it means it still works
(you need apt-file for this script to work)
9. Verify that koha_perl_deps.pl still works
10. prove t/Installer_pm.t t/Installer_PerlModules.t
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
To test:
- Enable sip for your testing instance
sudo koha-sip --enable inst
- Start sip for your testing instance
sudo koha-sip --start inst
- Verify it is running
ps ax |grep sip -> you should see processes
- Disable sip for your testing intance
sudo koha-sip --disable inst
- Verify that the following has happened:
* SIP is no longer running for your instance - no SIP processes
* SIP Cannot be started for the instance because it is not enabled.
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
The dependancy has now been packaged, this patch adds it to the debian
control file for package installs.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Trivial change. Speaks for itself.
Since koha/detail.pl does not exist, we cannot break things ;)
Test plan:
[1] Copy the change in apache-shared-intranet.conf to your actual
apache configuration. Probably in /etc/koha/.
[2] Restart Apache.
[3] Try a biblionumber say 123 on intranet with [your_staff_client]/bib/123.
Does the detail page come up?
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This patch adds the --elasticsearch-server option switch to koha-create.
It allows choosing a different Elasticsearch configuration. It defaults
to the current 'localhost:9200' value.
To test:
- Apply this patches
- Run:
$ reset_all
$ man koha-create
=> SUCCESS: The man page shows correct information about the added
option switch
- Run:
$ sudo koha-create --create-db test
=> SUCCESS: /etc/koha/sites/test/koha-conf.xml contains the default
value (i.e. the current behaviour is kept)
- Run:
$ sudo koha-create --create-db --elasticsearch-server tomas:1234 test2
=> SUCCESS: /etc/koha/sites/test2/koha-conf.xml contains the passed
value in the <elasticsearch><server> section.
- Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Missing entries are added to those files.
Test plan:
Search for typos
Compare the two files and comfirm the entries are the same in both.
Exception: supportdir exists in etc/koha-conf.xml only, but I think it's
obsolete.
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This patch makes the init script deal with koha-z3950-responder in --stop
and --restart actions. Currently, only --start calls the script.
To test:
- Enable the server:
$ koha-z3950-responder --enable kohadev
- Stop koha-common
$ service koha-common stop
=> SUCCESS: No koha-z3950-responder running
- Start koha-common
$ service koha-common start
=> SUCCESS: It is loaded (even if failing because of config issues)
- Stop koha-common
$ service koha-common stop
=> FAIL: It is still running (no --stop issued)
- Repeat for restart
- Apply this patch
- Redo
=> SUCCESS: Things behave as expected!
- Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Koha has a number of features that rely on knowing the IP address of the connecting client. If that server is behind a proxy these features do not work.
This patch adds a module to automatically convert the X-Forwarded-For header into the REMOTE_ADDR environment variable for both CGI and Plack processes.
TEST PLAN:
1) Apply this patch set
2) Install Plack::Middleware::RealIP via cpanm or your favorite utility
3) Update your plack.psgi with the changes you find in this patch set ( this process differs based on your testing environment )
4) Restart plack
5) Tail the plack error log for your instance
6) Use curl to access the OPAC, adding an X-Forwarded-For header: curl --header "X-Forwarded-For: 32.32.32.32" http://127.0.0.1:8080
7) Note the logs output this address if you are unproxied
8) If you are proxied, restart plack using a command like below, where the ip you see in the logs ("REAL IP) is what you put in the koha conf:
<koha_trusted_proxies>172.22.0.1 1.1.1.1</koha_trusted_proxies>
9) Restart all the things!
10) Repeat step 6
11) You should now see "REAL IP: 32.32.32.32" in the plack logs as the remote address in your plack-error.log logs!
12) Disable plack so you are running in cgi mode, repeat step 6 again
13) You should see "REAL IP: 32.32.32.32" as the remove address in your opac-error.log logs!
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Ed Veal <eveal@mckinneytexas.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Test plan:
Run koha-dump [yourdb]. Rename the files in var/spool/koha/[yourdb]
Run koha-dump --without-db-name [yourdb]
Run a diff between the unzipped sql files. The last dump should not
contain a CREATE DATABASE and USE statement. See BZ 15664 c4.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
To test:
- Run "sudo koha-plack restart kohadev" and verify the output is
out of line.
- Apply the patch
- If you are on e.g. kohadevbox you need to copy koha-plack to
/usr/sbin/ thus:
sudo cp debian/scripts/koha-plack /usr/sbin/koha-plack
- Run "sudo koha-plack restart kohadev" again and check that you
get two lines of output, nicely aligned with the "OK" inside the
square brackets.
Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
koha-zebra has a nice, informative --status switch, koha-indexer
does not. This patch adds it.
To test:
- Run "sudo koha-indexer --status kohadev" - you get an error:
"Error: invalid option switch (--status)"
- Apply this patch
- If you are on e.g. kohadevbox you need to copy koha-indexer to
where it is actually run from:
sudo cp debian/scripts/koha-indexer /usr/sbin/koha-indexer
- Run "sudo koha-indexer --status kohadev" again and you should
get a nice status telling if the indexer is running or not
- Toggle the indexer on and off with koha-indexer --start/--stop
and verify the status is telling the truth about the state of
the indexer
- Run "sudo koha-indexer --help" and check there is a description
of the --status option
- Have a look at debian/docs/koha-indexer.xml and verify there is
an adequate description of the --status option.
- Run "prove -v xt/verify-debian-docbook.t" to check the structure
of the man page in DocBook format.
PS: I tried to generate a manpage from the DocBook as described at
https://wiki.koha-community.org/wiki/Testing_man_pages
but the output did not look good for any of our DocBook files.
Not sure why.
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Missing installer for debian packages.
Sponsored-by: Koha-Suomi Oy
Signed-off-by: Johanna Raisa <johanna.raisa@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Trivial edit. The usage statement is wrong.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Before patch: -D and -d are mistaken for --debug
$ sudo DEB_BUILD_OPTIONS=nocheck ./debian/build-git-snapshot -r ~/debian -v 19.06~git --autoversion -d -D="stretch"
Option d does not take an argument
git status --porcelain -unormal
git rev-parse --short=8 HEAD
dch --force-distribution -D "squeeze-dev" -v "19.06~git+20190627205913.466f99e4-1" "Building git snapshot."
dch warning: Recognised distributions are:
experimental, unstable, testing, stable, oldstable, oldoldstable,
{bullseye,buster,stretch,jessie,wheezy}-proposed-updates,
{testing,stable,oldstable,oldoldstable}-proposed-updates,
{bullseye,buster,stretch,jessie,wheezy}-security,
{testing,stable,oldstable,oldoldstable}}-security, jessie-backports, stretch-backports and UNRELEASED.
Using your request anyway.
NOTE: squeeze-dev in the first dch line and warning about Option d.
Apply patch: -D and -d are differentiated correctly.
$ sudo DEB_BUILD_OPTIONS=nocheck ./debian/build-git-snapshot -r ~/debian -v 19.06~git --autoversion -d -D="stretch"
git status --porcelain -unormal
git rev-parse --short=8 HEAD
dch --force-distribution -D "stretch" -v "19.06~git+20190627210316.b3f919a7-1" "Building git snapshot."
dch warning: Previous package version was Debian native whilst new version is not
dch -r "Building git snapshot."
NOTE: No more 'Option d' error, and "stretch" in the first dch line.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Rather than try to use -y and symbols, since
older versions of pwgen don't have the -y,
Purposefully just shorten the generated
password to 15 characters and put @ on the end.
This avoids nasty shell globbing, fixes the
MySQL requiring a symbol by default in the
newer versions.
While @ at the end is less secure, the
password portion providing security is
still 15 characters long.
Before patch, password should have potentially
multiple ugly symbols in it.
After patch, when creating an instance, the
password will have an @ at the end of it.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
MySQL 5.7 is old, and the latest versions fail on "GRANT USAGE" if the
user does not exist. "DROP USER IF EXISTS" has been with us since 5.7,
so all users should have it by now. This patch fixes the issue.
To test:
Try to koha_remove a site, and if it works with no errors, all good!
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
TEST PLAN
---------
$ sudo mysql -u root
> CREATE USER 'bug23090_test1'@'localhost' IDENTIFIED BY 'badpassword';
[Magical MySQL Error]
> CREATE USER 'bug23090_test1'@'localhost' IDENTIFIED BY 'GoodP@ssw0rd';
[Should be okay]
> DROP USER 'bug23090_test1'@'localhost';
> QUIT
$ sudo koha-create --create-db fail23090
[Magical MySQL Error]
[Apply this patch and put it (debian/scripts/koha-create) into place in
/usr/sbin/koha-create]
$ sudo koha-create --create-db pass23090
(Clean up and databases made)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Like history.txt we need to tell some debian/ files to copy
teams.yaml
Also pick it for the `make install` process (Makefile.PL)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Like history.txt we need to tell some debian/ files to copy contributors.yaml
Also pick it for the `make install` process (Makefile.PL)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
TEST PLAN
---------
sudo koha-plack --disable
sudo koha-plack --disable
sudo koha-plack --enable
sudo koha-plack --disable
echo $?
sudo koha-plack --disable
echo $?
sudo koha-list --noplack
echo $?
sudo koha-plack --enable
echo $?
sudo koha-plack --enable
echo $?
sudo koha-list --plack
echo $?
git bz apply 20692
sudo perl ~/misc4dev/cp_debian_files.pl
then repeat the test.
It should also be noted, because the enable
and disable are now split, if for some reason
they become out of sync, an enable or disable
should correct them.
Because these are bash scripts, the test tool
(/home/vagrant/qa-test-tools/koha-qa.pl)
does not apply.
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This patch makes the set_password.pl script generate the password if it
is not passed as an argument.
It also changes the behaviour of set_password.pl: it will now print the
userid and password (generated or not) to mimick the behaviour from
koha-reset-passwd.
The koha-reset-passwd gets simplified as it doesn't generate the random
password anymore, it passes the responsability to set_password.pl
To test:
- Follow the steps from the original platch
- Verify all behaves as expected
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This patch makes koha-sip --start calls mention 'SIP server' instead of
the wrong 'Zebra daemon'.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This patch corrects a typo, and exports KOHA_CONF as other scripts do.
To test:
- Apply this patch
- Run:
$ # in kohadevbox
$ perl misc4dev/cp_debian_files.pl
- Try the new script
$ sudo koha-sip --start kohadev
=> SUCCESS: tail -f /var/log/koha/kohadev/sip* doesn't show fatal errors
anymore
- Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This patch removes traces from the (deprecated) koha-*-sip scripts.
To test:
- Apply the patch
- Verify no traces of koha-*-sip remain on the codebase (besides
Release Notes, koha-common.links and the koha-sip script):
$ cd kohaclone
$ git grep koha-start-sip
$ git grep koha-stop-sip
$ git grep koha-enable-sip
=> SUCCESS: No traces!
- Create the following symlinks:
$ sudo ln -s /usr/sbin/koha-sip /usr/sbin/koha-start-sip
$ sudo ln -s /usr/sbin/koha-sip /usr/sbin/koha-stop-sip
$ sudo ln -s /usr/sbin/koha-sip /usr/sbin/koha-enable-sip
- Try the koha-*-zebra commands:
$ sudo koha-stop-sip kohadev
$ sudo koha-start-sip kohadev
$ sudo koha-restart-sip kohadev
=> SUCCESS: They all work as expected!
- Sign off :-D!
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This patch makes all maintenance scripts use **koha-sip** instead of
the old **koha-*-sip** scripts.
To test:
- Run:
$ perl misc4dev/cp_debian_files.pl
$ sudo service koha-common stop
=> SUCCESS: No errors and the SIP-related sevices are stopped
$ sudo service koha-common start
=> SUCCESS: No errors and the SIP-related services are started
$ sudo service koha-common restart
=> SUCCESS: No erros and SIP-related services are running
$ sudo koha-create --create-db test
$ sudo koha-sip --enable test
$ sudo koha-sip --start test
$ sudo koha-disable test
=> SUCCESS: No errors, instance disabled, no SIP running for test
- Sign off :-D
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This patch adds the fancy tab completion in bash.
To test:
- Run:
$ source debian/koha-common.bash-completion
$ sudo koha-sip <tab>
- Play with all the options
=> SUCCESS: The combinations make sense (e.g. only SIP-enabled instances
are completed for --start, --stop, --restart, -v and --verbose are not
offered if the other one is already in there, --enable only applies to
SIP-disabled instances, etc).
- Sign off :-D
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This patch adds the manpage for koha-sip.
To test:
- Apply this patch
- Run:
$ kshell
k$ prove xt/verify-debian-docbook.t
=> SUCCESS: Tests pass!
- Run:
$ misc4dev/cp_debian_files.pl
$ man koha-sip
=> SUCCESS: The man page shows correctly.
- Sign off :-D
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This patch introduces a single script to handle all actions on SIP
servers for Koha instances. It is intended to be a replacement for:
- koha-start-sip
- koha-stop-sip
- koha-enable-sip
It adds a function called is_sip_running to koha-functions.sh.
To test:
- Apply this patch
- Run:
$ misc4dev/cp_debian_files.pl
$ sudo koha-sip --enable kohadev
$ sudo koha-sip --start kohadev
$ sudo koha-sip --status kohadev
=> SUCCESS: The SIP server is running for kohadev
- Run:
$ sudo koha-sip --restart --verbose kohadev
$ sudo koha-sip --status kohadev
=> SUCCESS: The SIP server is running for kohadev
- Run:
$ sudo koha-sip --stop kohadev
$ sudo koha-sip --status kohadev
=> SUCCESS: The SIP server is not running for kohadev
- Play with other combinations like enabling an already enabled
instance, etc. Remember you need to remove the
/etc/koha/sites/kohadev/SIPconfig.xml file so it is considered disabled.
- Sign off :-D
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
The default for Zebra is to not return results where the record size is
greater than 1045 KB ( 1 MB ). Some libraries need to increase this
ceiling, but it may come at a cost with z39.50 compatibility with other
services. For that reason, we should make this setting configurable on a
per-instance basis.
Test plan for kohadevbox:
1) Apply this patch
2) Run:
$ reset_all
3) Restart Zebra:
$ sudo koha-zebra --restart kohadev
4) Check how zebrasrv was called:
$ ps waux | grep zebrasrv
=> SUCCESS: Looks like
... /usr/bin/zebrasrv -v none,fatal,warn -k 1024
5) Edit /etc/koha/sites/kohadev/koha-conf.xml, add:
<zebra_max_record_size>2048</zebra_max_record_size>
6) Repeat (3) and (4)
=> SUCCESS: Looks like
... /usr/bin/zebrasrv -v none,fatal,warn -k 2048
7) Sign off :-D
General test plan:
1) Apply this patch
2) Build a Debian package
3) Specify a zebra_max_record_size of 2048 in your koha_conf.xml
4) Restart zebra
5) Index a record greater than 1 MB but smaller than 2 MB
6) Note that it is searchable!
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Hugo Agud <hagud@orex.es>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Includes:
* code factorization
Some code from subscription & Mana-KB has been factorized in order to speed-up next developments
* SytemPreferences:
Mana Activation:
- add a value "no, let me think about it", that is the default value.
- as long as this value is selected, messages ask if user want to activate it ( in Administration and Add-subscription(page 2) )
AutoShareWithMana
- Add the syspref AutoShareWithMana: user can automatically share infos with Mana-KB (not set by default)
* Interface :
- On mana-search, rows are now sorted by date of last import, then by number of users
- Windows redesigned to improve the user experience
* New Feature : report a mistake.
- people can now report an invalid data (wrong, obsolete,...)
- if a data is reported as invalid many time, it will appear differently
- Added few tooltip (to explain the fields last import, nb of users, to explain the new feature)
- When reporting a data as invalid, a comment can also be added. Koha will then display comments related to data in result lists
* API (svc/mana)
- add svc/mana/addvaluetofield: allows to ask mana incrementing a field of a resource
- no hardcoding for resources in the code of api (api needs to be called with a ressourcename)
* New feature : SQL report sharing
- Create Koha::Report.pm and Koha::Reports.pm, objects class for Reports
- New feature: share reports with Mana-KB
- New feature: search report in Mana-KB with keywords
- New feature: load reports from Mana-KB
Test plan:
1 - Apply Patch + update database
2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml (after <backupdir> for example)
<!-- URL of the mana KB server -->
<!-- alternative value http://mana-test.koha-community.org to query the test server -->
<mana_config>https://mana-kb.koha-community.org</mana_config>
3 - Check Mana syspref and AutoShareWithMana syspref are not activated
4 - Search the syspref ManaToken and follow the instructions
5 - subscriptions
- Try create a new subscription for a first serial => Mana-KB shouldn't show you anything (except if the base hase been filled)
- Share this serial with Mana-KB (on the serial individual's page there must be a Share button)
- Try to create a new subscription for serial nr1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear
- Activate AutoShareWithMana => Subscriptions
- Create a new subscription for a second serial
- There shouldn't be any Share button
- Create a second subscription => the message should appear, click again on use
6 - SQL Report
- Create a new SQL report, without notes.
- On the table with all report (reports > use saved), there should be the action "Share"
- If you click on share, you have an error message
- Create a new report, with a title and notes longer than 20 characters
- You can share it with mana => you will have a success message
- On (report > use saved), there must be a message inviting you to search on Mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list.
7 - Report mistakes.
- On any table containing Mana-KB search results, you can report a mistake and add a comment.
8 - For each previous test, try to send wrong data, to delete the security token, to send nothing: it should show a correct warning message.
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04)
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Since we now require the <branch> block, we should add it to the config
templates
Signed-off-by: Magnus Enger <magnus@libriotech.no>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
I added libwebservice-ils-perl 0.17 to the repository, so it
goes into debian/control too.
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andreas Roussos <arouss1980@gmail.com>
Works as intended. I've set USE_MEMCACHED to "no" and created a new
Koha instance. Home > About now reports this information: Memcached:
Servers: undefined | Namespace: undefined | Status: unknown | Config
read from: Nowhere [...] | Effective caching method: Cache::Memory
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
koha-create contains a call to `zcat` which fails if the file passed
as an argument is not in gzip format.
This patch fixes the issue by adding the -f flag to the zcat call in
koha-create, as per the top-voted answers in the following SE URLs:
https://unix.stackexchange.com/a/77309https://unix.stackexchange.com/a/131944
Test plan:
1) in /etc/koha/koha-sites.conf, set the DEFAULTSQL variable to point
to an _uncompressed_ SQL database dump
2) run `koha-create --create-db instance` and notice how it fails with:
gzip: /path/to/dump.sql: not in gzip format
3) apply the patch
4) notice the extra line of information "The SQL file can be optionally
compressed with gzip" in koha-sites.conf
5) run the `koha-create` command again, this time it should work
6) repeat with DEFAULTSQL pointing to a gzip'd dump, it should work too
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Having a 'user'@'%' line decreases database security.
Bug 16690 closes the need for such a line, and this
bug removes the use of it.
TEST PLAN
---------
While this depends on 16690, it is not required for testing.
On a kohadev box:
sudo koha-create --create-db test_17237_a
git bz apply 17237
sudo perl ~/misc4dev/cp_debian_files.pl
restart_all
sudo systemctl daemon-reload
sudo koha-create --create_db test_17237_b
sudo mysql -u root
SELECT user,host from mysql.user;
-- test_17237_a will have two entries, one being '%'
-- test_17237_b will only have one entry, not '%'
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
'gr' (as in 'Greek') is missing from the ZEBRA_LANGUAGE options
in debian/templates/koha-sites.conf. This patch fixes that.
Test plan:
1) view koha-sites.conf and notice how 'gr' is missing from the
ZEBRA_LANGUAGE options
2) apply the patch
3) observe that koha-sites.conf now includes 'gr' as an option
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This table was only used by XISBN, this patch remove the table and the
related code (cronjobs)
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
https://bugs.koha-community.org/show_bug.cgi?id=21235
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This patch makes the apache configuration for the reverse proxy
(required for Plack) so it sets the X-FORWARDED-PROTO header correctly
for Plack::Middleware::ReverseProxy to use it.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Ulrich Kleiber <ulrich.kleiber@bsz-bw.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Since we actually resolve 19799 now (Changing language on OPAC redirects
back to homepage), I will move that code to a new enh report.
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This is a result of Bug 21068: Remove NorwegianPatronDB related code
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Remove:
- BIB_INDEX_MODE and AUTH_INDEX_MODE env var
- bib_index_mode and auth_index_mode options from scripts
- Warnings from about page, just kept one if zebra_bib_index_mode or
zebra_auth_index_mode still exist in config and are set to grs1
Test plan:
- Install Koha from src
- Install Koha from pkg
- Read the code, carefully!
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Rebased
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
To test:
1 - Run koha-rebuild-zebra with multiple '-v'
2 - Note no increased verbosity
3 - Apply patch
4 - Run the updated koha-rebuild-zebra script with multiple '-v'
5 - Note increased verbosity
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
The Rewrite rules for Apache don't work unless you're using
debian/templates/apache-shared-opac-plack.conf or
debian/templates/apache-shared-intranet-plack.conf.
This patch fixes the Rewrite rules for the non-Plack Debian
Apache configuration templates as well as the standard
Apache configuration file that comes with Koha.
__BEFORE APPLYING__
1. Visit /api/v1/app.pl/api/v1/spec on your git dev install
2. This should display a large page of JSON
3. Visit /api/v1/spec on your git dev install
4. This should generate a 404 error
__APPLY PATCH__
__AFTER APPLYING__
5. Visit /api/v1/app.pl/api/v1/spec on your git dev install
6. This should display a large page of JSON
7. Visit /api/v1/spec on your git dev install
8. This should display a large page of JSON (identical to
the one from earlier steps)
Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Passed QA with few notes posted separately to Bugzilla.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
"""The default value is development, which causes plackup to
load the middleware components: AccessLog, StackTrace, and Lint unless
--no-default-middleware is set."""
Test plan:
Confirm that the stack trace is displayed when something is wrong (die somewhere to test)
for dev installations (inside a devbox)
The -E flag must remain deployment for non-dev installs
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This is a workaround meant to correct upgrading installs.
We force the order by disable/enable.
Test plan:
[1] When upgrading an existing install, check that the startup order
after the upgrade has been corrected in /etc/rcX.d (say X=5).
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Currently koha-common may start before memcached. We should prevent that.
If we add memcached to the LSB section of the koha-common init script,
Debian's insserv will know about this requirement.
Note: This patch is only a step in resolving the issue.
Test plan:
[1] Copy the updated koha-common script to /etc/init.d
[2] Look for S..koha-common and S..memcached in /etc/rcX.d (say X=5)
[3] Run sudo update-rc.d koha-common disable
[4] Run sudo update-rc.d koha-common enable
[5] Look again for S..koha-common in /etc/rcX.d (say X=5).
The number for koha-common should now be higher than for memcached.
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Improvements:
1) Index settings moved from code to etc/searchengine/elasticsearch/index_config.yaml. An alternative can be specified in koha-conf.xml.
2) Field settings moved from code to etc/searchengine/elasticsearch/field_config.yaml. An alternative can be specified in koha-conf.xml.
3) mappings.yaml has been moved from admin/searchengine/elasticsearch to etc/searchengine/elasticsearch. An alternative can be specified in koha-conf.xml.
4) Default settings have been improved to remove punctuation from phrases used for sorting etc.
5) State variables are used for storing configuration to avoid parsing it multiple times.
6) A possibility to reset the fields too has been added to the reset operation of mappings administration.
7) mappings.yaml has been moved from admin/searchengine/elasticsearch to etc/searchengine/elasticsearch.
8) An stdno field type has been added for standard identifiers.
To test:
1) Run tests in t/Koha/SearchEngine/Elasticsearch.t
2) Clear tables search_fields and search_marc_map
3) Go to admin/searchengine/elasticsearch/mappings.pl?op=reset&i_know_what_i_am_doing=1
4) Verify that admin/searchengine/elasticsearch/mappings.pl displays the mappings properly, including ISBN and other standard number fields.
5) Index some records using the -d parameter with misc/search_tools/rebuild_elastic_search.pl to recreate the index
6) Verify that you can find the records
7) Put <elasticsearch_index_mappings>non_existent</elasticsearch_index_mappings> to koha-conf.xml
8) Verify that admin/searchengine/elasticsearch/mappings.pl?op=reset&i_know_what_i_am_doing=1 fails because it can't find non_existent.
9) Copy etc/searchengine/elasticsearch/mappings.yaml to a new location and make elasticsearch_index_mappings setting in koha-conf.xml point to it.
10) Make a change in the new mappings.yaml.
11) Clear table search_fields (mappings reset doesn't do it yet, see bug 20248)
12) Go to admin/searchengine/elasticsearch/mappings.pl?op=reset&i_know_what_i_am_doing=1
13) Verify that the changes you made are now visible in the mappings UI
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 20073: Move Elasticsearch yaml files back to admin directory
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Bug 20187 has changed the JS and CSS rewrite rules to :
RewriteRule ^(.*)_[0-9][0-9]\.[0-9][0-9][0-9][0-9][0-9][0-9][0-9].js$ $1.js [L]
RewriteRule ^(.*)_[0-9][0-9]\.[0-9][0-9][0-9][0-9][0-9][0-9][0-9].css$ $1.css [L]
This patch changes this rules using [0-9]{N} and fusion in one rule.
And espaces the dot in extension js and css.
Test plan :
1) Go to intranet and opac
2) Check CSS and JS are doing well
3) Apply patch changes on our Apache configuration
4) Reload intranet and opac pages (Ctrl + F5)
5) Check CSS and JS are doing well
Signed-off-by: Charles Farmer <charles.farmer@inLibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Move memcached from suggested to depends for Debian packages.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
libhttp-oai-perl in Stretch is 4.03 and broken. Koha depends on
libhttp-oai-perl << 4 for that reason. To make the installation of Koha
on Stretch as easy as possible, this patch adds the alternative
libhttp-oai-3.27-perl which we provide in the Koha repository.
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This reverts commit f489d2034b.
This commit breaks the install process when using debian packages.
Reverting as we are very close to the 18.05.00 release
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Until HTTP::OAI is patched so it actually works, and bug 17704 fixes the API change Koha-side, we need to explicitly pull the right version. Otherwise people using Debian 9+ derived distros (Ubuntu 16.04+) are seeing production issues.
This implies packaging our custom libhttp-oai-perl distribution in the meantime.
This patch makes Koha require a version lower than 4.0.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Auto-generated file.
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Upload creates its own upload folder in the temp folder, so there is no
need to add another level in temporary_directory.
Removing the creation of this folder in koha-create-dirs too.
Also removing the use Koha::UploadedFiles in about.pl. No longer needed.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Line 463 lists valid parameters, but it was missing
upload-tmp-path: which resulted in the koha-create
saying it is an invalid parameter.
TEST PLAN
---------
1) apply all patches but this.
2) sudo perl ~/misc4dev/cp_debian_files.pl
3) restart_all
4) sudo koha-create --create-db --upload-tmp-path unique-path
awesome-test-name
-- Fails to run.
5) apply this patch
6) repeat 2-4
7) sudo vi /etc/koha/sites/awesome-test-name/koha-conf.xml
-- the upload_tmp_path entry should have unique-path
in it.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch adds an option to the koha-conf.xml file for specifying
a temporary uploaded files directory.
The koha-create script is adjusted to handle it and a convenient option
switch is added. If ommited, it will default to
/var/lib/koha/<instance>/uploads_tmp.
koha-create-dirs is patched to create the required directory with the
right permissions.
The docs get the new parameter documented.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch makes koha-zebra return 0 (or 1) even when verbose mode is
off. This made koha-zebra --start always return a failure even when the
daemon was correctly launched.
To test:
- Have Zebra running for kohadev instance on your KohaDevBox
- Run:
$ sudo koha-zebra --stop kohadev && echo yay || echo doh
=> FAIL: 'doh' is printed
- Run:
$ sudo koha-zebra --start kohadev e&& echo yay || echo doh
=> FAIL: 'doh' is printed as well
- Apply this patch
- Run:
$ sudo perl misc4dev/cp_debian_files.pl
$ sudo koha-zebra --stop kohadev && echo yay || echo doh
=> SUCCESS: 'yay' is printed
- Run:
$ sudo koha-zebra --start kohadev e&& echo yay || echo doh
=> SUCCESS: 'yay' is printed
- Sign off :-D
Sponsored-by: ByWater Solutions
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch adds a --timezone switch to koha-create so the timezone can
be set on creation time. It defaults to empty (i.e. using the server's
local time).
To test:
- Create an instance:
$ sudo koha-create --create-db timezone1
=> SUCCESS: /etc/koha/sites/timezone1/koha-conf.xml contains an empty
<timezone> entry.
- Apply this patch
- Run:
$ perl misc4dev/cp_debian_files.pl
- Create a new instance:
$ sudo koha-create --create-db timezone2
=> SUCCESS: /etc/koha/sites/timezone2/koha-conf.xml contains an empty
<timezone> entry (i.e. the current behaviour is preserved).
- Create a new instance:
$ sudo koha-create --create-db --timezone Your/Timezone timezone3
=> SUCCESS: /etc/koha/sites/timezone3/koha-conf.xml contains
<timezone>Your/Timezone</timezone> (i.e. introduced behaviour works)
- Sign off :-D
Sponsored-by: ByWater Solutions
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
- Removed merge marker
- Changed include path in favor of using the Asset tt plugin (bug 20538)
- Changed access_dir to a two-level entry for clarity
Test plans stay the same, just make sure that the two-level configuration entry
work properly and everything pass QA.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This squash contains all of these commits:
- Adds a page to access log files on the server from the intranet
- Update ID to allow for permalinking
- Rename config to "'accessdir' and fix qa
- Allows for multiple directories to be accessible
- Update the link under reports
- (Follow-up) Fixing merge error and cosmetic changes
- (Follow-up) Fix tab chars and move javascript to the footer
- (QA Follow-up) Fix datatable
- Make filename unicode-proof, renamed accessdir to access_dir and fix update
Test plans:
- Apply patch, update database
- Add to koha-conf:
<access_dir>/tmp/koha-public/one</access_dir>
<access_dir>/tmp/koha-public/two</access_dir>
<access_dir>/tmp/koha-public</access_dir>
- Create these directories ( mkdir /tmp/koha-public , etc...)
- Create these files:
echo "hello world!" > /tmp/koha-public/❤
echo "test" > /tmp/koha-public/one/samename.txt
echo "this is not the same" > /tmp/koha-public/two/samename.txt
- Login as Superadmin, go to tools > reports files
- Click on ❤, make sure it's downloadable and readable
- Click on both samename.txt, look inside and make sure the file is different
- Login as NON-superadmin. Go under tools, see no Report/Log under the third column
- Go to add tools/access_file permission to user
- See new entry under tools third column.
- validate link is ok.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Note that there is no way to create an install without memcached.
As it is now considered as stable, there is no point to not use it.
Test plan:
Create a new Koha install and make sure memcached is enabled by default
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Improvements:
1) Index settings moved from code to etc/searchengine/elasticsearch/index_config.yaml. An alternative can be specified in koha-conf.xml.
2) Field settings moved from code to etc/searchengine/elasticsearch/field_config.yaml. An alternative can be specified in koha-conf.xml.
3) mappings.yaml has been moved from admin/searchengine/elasticsearch to etc/searchengine/elasticsearch. An alternative can be specified in koha-conf.xml.
4) Default settings have been improved to remove punctuation from phrases used for sorting etc.
5) State variables are used for storing configuration to avoid parsing it multiple times.
6) A possibility to reset the fields too has been added to the reset operation of mappings administration.
7) mappings.yaml has been moved from admin/searchengine/elasticsearch to etc/searchengine/elasticsearch.
8) An stdno field type has been added for standard identifiers.
To test:
1) Run tests in t/Koha/SearchEngine/Elasticsearch.t
2) Clear tables search_fields and search_marc_map
3) Go to admin/searchengine/elasticsearch/mappings.pl?op=reset&i_know_what_i_am_doing=1
4) Verify that admin/searchengine/elasticsearch/mappings.pl displays the mappings properly, including ISBN and other standard number fields.
5) Index some records using the -d parameter with misc/search_tools/rebuild_elastic_search.pl to recreate the index
6) Verify that you can find the records
7) Put <elasticsearch_index_mappings>non_existent</elasticsearch_index_mappings> to koha-conf.xml
8) Verify that admin/searchengine/elasticsearch/mappings.pl?op=reset&i_know_what_i_am_doing=1 fails because it can't find non_existent.
9) Copy etc/searchengine/elasticsearch/mappings.yaml to a new location and make elasticsearch_index_mappings setting in koha-conf.xml point to it.
10) Make a change in the new mappings.yaml.
11) Clear table search_fields (mappings reset doesn't do it yet, see bug 20248)
12) Go to admin/searchengine/elasticsearch/mappings.pl?op=reset&i_know_what_i_am_doing=1
13) Verify that the changes you made are now visible in the mappings UI
Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch removes traces from the (deprecated) koha-*-zebra scripts.
To test:
- Apply the patch
- Verify no traces of koha-*-zebra remain on the codebase (besides
Release Notes and the koha-zebra script):
$ cd kohaclone
$ git grep koha-start-zebra
$ git grep koha-stop-zebra
$ git grep koha-restart-zebra
=> SUCCESS: No traces!
- Create the following symlinks:
$ sudo ln -s /usr/sbin/koha-zebra /usr/sbin/koha-start-zebra
$ sudo ln -s /usr/sbin/koha-zebra /usr/sbin/koha-stop-zebra
$ sudo ln -s /usr/sbin/koha-zebra /usr/sbin/koha-restart-zebra
- Try the koha-*-zebra commands:
$ sudo koha-stop-zebra kohadev
$ sudo koha-start-zebra kohadev
$ sudo koha-restart-zebra kohadev
=> SUCCESS: They all work as expected!
- Sign off :-D!
Sponsored-by: Orex Digital
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
The following output:
dh: Compatibility levels before 9 are deprecated (level 7 in use)
dh_testdir -O--fail-missing
dh_auto_clean -O--fail-missing
dh_auto_clean: Compatibility levels before 9 are deprecated (level 7 in use)
dh_clean -O--fail-missing
is given when trying to following these instructions:
https://wiki.koha-community.org/wiki/Building_Debian_Packages_-_The_Easy_Way
This merely tweaks the debian/compat file from 7 to 9.
The message goes away.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
From https://www.debian.org/doc/manuals/maint-guide/dother.en.html:
You may use compat level v9 in certain circumstances for compatibility with older systems. However, using any level below v9 is not recommended and should be avoided for new packages.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Followed test plan. Patch functions as described and both commands execute.
Signed-off-by: Dilan Johnpullé <dilan@calyx.net.au>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This attempts to handle issues arising when running
koha-create on a system that never had MySQL installed.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Trivial and hypothetical fix.
If you create /root/AA B (space in dirname), the quotes added here will
help you to get back where you came from.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This patch makes koha-plack jump into the instance's home directory to
run.
It is required because Perl 5.18 introduced a breaking change that
makes perl die if @INC includes directories for which the user doesn't
have read permission, and need to be traversed when querying for a lib.
This is the case of '.', which is introduced automatically into @INC
until Perl 5.26 (which removes the 'feature').
The Mojolicious::Plugins lib prefixes the plugin names with
'Mojolicious::Plugin' so it first looks (for example) for
Mojolicious::Plugin::Koha::REST::Plugin::Pagination (Pagination is just
the first one on the list). When it looks for it at '.' it dies (because
of Perl's behaviour) so it doesn't query for the right namespace (the
following to try).
I only reproduced it in koha-testing-docker. To test, you just need to
try this patched koha-plack and make sure it doesn't break due to this
permissions issue.
To test:
- In your koha-testing-docker clone, run:
$ docker-compose up -p test
- Open a shell inside the container (on a separate terminal):
$ docker exec -it test_koha_1 bash
- From within the /root directory, restart plack:
$ cd /root
$ koha-plack --restart kohadev
=> FAIL: Logs show plack is broken due to permissions problems trying to
find Mojolicious::Plugin::Koha::REST::Plugin::Pagination
- Use the patched script from this patch:
$ /kohadevbox/koha/debian/scripts/koha-plack --restart kohadev
=> SUCCESS: Plack runs fine, no error in the logs
- Sign off :-D
Note: people who has environments in which the problems is reproducible,
please test this version of koha-plack and stamp your sign-off,
PLEASE.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This test does obviously not achieve the desired result:
[ "chdir" != "no" ]
Trivial fix.
Adding the same quotes around starting_dir (just as for Bug 19546).
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
In order to patch production sites we need to adjust the shipped
cronjobs so they are called with the --chdir option switch.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Until Perl 5.26, the current directory is added to @INC when running a
Perl script [1]. Having the current directory in @INC means it can be
tried to be traversed when performing a lib lookup. Since version 5.18,
Perl dies when it finds an unreadable directory (permissions) in @INC
that needs to be traversed. This behaviour won't change because Perl
devs consider it an enhancement to security. [2]
Because of this, we need to make sure our scripts are ran **from** a
directory in which they have read permissions.
Ths patch adds a --chdir option switch to the **koha-foreach** wrapper
script, that makes the inner shells/scripts to be ran within the Koha
instance's user home directory.
The change is trivial and should be QAed easily. I tested this on a prod
server:
- Create a /tmp/test.pl file containing:
use Modern::Perl;
use Cwd;
my $dir = getcwd;
warn $dir;
1;
A) then create a cronjob entry to run it using koha-foreach:
(in /etc/cron.d/test):
1/* * * * * root koha-foreach perl /tmp/test.pl
- Once I noticed the cronjob ran, I used mutt to read the emails in the
root user.
=> FAIL:
...
Subject: Cron <root@koha> koha-foreach --enabled perl /tmp/test.pl
"/root"
"/root"
"/root"
"/root"
"/root"
...
B) I then used the patched koha-foreach with different results:
=> SUCCESS:
...
Subject: Cron <root@koha> /root/koha-foreach --chdir --enabled perl /tmp/test.pl
"/var/lib/koha/acaderc"
"/var/lib/koha/agro"
"/var/lib/koha/anc"
"/var/lib/koha/arico"
"/var/lib/koha/artes"
...
So this patch's approach works. But...
C) master's koha-foreach seems to work just the same... I think it is
because of my previous attempt to fix this by using sudo in koha-shell.
So I think environmental conditions affect the behaviour (which shell is
configured for cron, sudo configuration, etc).
====
In conclusion, I think we should go ahead with this patch as it will solve
peoples issues, and it is a right solution (option #5 on the list) to
this Perl behaviour change. It doesn't cover other commands, but
followup patches could do.
I avoided /tmp as it is writable by any user... so it is an easy path
for both exploiting by replacing some lib, and also because the
existence of an unreadable dir that the interpreter could try to
traverse (unreadable /tmp/Authen or /tmp/Koha will trigger the same
error, and I assume people know what they are putting on the instance's
dir, at least it will be easier to track).
A followup patch takes care of making the cronjobs use --chdir when
calling koha-foreach
[1] https://lists.debian.org/debian-devel-announce/2016/08/msg00013.html
[2] https://rt.perl.org/Public/Bug/Display.html?id=123795
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This patch makes logrotate use the **copytruncate** directive, removing
the need to stop the Zebra and Plack servers on log rotation.
To test:
- Run:
$ misc4dev/cp_debian_files.pl
- Edit the new /etc/logrotate.d/koha-common file changing 'weekly' for
'hourly'. This is to ease testing.
- Run:
$ sudo ls -l /var/log/koha/kohadev
- Open a second terminal on your kohadevbox. On it...
- Run:
$ sudo logrotate /etc/logrotate.d/koha-common
- Run:
$ sudo ls -l /var/log/koha/kohadev
=> SUCCESS: Files got rotated! (i.e. files ending in .1 are created, the
sizes make sense (.1 have contents, the ones without numbering
probably zeroed <- it will depend on what's happening with
your devbox in between).
- Play with your Koha, do some searches too:
=> SUCCESS: You have access to your Koha, searches work. i.e.:
- Apache handled the log rotation operation
- Plack handled the log rotation operation
- Zebra handled the log rotation operation
- Sign off :-D!
Sponsored-by: Orex Digital
Signed-off-by: Hugo Agud hagud@orex.es
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
The service description is very old and outdated. This patch fixes this.
Sponsored-by: Orex Digital
Signed-off-by: Hugo Agud hagud@orex.es
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch makes all maintenance scripts use **koha-zebra** instead of
the old **koha-*-zebra** scripts.
To test:
- Run:
$ perl misc4dev/cp_debian_files.pl
$ sudo service koha-common stop
=> SUCCESS: No errors and the Zebra-related sevices are stopped
$ sudo service koha-common start
=> SUCCESS: No errors and the Zebra-related services are started
$ sudo service koha-common restart
=> SUCCESS: No erros and Zebra-related services are running
$ sudo koha-create --create-db test
=> SUCCESS: Instance created and zebra running for it
$ sudo koha-disable test
=> SUCCESS: No errors and Zebra is stopped for instance test
$ sudo koha-zebra --start test
$ sudo koha-remove test
=> SUCCESS: No errors, instance removed, no Zebra running for test
- Sign off :-D
Sponsored-by: Orex Digital
Signed-off-by: Hugo Agud hagud@orex.es
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
update debian/control. this file is auto generated. no testing required.
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch makes the koha-* scripts follow symbolic links when querying for
Koha instances. Without it, it is not possible to define instances outside the
/etc/koha/sites directory,
To test:
- Create a symlink in /etc/koha/sites:
$ sudo ln -s /tmp /etc/koha/sites/test
- Test the original is_instance function:
$ . /usr/share/koha/bin/koha-functions.sh
$ is_instance test && echo success || echo failure
=> FAIL: symlinks are not considered instance names (i.e. failure is printed)
- Apply this patch
- Update the koha-functions.sh file:
$ perl misc4dev/cp_debian_files.pl
- Test is_instance again:
$ . /usr/share/koha/bin/koha-functions.sh
$ is_instance test && echo success || echo failure
=> SUCCESS: symlinks are considered instance names (i.e. success is printed)
- Sign off :-D
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
The flags [N,L] make no sense: next and last combined.
Choosing here for L to stop the rewriting process.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Victor Grousset <victor.grousset@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Koha has the ability to include custom css in the apache configuration.
If a library has any custom css ( or adds a custom js file in some way ),
and that file has an underscore in it ( e.g. my_custom.css ), the
apache rewrite rule will convert it to my.css and thus it will 404.
We should make the rewrite rules as specific as possible for the
format we are using.
Test Plan:
1) Set OPAC_CSS_OVERRIDE to a file with an underscore in it
2) Note it does not work
3) Apply this patch
4) Update the apache rewrite rules to match those in the patch
For kohadevbox, just run /home/vagrant/misc4dev/cp_debian_files.pl
5) Restart apache
6) Reload the page, your custom css should load now!
Signed-off-by: Victor Grousset <victor.grousset@biblibre.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Test Plan:
Test Plan:
Check the following files have been updated from
use strict;
use warnings;
to
use Modern::Perl;
services/itemrecorddisplay.pl
suggestion/suggestion.pl
tags/list.pl
tags/review.pl
virtualshelves/sendshelf.pl
help.pl
changelanguage.pl
koha_perl_deps.pl
debian/bd-to-depends
debian/build-git-snapshot
debian/list-deps
docs/CAS/CASProxy/examples/koha_webservice.pl
docs/CAS/CASProxy/examples/proxy_cas.pl
docs/CAS/CASProxy/examples/proxy_cas_callback.pl
docs/CAS/CASProxy/examples/proxy_cas_data.pl
Signed-off-by: Jon Knight <J.P.Knight@lboro.ac.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
With bug 18696 we need a few tiny changes to build-git-snapshot:
- Debian revision number for debian/changelog
- "orig" in the file name for the tar.gz archive
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
CAVEAT: This patch is only about allowing koha-plack to start a debugging
session on a remote target. Configuring all the needed pieces to make it
work is out of the scope of the bug. Testing should be focused (mainly) on
making sure this introduces NO REGRESSIONS on regular use (i.e. not debugging).
This patch adds the following option switches to koha-plack:
--debugger
----------
Toggle debugging
--debugger-key
--------------
Some IDEs require a key, this needs to match because they are picky about it
--debugger-location
-------------------
This option switch is used to specify the host:port your IDE is listening at.
Inside kohadevbox (using Vdebug with Vim) this would be localhost:9000. Outside
kohadevbox it would be 192.168.50.1:9000
--debugger-path
---------------
This is the path in which you installed the Komodo Remote Debugger library [1]. In kohadevbox
you could put the contents of the downloaded .tar.gz in /home/vagrant/dbgp/perllib. That
perllib seems to be required for things to work [2].
You can test with a simple CLI script things work:
PERL5LIB=/home/vagrant/dbgp/perllib:$PERL5LIB \
PERLDB="BEGIN { require q(/home/vagrant/dbgp/perllib/perl5db.pl) }" \
PERLDB_OPTS="RemotePort=192.168.50.1:9000" perl -d t/Prices.t
If you see action on your IDE, you are on the right track on the IDE side.
To test:
- Apply this patch
- Enable remote debugging on your IDE, on port 9000 (or adjust the command
below to match your IDE's listening port).
- Download the Komodo Remote Debugger package, and place the package's contents
in /home/vagrant/dbgp/perllib (you should see perl5db.pl in there).
- Run:
$ sudo koha-plack --stop kohadev
$ sudo kohaclone/debian/koha-plack --start \
--debugger \
--debugger-path /home/vagrant/dbgp/perllib \
--debugger-location 192.168.50.1:9000 \
kohadev
=> SUCCESS: You IDE/tool gets a connection from the Plack process.
- Sign off :-D
The explanation on how to use it assumes you are running kohadevbox.
WARNING: The main difficulty I found was setting the right dir/file mappings.
[1] http://code.activestate.com/komodo/remotedebugging/
[2] https://github.com/Komodo/KomodoEdit/issues/644#issuecomment-236268012
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
debian/source/format uses 'native'. As Koha is not native Debian software,
and to allow Debian revision numbers like -2 in 16.05.13-2, it should be
changed to 'quilt'.
This is only relevant to packaging and does not affect Koha itself.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
RM note: I forgot this patch (no idea what happened!)
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch makes koha-create (and friends) handle the template_cache_dir
config entry correctly.
It does so by:
- Adding a replaceable string to the template for koha-conf.xml
- Making koha-create-dirs create the needed directories (i.e.
/var/cache/koha/instance and /var/cache/koha/instance/templates)
- Adding a --template-cache-dir switch to koha-create (so sysadmins can
specify their favourite directory for the templates cache).
- koha-remove now takes care of the instance's *templates* dir.
- The install scripts now automatically create /var/cache/koha so it can
be used later by koha-create and friends. It does so the same way it does
for other install-created directories.
To test, you should ideally be able to build your own packages. This
instructions can be followed by people that doesn't have that ability
yet. But can be used on a custom packages setup too.
To test:
- Make sure you have the latest misc4dev in your kohadevbox (if it is a
fresh box you have it already)
- Run:
$ sudo perl misc4dev/cp_debian_files.pl
- Manually create the /var/cache/koha dir (skip if you have your own
packages):
$ sudo mkdir /var/cache/koha
- Create a new instance:
$ sudo koha-create --create-db cachetest
=> SUCCESS:
* /etc/koha/sites/cachetest/koha-conf.xml contains
template_cache_dir and is populated with /var/cache/koha/cachetest/templates
* The directory /var/cache/koha/cachetest/templates exists!
- Create a new instance, pass your own cache dir:
$ sudo koha-create --create-db --template-cache-dir /tmp cachetest2
=> SUCCESS: etc/koha/sites/cachetest2/koha-conf.xml contains template_cache_dir
and is populated with /tmp
- Run:
$ man koha-create
=> SUCCESS: The docs mention the --template-cache-dir option switch
correctly.
- Sign off :-D!
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Following the instructions at:
https://wiki.koha-community.org/wiki/Building_Debian_Packages_-_The_Easy_Way
Receiving the following message in the build:
dpkg-source: warning: relation < is deprecated: use << or <=
This patch tweaks the list-deps.
git diff origin/master -- debian/list-deps shows just the one line
changed from < to << as per the messages suggestion and eythian's
suggestion on IRC:
http://irc.koha-community.org/koha/2017-07-06#i_1950698
The control file can be regenerated from the command-line:
./debian/update-control
However, it will be attached separately.
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Magnus Enger <magnus@libriotech.no>
Original sign off message:
It's impossible to give a test plan for this...
I have implemented a "plugin" for Norwegian ILL (based on NCIP):
https://github.com/Libriotech/koha-illbackend-nncipp
Several issues have been discovered while writing the plugin, and
Alex has fixed them along the way. Currently I do not know about
any funcional issues, and I am happy to sign off.
Update:
I have applied the new patchset and done some exploratory testing,
using the Dummy backend. Everything seems to be fine after the
patches were re-arranged and with the followups from Tomas.
All tests pass.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch adds a new command to be used for Elasticsearch-related
tasks.
The current implementation only offers the --rebuild action switch,
that allows reindexing Elasticsearch on a per-instance basis as we are
used to with the rest of the koha-* commands.
Other options could be added in a future: --status (ES server status
report, etc).
To test:
- Apply the whole patchset
- Have a suitable Koha+Elasticsearch setup [1]
- Run:
$ reset_all
- Run:
$ man koha-elasticsearch
=> SUCCESS: A pretty man page is displayed covering all options
- Run:
$ sudo koha-elasticsearch blah
=> SUCCESS: The script fails because blah is not a valid instance name
- Run:
$ sudo koha-elasticsearch -v kohadev
=> SUCCESS: Reindex happens!
- Try the -a, -b and -c option switches
- Sign off happily :-D
Sponsored-by: ByWater Solutions
[1] This is straightforward if you are using KohaDevBox and created the
box using: $ KOHA_ELASTICSEARCH=1 vagrant up
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This follow up should make it work. Perhaps there is a more
elegant way, but wanted to generate something that works.
Before this patch, the --restart stops Zebra, but does not
restart it. After, it does restart.
Before this patch, the --status gives nasty long help.
After this patch, reasonable output.
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch adds tab-completion for bash, for the koha-zebra script.
To test:
- Run (on the vagrant user):
$ source kohaclone/debian/koha-common.bash-completion
- Run:
$ sudo koha-zebra -<TAB>
(<TAB> means press the tab key)
=> SUCCESS: Tab completion works as expected for the koha-zebra command.
- Sign off :-D
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch adds the new koha-zebra script the ability to handle being
called by other script names, for backwards compatibility with the legacy
koha-*-zebra scripts.
It is intended to be used in conjunction with a patch that replaces the old
koha-*-zebra scripts for symbolic links, pointing to the new koha-zebra script.
To test:
- Apply this patch
- Create symbolic links to the new script:
vagrant@kohadevbox:~$ ln -s kohaclone/debian/scripts/koha-zebra koha-start-zebra
vagrant@kohadevbox:~$ ln -s kohaclone/debian/scripts/koha-zebra koha-stop-zebra
vagrant@kohadevbox:~$ ln -s kohaclone/debian/scripts/koha-zebra koha-restart-zebra
- Run:
$ sudo ./koha-start-zebra kohadev
=> SUCCESS: Same behaviour than the koha-start-zebra script
- Run:
sudo ./koha-stop-zebra kohadev
=> SUCCESS: Same behaviour than the koha-stop-zebra script
- Run:
sudo ./koha-restart-zebra kohadev
=> SUCCESS: Same behaviour than the koha-restart-zebra script
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>