Lines 71-76
Options:
Link Here
|
71 |
conjunction with --defaultsql and --populate-db. |
71 |
conjunction with --defaultsql and --populate-db. |
72 |
--upload-path dir Set a user defined upload_path. It defaults to |
72 |
--upload-path dir Set a user defined upload_path. It defaults to |
73 |
/var/lib/koha/<instance>/uploads |
73 |
/var/lib/koha/<instance>/uploads |
|
|
74 |
--force-https Set up a https-only site with letsencrypt certificates |
74 |
--help,-h Show this help. |
75 |
--help,-h Show this help. |
75 |
|
76 |
|
76 |
Note: the instance name cannot be longer that 11 chars. |
77 |
Note: the instance name cannot be longer that 11 chars. |
Lines 354-359
END_BIBLIOS_RETRIEVAL_INFO=""
Link Here
|
354 |
START_AUTHORITIES_RETRIEVAL_INFO="" |
355 |
START_AUTHORITIES_RETRIEVAL_INFO="" |
355 |
END_AUTHORITIES_RETRIEVAL_INFO="" |
356 |
END_AUTHORITIES_RETRIEVAL_INFO="" |
356 |
|
357 |
|
|
|
358 |
APACHE_CONFIGFILE="" |
359 |
LETSENCRYPT_PATH="" |
360 |
|
357 |
if [ -e /etc/koha/koha-sites.conf ] |
361 |
if [ -e /etc/koha/koha-sites.conf ] |
358 |
then |
362 |
then |
359 |
. /etc/koha/koha-sites.conf |
363 |
. /etc/koha/koha-sites.conf |
Lines 378-384
CLO_MEMCACHED_SERVERS=""
Link Here
|
378 |
CLO_MEMCACHED_PREFIX="" |
382 |
CLO_MEMCACHED_PREFIX="" |
379 |
CLO_UPLOAD_PATH="" |
383 |
CLO_UPLOAD_PATH="" |
380 |
|
384 |
|
381 |
|
|
|
382 |
while true ; do |
385 |
while true ; do |
383 |
case "$1" in |
386 |
case "$1" in |
384 |
-c|--create-db) |
387 |
-c|--create-db) |
Lines 419-424
while true ; do
Link Here
|
419 |
SRU_SERVER_PORT="$2" ; shift 2 ;; |
422 |
SRU_SERVER_PORT="$2" ; shift 2 ;; |
420 |
--upload-path) |
423 |
--upload-path) |
421 |
CLO_UPLOAD_PATH="$2" ; shift 2 ;; |
424 |
CLO_UPLOAD_PATH="$2" ; shift 2 ;; |
|
|
425 |
--force-https) |
426 |
USE_HTTPS="yes" ; shift ;; |
427 |
--letsencrypt) |
428 |
LETSENCRYPT_PATH="$2" ; shift 2 ;; |
422 |
-h|--help) |
429 |
-h|--help) |
423 |
usage ; exit 0 ;; |
430 |
usage ; exit 0 ;; |
424 |
--) |
431 |
--) |
Lines 598-605
FLUSH PRIVILEGES;
Link Here
|
598 |
eof |
605 |
eof |
599 |
fi #` |
606 |
fi #` |
600 |
|
607 |
|
|
|
608 |
if [ "$USE_HTTPS" = "yes" ]; then |
609 |
APACHE_CONFIGFILE = "apache-site-https.conf.in" |
610 |
else |
611 |
APACHE_CONFIGFILE = "apache-site.conf.in" |
612 |
fi |
601 |
# Generate and install Apache site-available file and log dir. |
613 |
# Generate and install Apache site-available file and log dir. |
602 |
generate_config_file apache-site.conf.in \ |
614 |
generate_config_file $APACHE_CONFIGFILE \ |
603 |
"/etc/apache2/sites-available/$name.conf" |
615 |
"/etc/apache2/sites-available/$name.conf" |
604 |
mkdir "/var/log/koha/$name" |
616 |
mkdir "/var/log/koha/$name" |
605 |
chown "$username:$username" "/var/log/koha/$name" |
617 |
chown "$username:$username" "/var/log/koha/$name" |
Lines 708-713
then
Link Here
|
708 |
# Start Indexer daemon |
720 |
# Start Indexer daemon |
709 |
koha-indexer --start "$name" |
721 |
koha-indexer --start "$name" |
710 |
fi |
722 |
fi |
|
|
723 |
|
724 |
if [ "$USE_HTTPS" = "yes" ]; then |
725 |
# Get letsencrypt certificates |
726 |
# TODO: fix path of letsencrypt |
727 |
$LETSENCRYPT_PATH/letsencrypt-auto --agree-tos --renew-by-default --webroot --server https://acme-v01.api.letsencrypt.org/directory certonly -w /usr/share/koha/opac/htdocs/ -d $opacdomain -w /usr/share/koha/intranet/htdocs/ -d $intradomain |
728 |
# enable all ssl settings (apache won't start with these before certs are present) |
729 |
sed -i "s:^\s*#\(\s*SSL.*\)$:\1:" "/etc/apache2/sites-available/$name.conf" |
730 |
# change port from 80 to 443. (apache won't start if it is 443 without certs present) |
731 |
sed -i "s:^\s*\(<VirtualHost \*\:\)80> #ssl$:\1443>:" "/etc/apache2/sites-available/$name.conf" |
732 |
# TODO: enable forward from 80 to https |
733 |
# restart apache with working certs |
734 |
service apache2 restart |
735 |
fi |
711 |
fi |
736 |
fi |
712 |
|
737 |
|
713 |
|
738 |
|