Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
New option koha-create --letsencrypt
- installs the letsencrypt package if needed
- creates <instance>
- generates letsencrypt certificates for <instance>
- sets up a https-only website for <instance>
- redirects http to https for <instance>
! you need to enable jessie backports to install letsencrypt: add
deb http://http.debian.net/debian jessie-backports main contrib non-free
to your /etc/apt/sources.list
! this patch uses the letsencrypt staging server
to create real certificates, apply thy "LE production server" patch
Test plan:
- build a debian package with patch applied
- use apache mod_ssl
sudo a2enmod ssl
- make sure the machine is accessible on 80 (needed for letsencrypt) and 443 from the internet
- install koha with your new package
- Put your (existing) domain options in /etc/koha/koha-sites.conf
- use koha-create with the new options:
sudo koha-create --create-db --letsencrypt <instance>
- if you do not have the letsencrypt package installed, you will be prompted to do that
[
if there is no package available, a symlink to the git checkout will work:
on your test server, get letsencrypt via git
git clone https://github.com/letsencrypt/letsencrypt
create a symlink from /usr/bin/letsencrypt to letsencrypt-auto
sudo ln -s /path/to/letsencrypt/letsencrypt-auto /usr/bin/letsencrypt
]
- wait until setup is finished, check that you got a working OPAC and staff client with certificates
- check that http redirects to https
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This patch adds the --plack and --noplack option switches to koha-list
for filtering instances to be listed.
This is particularly important for init scripts and cronjobs.
To test:
- Play with koha-list --plack and koha-plack --enable/--disable and verify that
koha-list returns the expected results.
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
As asked by Robin, a bash lib of functions is introduced with the common
functions to be reused. Most of the scripts are modified (reduced) to
include this file and the repeated functions cleaned.
No noticeable change in behaviour should be noticed.
As I've been todl in #debian-mentors, it is used that files for inclusion
should be installed at the apps directory (i.e. /usr/share/koha/) so this
patch makes the install script put the file in the bin/ directory.
All koha-* scripts assume the file is there already (and fail otherwise).
Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Robin Sheat <robin@catalyst.net.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Apache 2.4 expects the sites definition files use the sufix '.conf'
To reproduce:
- Install the 'koha-common' package on Debian 7 or Ubuntu 13.10+
(both known to include Apache 2.4).
- Create an instance (for example testlibrary) using the supplied
commands:
$ koha-create --create-db testlibrary
> FAIL: apache reports an error like this:
"ERROR: Site testlibrary does not exist!"
This patch adds a test on the Apache version and appends the ".conf"
sufix if needed.
To test:
1st step: koha-create gets fixed:
-- The hard way --
- Apply the patch, and build the koha-common package on top of this
commit.
- Install the built package on an Apache 2.4 Debian-based distro (Debian 7
or Ubuntu 13.10 will work)
- Create a test instance:
$ koha-create --create-db testlibrary
> SUCCESS: no more apache sites related error.
-- The easy way --
- Apply the patch, and copy the koha-create into an Apache 2.4
Debian-based distro
- Create a test instance using the koha-create script you just
copied:
$ ./koha-create --create-db testlibrary
> SUCCESS: no more apache sites related error.
2nd step: the rest of the touched scripts keep working as usual
koha-disable
koha-dump
koha-enable
koha-list
koha-remove
koha-restart-zebra
koha-stop-zebra
koha-start-zebra
They should all keep working. Can be tested "the easy way" too.
Note: there might be another issues regarding Apache 2.4 deployments
like the need for
$ a2enmod access_compat
and perhaps some directory permissions tweak, which I think should be
properly documented on the install instructions.
Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Robin Sheat <robin@catalyst.net.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Just added those switches.
Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Magnus Enger <magnus@enger.priv.no>
I applied the patch on my local dev install, and then copied the
patched koha-list script to a couple of servers with actual
instances running off the packages, to test the script.
- It seems that the -h switch did not work before this patch, now
both -h and --help works nicely
- --sip and --nosip work as expected, also in combination with
--email and --noemail
The patch does not add --sip and --nosip to the man page for
koha-list, but I will do a followup for that.
Signed-off-by: Robin Sheat <robin@catalyst.net.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This patch adds that (--disabled) option switch, Also revisits some of the code and docs.
To test:
- Apply the patch and create new packages (you might just drop the koha-list command somewhere)
- Create several instances (koha-create)
- Randomly set some as disabled, others enabled and enable email on some.
- Test all possible option switches combinations
Expected results:
- koha-list should abort with a proper message if mutually exclusive options selected (--email vs. --noemail, --enabled vs. --disabled)
- koha-list should show the exact instances you asked for
Regards
To+
P.S.: I wanted to add the --disabled option switch for the tab-completion work I'm doing, but as of bug 4876 I thought it would be ok to revisit the script to make it robust and clear.
Sponsored-by: Universidad Nacional de Córdoba
Signed-off-by: Robin Sheat <robin@catalyst.net.nz>
Does what it says, and cleans up the script at the same time.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
By default the packages now set up the cron jobs to handle things like
overdues and email etc. By default, email is off, 'koha-email-enable'
and 'koha-email-disable' can manage this.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>